aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2015-02-16 22:55:46 +0100
committerSamuel Tardieu <sam@rfc1149.net>2015-02-16 22:55:46 +0100
commit9e4c5b5882ba0c6d0b26fe65718e15ac87a2b555 (patch)
tree4f8f73982ec0865b42595add1b7c5b5d88b969ff /tests
parent02d7eda64bc7827bc82ddbf969ba537abe542919 (diff)
downloadcgeo-9e4c5b5882ba0c6d0b26fe65718e15ac87a2b555.zip
cgeo-9e4c5b5882ba0c6d0b26fe65718e15ac87a2b555.tar.gz
cgeo-9e4c5b5882ba0c6d0b26fe65718e15ac87a2b555.tar.bz2
Rename DateUtils into CalendarUtils
cgeo uses android.text.format.DateUtils, having a utility class with the same name in a different package might be confusing.
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/files/GPXParserTest.java4
-rw-r--r--tests/src/cgeo/geocaching/utils/CalendarUtilsTest.java (renamed from tests/src/cgeo/geocaching/utils/DateUtilsTest.java)16
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java
index 8562087..7c40b2a 100644
--- a/tests/src/cgeo/geocaching/files/GPXParserTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java
@@ -16,7 +16,7 @@ import cgeo.geocaching.enumerations.WaypointType;
import cgeo.geocaching.location.Geopoint;
import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase;
import cgeo.geocaching.test.R;
-import cgeo.geocaching.utils.DateUtils;
+import cgeo.geocaching.utils.CalendarUtils;
import cgeo.geocaching.utils.SynchronizedDateFormat;
import java.io.IOException;
@@ -179,7 +179,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
assertThat(log.log).isEqualTo("Sehr schöne Runde und wir haben wieder etwas Neues über Hockenheim gelernt. Super Tarnung.\nTFTC, Geoteufel");
assertThat(log.isOwn()).isFalse();
assertThat(log.getDisplayText()).isEqualTo(log.log);
- assertThat(DateUtils.daysSince(log.date) > 700).isTrue();
+ assertThat(CalendarUtils.daysSince(log.date) > 700).isTrue();
// following info is not contained in pocket query gpx file
assertThat(cache.getAttributes()).isEmpty();
diff --git a/tests/src/cgeo/geocaching/utils/DateUtilsTest.java b/tests/src/cgeo/geocaching/utils/CalendarUtilsTest.java
index 44442f6..c074903 100644
--- a/tests/src/cgeo/geocaching/utils/DateUtilsTest.java
+++ b/tests/src/cgeo/geocaching/utils/CalendarUtilsTest.java
@@ -5,17 +5,17 @@ import static org.assertj.core.api.Assertions.assertThat;
import cgeo.geocaching.Geocache;
import cgeo.geocaching.enumerations.CacheType;
-import java.util.Calendar;
-
import junit.framework.TestCase;
-public class DateUtilsTest extends TestCase {
+import java.util.Calendar;
+
+public class CalendarUtilsTest extends TestCase {
public static void testDaysSince() {
final Calendar start = Calendar.getInstance();
for (int hour = 0; hour < 24; hour++) {
start.set(Calendar.HOUR_OF_DAY, hour);
- assertThat(DateUtils.daysSince(start.getTimeInMillis())).isEqualTo(0);
+ assertThat(CalendarUtils.daysSince(start.getTimeInMillis())).isEqualTo(0);
}
}
@@ -37,17 +37,17 @@ public class DateUtilsTest extends TestCase {
cache.setType(CacheType.EVENT);
cache.setHidden(start.getTime());
- assertThat(DateUtils.isPastEvent(cache)).isEqualTo(expectedPast);
+ assertThat(CalendarUtils.isPastEvent(cache)).isEqualTo(expectedPast);
}
public static void testIsFuture() {
final Calendar date = Calendar.getInstance();
- assertThat(DateUtils.isFuture(date)).isFalse();
+ assertThat(CalendarUtils.isFuture(date)).isFalse();
date.add(Calendar.DAY_OF_MONTH, 1);
- assertThat(DateUtils.isFuture(date)).isFalse();
+ assertThat(CalendarUtils.isFuture(date)).isFalse();
date.add(Calendar.DAY_OF_MONTH, 1);
- assertThat(DateUtils.isFuture(date)).isTrue();
+ assertThat(CalendarUtils.isFuture(date)).isTrue();
}
}