70 import org.gege.caldavsyncadapter.caldav.entities.CalendarEvent; |
70 import org.gege.caldavsyncadapter.caldav.entities.CalendarEvent; |
71 |
71 |
72 import java.net.URISyntaxException; |
72 import java.net.URISyntaxException; |
73 import java.text.ParseException; |
73 import java.text.ParseException; |
74 |
74 |
|
75 import static org.junit.Assert.*; |
|
76 |
75 import com.europalab.caldavsyn.Appctxpro; |
77 import com.europalab.caldavsyn.Appctxpro; |
76 |
78 |
77 //import android.accounts.Account; |
79 //import android.accounts.Account; |
78 //import android.content.ContentProviderClient; |
80 //import android.content.ContentProviderClient; |
79 //import android.content.ContentValues; |
81 //import android.content.ContentValues; |
317 * @see CalendarEvent#fetchBody() |
319 * @see CalendarEvent#fetchBody() |
318 */ |
320 */ |
319 public boolean createIcs(String strUid) { |
321 public boolean createIcs(String strUid) { |
320 boolean Result = false; |
322 boolean Result = false; |
321 TimeZone timeZone = null; |
323 TimeZone timeZone = null; |
322 //Thread.currentThread().setContextClassLoader(Context.getApplicationContext().getClassLoader()); |
324 // Hack to bootstrap a multithreaded class loader context |
323 Thread.currentThread().setContextClassLoader(Appctxpro.getContext().getClassLoader()); |
325 if (Thread.currentThread().getContextClassLoader() == null) |
324 TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry(); |
326 Thread.currentThread().setContextClassLoader(Appctxpro.getContext().getClassLoader()); |
|
327 TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance(); |
|
328 assertNotNull(registry); |
|
329 registry.createRegistry(); |
325 //TODO: do not simply create the ics-file new. take into account the RAWDATA if available |
330 //TODO: do not simply create the ics-file new. take into account the RAWDATA if available |
326 /* |
331 /* |
327 * dtstart=1365598800000 |
332 * dtstart=1365598800000 |
328 * dtend=1365602400000 |
333 * dtend=1365602400000 |
329 * eventTimezone=Europe/Berlin |
334 * eventTimezone=Europe/Berlin |