Permalink
Browse files

Merge pull request #33 from nbeloglazov/thread_safe

Fix tests with uninitialised calendar and parser.
  • Loading branch information...
2 parents 047f16a + 7226841 commit 5adc63961d3b9223b4df206bbbb65b9d484b60fa @joestelmach committed Apr 5, 2012
@@ -2,8 +2,11 @@
import java.text.DateFormat;
import java.util.Date;
+import java.util.Locale;
+import java.util.TimeZone;
import junit.framework.Assert;
+import org.junit.BeforeClass;
import org.junit.Test;
@@ -12,6 +15,12 @@
* @author Joe Stelmach
*/
public class RecurrenceTest extends AbstractTest {
+ @BeforeClass
+ public static void oneTime() {
+ Locale.setDefault(Locale.US);
+ TimeZone.setDefault(TimeZone.getTimeZone("US/Eastern"));
+ initCalendarAndParser();
+ }
@Test
public void testRelative() throws Exception {
@@ -3,10 +3,13 @@
import java.text.DateFormat;
import java.util.Date;
import java.util.List;
+import java.util.Locale;
+import java.util.TimeZone;
import junit.framework.Assert;
import org.junit.Test;
+import org.junit.BeforeClass;
import com.joestelmach.natty.CalendarSource;
import com.joestelmach.natty.DateGroup;
@@ -17,6 +20,12 @@
* @author Joe Stelmach
*/
public class SearchTest extends AbstractTest {
+ @BeforeClass
+ public static void oneTime() {
+ Locale.setDefault(Locale.US);
+ TimeZone.setDefault(TimeZone.getTimeZone("US/Eastern"));
+ initCalendarAndParser();
+ }
@Test
public void test() throws Exception {

0 comments on commit 5adc639

Please sign in to comment.