diff options
Diffstat (limited to 'tests/src')
| -rw-r--r-- | tests/src/cgeo/geocaching/TrackableTest.java | 4 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/WaypointTest.java (renamed from tests/src/cgeo/geocaching/cgWaypointTest.java) | 16 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/cgDataTest.java | 4 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/cgeoApplicationTest.java | 6 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/connector/gc/GCParserTest.java | 8 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java | 28 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/files/GPXParserTest.java | 4 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/test/mock/GC2JVEH.java | 16 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/test/mock/MockedCache.java | 8 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/ui/FormatterTest.java | 12 |
10 files changed, 53 insertions, 53 deletions
diff --git a/tests/src/cgeo/geocaching/TrackableTest.java b/tests/src/cgeo/geocaching/TrackableTest.java index b52139a..c18d1ea 100644 --- a/tests/src/cgeo/geocaching/TrackableTest.java +++ b/tests/src/cgeo/geocaching/TrackableTest.java @@ -5,13 +5,13 @@ import android.test.AndroidTestCase; public class TrackableTest extends AndroidTestCase { public static void testGetGeocode() { - cgTrackable trackable = new cgTrackable(); + Trackable trackable = new Trackable(); trackable.setGeocode("tb1234"); assertEquals("TB1234", trackable.getGeocode()); } public static void testSetLogsNull() { - cgTrackable trackable = new cgTrackable(); + Trackable trackable = new Trackable(); trackable.setLogs(null); assertNotNull("Trackable logs must not be null!", trackable.getLogs()); } diff --git a/tests/src/cgeo/geocaching/cgWaypointTest.java b/tests/src/cgeo/geocaching/WaypointTest.java index 6665c51..273a3bf 100644 --- a/tests/src/cgeo/geocaching/cgWaypointTest.java +++ b/tests/src/cgeo/geocaching/WaypointTest.java @@ -4,15 +4,15 @@ import cgeo.geocaching.enumerations.WaypointType; import android.test.AndroidTestCase; -public class cgWaypointTest extends AndroidTestCase { +public class WaypointTest extends AndroidTestCase { public static void testOrder() { - final cgWaypoint cache = new cgWaypoint("Final", WaypointType.FINAL, false); - final cgWaypoint trailhead = new cgWaypoint("Trail head", WaypointType.TRAILHEAD, false); - final cgWaypoint stage = new cgWaypoint("stage", WaypointType.STAGE, false); - final cgWaypoint puzzle = new cgWaypoint("puzzle", WaypointType.PUZZLE, false); - final cgWaypoint own = new cgWaypoint("own", WaypointType.OWN, true); - final cgWaypoint parking = new cgWaypoint("parking", WaypointType.PARKING, false); + final Waypoint cache = new Waypoint("Final", WaypointType.FINAL, false); + final Waypoint trailhead = new Waypoint("Trail head", WaypointType.TRAILHEAD, false); + final Waypoint stage = new Waypoint("stage", WaypointType.STAGE, false); + final Waypoint puzzle = new Waypoint("puzzle", WaypointType.PUZZLE, false); + final Waypoint own = new Waypoint("own", WaypointType.OWN, true); + final Waypoint parking = new Waypoint("parking", WaypointType.PARKING, false); assertTrue(trailhead.compareTo(puzzle) < 0); assertTrue(trailhead.compareTo(stage) < 0); @@ -34,7 +34,7 @@ public class cgWaypointTest extends AndroidTestCase { } public static void testGeocode() { - cgWaypoint waypoint = new cgWaypoint("Test waypoint", WaypointType.PARKING, false); + Waypoint waypoint = new Waypoint("Test waypoint", WaypointType.PARKING, false); waypoint.setGeocode("p1"); assertEquals("P1", waypoint.getGeocode()); } diff --git a/tests/src/cgeo/geocaching/cgDataTest.java b/tests/src/cgeo/geocaching/cgDataTest.java index f4b71f3..1c8a0e0 100644 --- a/tests/src/cgeo/geocaching/cgDataTest.java +++ b/tests/src/cgeo/geocaching/cgDataTest.java @@ -107,9 +107,9 @@ public class cgDataTest extends CGeoTestCase { final cgCache cache = new cgCache(); cache.setGeocode(GEOCODE_CACHE); cache.setDetailed(true); - final cgTrackable trackable = new cgTrackable(); + final Trackable trackable = new Trackable(); trackable.setLogs(null); - final List<cgTrackable> inventory = new ArrayList<cgTrackable>(); + final List<Trackable> inventory = new ArrayList<Trackable>(); inventory.add(trackable); cache.setInventory(inventory); diff --git a/tests/src/cgeo/geocaching/cgeoApplicationTest.java b/tests/src/cgeo/geocaching/cgeoApplicationTest.java index 5e23d98..81c97ee 100644 --- a/tests/src/cgeo/geocaching/cgeoApplicationTest.java +++ b/tests/src/cgeo/geocaching/cgeoApplicationTest.java @@ -56,7 +56,7 @@ public class cgeoApplicationTest extends CGeoTestCase { */ @MediumTest public static void testSearchTrackableNotExisting() { - cgTrackable tb = GCParser.searchTrackable("123456", null, null); + Trackable tb = GCParser.searchTrackable("123456", null, null); assertNull(tb); } @@ -65,7 +65,7 @@ public class cgeoApplicationTest extends CGeoTestCase { */ @MediumTest public static void testSearchTrackable() { - final cgTrackable tb = GCParser.searchTrackable("TB2J1VZ", null, null); + final Trackable tb = GCParser.searchTrackable("TB2J1VZ", null, null); // fix data assertEquals("aefffb86-099f-444f-b132-605436163aa8", tb.getGuid()); assertEquals("TB2J1VZ", tb.getGeocode()); @@ -82,7 +82,7 @@ public class cgeoApplicationTest extends CGeoTestCase { // Following data can change over time assertTrue(tb.getDistance() >= 10617.8f); assertTrue(tb.getLogs().size() >= 10); - assertTrue(cgTrackable.SPOTTED_CACHE == tb.getSpottedType() || cgTrackable.SPOTTED_USER == tb.getSpottedType()); + assertTrue(Trackable.SPOTTED_CACHE == tb.getSpottedType() || Trackable.SPOTTED_USER == tb.getSpottedType()); // no assumption possible: assertEquals("faa2d47d-19ea-422f-bec8-318fc82c8063", tb.getSpottedGuid()); // no assumption possible: assertEquals("Nice place for a break cache", tb.getSpottedName()); diff --git a/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java b/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java index 0f1f4cf..6a49c95 100644 --- a/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java +++ b/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java @@ -1,10 +1,10 @@ package cgeo.geocaching.connector.gc; +import cgeo.geocaching.Image; import cgeo.geocaching.SearchResult; import cgeo.geocaching.Settings; import cgeo.geocaching.cgCache; -import cgeo.geocaching.cgImage; -import cgeo.geocaching.cgWaypoint; +import cgeo.geocaching.Waypoint; import cgeo.geocaching.enumerations.LoadFlags; import cgeo.geocaching.enumerations.StatusCode; import cgeo.geocaching.geopoint.Geopoint; @@ -65,7 +65,7 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase { assertNotNull(cache); assertTrue(CollectionUtils.isNotEmpty(cache.getSpoilers())); assertEquals(1, cache.getSpoilers().size()); - final cgImage spoiler = cache.getSpoilers().get(0); + final Image spoiler = cache.getSpoilers().get(0); assertEquals("http://img.geocaching.com/cache/large/3f9365c3-f55c-4e55-9992-ee0e5175712c.jpg", spoiler.getUrl()); assertEquals("SPOILER", spoiler.getTitle()); assertNull(spoiler.getDescription()); @@ -171,7 +171,7 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase { private static void assertWaypointsFromNote(final cgCache cache, Geopoint[] expected, String note) { cache.setPersonalNote(note); - cache.setWaypoints(new ArrayList<cgWaypoint>(), false); + cache.setWaypoints(new ArrayList<Waypoint>(), false); cache.parseWaypointsFromNote(); assertEquals(expected.length, cache.getWaypoints().size()); for (int i = 0; i < expected.length; i++) { diff --git a/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java b/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java index 4c2655d..ea430ac 100644 --- a/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java +++ b/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java @@ -1,9 +1,9 @@ package cgeo.geocaching.connector.gc; +import cgeo.geocaching.Image; import cgeo.geocaching.LogEntry; import cgeo.geocaching.TrackableLog; -import cgeo.geocaching.cgImage; -import cgeo.geocaching.cgTrackable; +import cgeo.geocaching.Trackable; import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase; import cgeo.geocaching.test.R; @@ -29,20 +29,20 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { } public void testTrackable() { - final cgTrackable trackable = getTB2R124(); + final Trackable trackable = getTB2R124(); assertEquals("TB2R124", trackable.getGeocode()); assertEquals("Bor. Dortmund - FC Schalke 04", trackable.getName()); assertEquals("Spiridon Lui", trackable.getOwner()); } public void testTrackableWithoutImage() { - final cgTrackable trackable = getTB2R124(); + final Trackable trackable = getTB2R124(); assertNull(trackable.getImage()); assertNotNull(trackable.getDetails()); } public void testTrackableWithLogImages() { - final cgTrackable trackable = getTBXATG(); + final Trackable trackable = getTBXATG(); assertEquals("TBXATG", trackable.getGeocode()); List<LogEntry> log = trackable.getLogs(); @@ -50,7 +50,7 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { assertEquals(10, log.size()); // log entry 4 has several images; just check first two - final List<cgImage> log4Images = log.get(4).getLogImages(); + final List<Image> log4Images = log.get(4).getLogImages(); assertNotNull(log4Images); assertEquals(5, log4Images.size()); assertEquals("http://img.geocaching.com/track/log/large/f2e24c50-394c-4d74-8fb4-87298d8bff1d.jpg", log4Images.get(0).getUrl()); @@ -59,7 +59,7 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { assertEquals("8 Crater Lake Natl Park Oregon", log4Images.get(1).getTitle()); // third log entry has one image - final List<cgImage> log5Images = log.get(5).getLogImages(); + final List<Image> log5Images = log.get(5).getLogImages(); assertNotNull(log5Images); assertEquals(1, log5Images.size()); assertEquals("http://img.geocaching.com/track/log/large/0096b42d-4d10-45fa-9be2-2d08c0d5cc61.jpg", log5Images.get(0).getUrl()); @@ -72,7 +72,7 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { } public void testParseTrackableWithoutReleaseDate() { - cgTrackable trackable = parseTrackable(R.raw.tb14wfv); + Trackable trackable = parseTrackable(R.raw.tb14wfv); assertNotNull(trackable); assertEquals("The Brickster", trackable.getName()); assertEquals("Adrian C", trackable.getOwner()); @@ -85,7 +85,7 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { } public void testParseRelativeLink() { - final cgTrackable trackable = parseTrackable(R.raw.tb4cwjx); + final Trackable trackable = parseTrackable(R.raw.tb4cwjx); assertNotNull(trackable); assertEquals("The Golden Lisa", trackable.getName()); final String goal = trackable.getGoal(); @@ -94,13 +94,13 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { assertTrue(goal.contains("href=\"http://www.geocaching.com/seek/cache_details.aspx?wp=GC3B7PD#\"")); } - private cgTrackable parseTrackable(int trackablePage) { + private Trackable parseTrackable(int trackablePage) { String pageContent = getFileContent(trackablePage); return GCParser.parseTrackable(BaseUtils.replaceWhitespace(pageContent), null); } public void testParseMarkMissing() { - final cgTrackable trackable = parseTrackable(R.raw.tb29ggq); + final Trackable trackable = parseTrackable(R.raw.tb29ggq); assertNotNull(trackable); final List<LogEntry> logs = trackable.getLogs(); assertNotNull(logs); @@ -109,16 +109,16 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { assertEquals(LogType.MARKED_MISSING, marked.type); } - private cgTrackable getTB2R124() { + private Trackable getTB2R124() { return parseTrackable(R.raw.trackable_tb2r124); } - private cgTrackable getTBXATG() { + private Trackable getTBXATG() { return parseTrackable(R.raw.trackable_tbxatg); } public void testParseTrackableNotExisting() { - cgTrackable trackable = GCParser.parseTrackable(getFileContent(R.raw.tb_not_existing), null); + Trackable trackable = GCParser.parseTrackable(getFileContent(R.raw.tb_not_existing), null); assertNull(trackable); } diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java index bf09256..bbb4514 100644 --- a/tests/src/cgeo/geocaching/files/GPXParserTest.java +++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java @@ -5,7 +5,7 @@ import cgeo.geocaching.SearchResult; import cgeo.geocaching.StoredList; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgData; -import cgeo.geocaching.cgWaypoint; +import cgeo.geocaching.Waypoint; import cgeo.geocaching.enumerations.CacheSize; import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.enumerations.LoadFlags; @@ -167,7 +167,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase { private static void assertGc31j2hWaypoints(final cgCache cache) { assertNotNull(cache.getWaypoints()); assertEquals(2, cache.getWaypoints().size()); - cgWaypoint wp = cache.getWaypoints().get(1); + Waypoint wp = cache.getWaypoints().get(1); assertEquals("GC31J2H", wp.getGeocode()); assertEquals("00", wp.getPrefix()); assertEquals("---", wp.getLookup()); diff --git a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java index 9aa18f9..5e8a1d7 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java +++ b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java @@ -1,7 +1,7 @@ package cgeo.geocaching.test.mock; -import cgeo.geocaching.cgImage; -import cgeo.geocaching.cgTrackable; +import cgeo.geocaching.Image; +import cgeo.geocaching.Trackable; import cgeo.geocaching.connector.gc.Login; import cgeo.geocaching.enumerations.CacheSize; import cgeo.geocaching.enumerations.CacheType; @@ -133,16 +133,16 @@ public class GC2JVEH extends MockedCache { } @Override - public List<cgTrackable> getInventory() { - final ArrayList<cgTrackable> inventory = new ArrayList<cgTrackable>(); - inventory.add(new cgTrackable()); + public List<Trackable> getInventory() { + final ArrayList<Trackable> inventory = new ArrayList<Trackable>(); + inventory.add(new Trackable()); return inventory; } @Override - public List<cgImage> getSpoilers() { - final ArrayList<cgImage> spoilers = new ArrayList<cgImage>(); - final cgImage mockedImage = new cgImage(null, null, null); + public List<Image> getSpoilers() { + final ArrayList<Image> spoilers = new ArrayList<Image>(); + final Image mockedImage = new Image(null, null, null); spoilers.add(mockedImage); spoilers.add(mockedImage); spoilers.add(mockedImage); diff --git a/tests/src/cgeo/geocaching/test/mock/MockedCache.java b/tests/src/cgeo/geocaching/test/mock/MockedCache.java index 8517c81..f667264 100644 --- a/tests/src/cgeo/geocaching/test/mock/MockedCache.java +++ b/tests/src/cgeo/geocaching/test/mock/MockedCache.java @@ -1,8 +1,8 @@ package cgeo.geocaching.test.mock; import cgeo.geocaching.ICache; -import cgeo.geocaching.cgImage; -import cgeo.geocaching.cgTrackable; +import cgeo.geocaching.Image; +import cgeo.geocaching.Trackable; import cgeo.geocaching.connector.gc.GCConstants; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.utils.BaseUtils; @@ -134,12 +134,12 @@ public abstract class MockedCache implements ICache { } @Override - public List<cgTrackable> getInventory() { + public List<Trackable> getInventory() { return null; } @Override - public List<cgImage> getSpoilers() { + public List<Image> getSpoilers() { return null; } diff --git a/tests/src/cgeo/geocaching/ui/FormatterTest.java b/tests/src/cgeo/geocaching/ui/FormatterTest.java index 8f48abb..5546ea5 100644 --- a/tests/src/cgeo/geocaching/ui/FormatterTest.java +++ b/tests/src/cgeo/geocaching/ui/FormatterTest.java @@ -1,7 +1,7 @@ package cgeo.geocaching.ui; import cgeo.geocaching.R; -import cgeo.geocaching.cgWaypoint; +import cgeo.geocaching.Waypoint; import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.enumerations.WaypointType; @@ -10,20 +10,20 @@ import android.test.AndroidTestCase; public class FormatterTest extends AndroidTestCase { public static void testParkingWaypoint() { - assertFormatting(new cgWaypoint("you can park here", WaypointType.PARKING, false), WaypointType.PARKING.getL10n()); + assertFormatting(new Waypoint("you can park here", WaypointType.PARKING, false), WaypointType.PARKING.getL10n()); } public static void testOriginalWaypoint() { - assertFormatting(new cgWaypoint("an original", WaypointType.ORIGINAL, false), WaypointType.ORIGINAL.getL10n()); + assertFormatting(new Waypoint("an original", WaypointType.ORIGINAL, false), WaypointType.ORIGINAL.getL10n()); } public static void testOwnWaypoint() { - cgWaypoint own = new cgWaypoint("my own", WaypointType.OWN, true); - own.setPrefix(cgWaypoint.PREFIX_OWN); + Waypoint own = new Waypoint("my own", WaypointType.OWN, true); + own.setPrefix(Waypoint.PREFIX_OWN); assertFormatting(own, cgeoapplication.getInstance().getString(R.string.waypoint_custom)); } - private static void assertFormatting(cgWaypoint waypoint, String expected) { + private static void assertFormatting(Waypoint waypoint, String expected) { assertEquals(expected, Formatter.formatWaypointInfo(waypoint)); } |
