Skip to content
This repository

Fix tests with uninitialised calendar and parser. #33

Merged
merged 1 commit into from over 2 years ago

2 participants

Nikita Beloglazov Joe Stelmach
Nikita Beloglazov

Fixes #30.

Joe Stelmach joestelmach merged commit 5adc639 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 02, 2012
Nikita Beloglazov nbeloglazov Fix tests with uninitialised calendar and parser. 7226841
This page is out of date. Refresh to see the latest.
9 src/test/java/com/joestelmach/natty/RecurrenceTest.java
@@ -2,8 +2,11 @@
2 2
3 3 import java.text.DateFormat;
4 4 import java.util.Date;
  5 +import java.util.Locale;
  6 +import java.util.TimeZone;
5 7
6 8 import junit.framework.Assert;
  9 +import org.junit.BeforeClass;
7 10
8 11 import org.junit.Test;
9 12
@@ -12,6 +15,12 @@
12 15 * @author Joe Stelmach
13 16 */
14 17 public class RecurrenceTest extends AbstractTest {
  18 + @BeforeClass
  19 + public static void oneTime() {
  20 + Locale.setDefault(Locale.US);
  21 + TimeZone.setDefault(TimeZone.getTimeZone("US/Eastern"));
  22 + initCalendarAndParser();
  23 + }
15 24
16 25 @Test
17 26 public void testRelative() throws Exception {
9 src/test/java/com/joestelmach/natty/SearchTest.java
@@ -3,10 +3,13 @@
3 3 import java.text.DateFormat;
4 4 import java.util.Date;
5 5 import java.util.List;
  6 +import java.util.Locale;
  7 +import java.util.TimeZone;
6 8
7 9 import junit.framework.Assert;
8 10
9 11 import org.junit.Test;
  12 +import org.junit.BeforeClass;
10 13
11 14 import com.joestelmach.natty.CalendarSource;
12 15 import com.joestelmach.natty.DateGroup;
@@ -17,6 +20,12 @@
17 20 * @author Joe Stelmach
18 21 */
19 22 public class SearchTest extends AbstractTest {
  23 + @BeforeClass
  24 + public static void oneTime() {
  25 + Locale.setDefault(Locale.US);
  26 + TimeZone.setDefault(TimeZone.getTimeZone("US/Eastern"));
  27 + initCalendarAndParser();
  28 + }
20 29
21 30 @Test
22 31 public void test() throws Exception {

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.