aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/TrackablesTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/TrackablesTest.java')
-rw-r--r--tests/src/cgeo/geocaching/TrackablesTest.java27
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/src/cgeo/geocaching/TrackablesTest.java b/tests/src/cgeo/geocaching/TrackablesTest.java
index 1d3d165..3cb34a6 100644
--- a/tests/src/cgeo/geocaching/TrackablesTest.java
+++ b/tests/src/cgeo/geocaching/TrackablesTest.java
@@ -1,5 +1,6 @@
package cgeo.geocaching;
+import cgeo.geocaching.connector.gc.GCParser;
import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase;
import cgeo.geocaching.test.R;
import cgeo.geocaching.utils.BaseUtils;
@@ -9,16 +10,16 @@ import java.util.List;
public class TrackablesTest extends AbstractResourceInstrumentationTestCase {
public void testLogPageWithTrackables() {
- List<cgTrackableLog> tbLogs = cgBase.parseTrackableLog(getFileContent(R.raw.log_with_2tb));
+ List<TrackableLog> tbLogs = GCParser.parseTrackableLog(getFileContent(R.raw.log_with_2tb));
assertNotNull(tbLogs);
assertEquals(2, tbLogs.size());
- cgTrackableLog log = tbLogs.get(0);
+ TrackableLog log = tbLogs.get(0);
assertEquals("Steffen's Kaiserwagen", log.name);
assertEquals("1QG1EE", log.trackCode);
}
public void testLogPageWithoutTrackables() {
- List<cgTrackableLog> tbLogs = cgBase.parseTrackableLog(getFileContent(R.raw.log_without_tb));
+ List<TrackableLog> tbLogs = GCParser.parseTrackableLog(getFileContent(R.raw.log_without_tb));
assertNotNull(tbLogs);
assertEquals(0, tbLogs.size());
}
@@ -40,20 +41,20 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase {
final cgTrackable trackable = getTBXATG();
assertEquals("TBXATG", trackable.getGeocode());
- List<cgLog> log = trackable.getLogs();
+ List<LogEntry> log = trackable.getLogs();
// second log entry has several images; just check first two
- assertEquals("http://img.geocaching.com/track/log/large/f2e24c50-394c-4d74-8fb4-87298d8bff1d.jpg", log.get(1).logImages.get(0).getUrl());
- assertEquals("7b Welcome to Geowoodstock", log.get(1).logImages.get(0).getTitle());
- assertEquals("http://img.geocaching.com/track/log/large/b57c29c3-134e-4202-a2a1-69ce8920b055.jpg", log.get(1).logImages.get(1).getUrl());
- assertEquals("8 Crater Lake Natl Park Oregon", log.get(1).logImages.get(1).getTitle());
+ assertEquals("http://img.geocaching.com/track/log/large/f2e24c50-394c-4d74-8fb4-87298d8bff1d.jpg", log.get(1).getLogImages().get(0).getUrl());
+ assertEquals("7b Welcome to Geowoodstock", log.get(1).getLogImages().get(0).getTitle());
+ assertEquals("http://img.geocaching.com/track/log/large/b57c29c3-134e-4202-a2a1-69ce8920b055.jpg", log.get(1).getLogImages().get(1).getUrl());
+ assertEquals("8 Crater Lake Natl Park Oregon", log.get(1).getLogImages().get(1).getTitle());
// third log entry has one image
- assertEquals("http://img.geocaching.com/track/log/large/0096b42d-4d10-45fa-9be2-2d08c0d5cc61.jpg", log.get(2).logImages.get(0).getUrl());
- assertEquals("Traverski&#39;s GC Univ coin on tour", log.get(2).logImages.get(0).getTitle());
+ assertEquals("http://img.geocaching.com/track/log/large/0096b42d-4d10-45fa-9be2-2d08c0d5cc61.jpg", log.get(2).getLogImages().get(0).getUrl());
+ assertEquals("Traverski&#39;s GC Univ coin on tour", log.get(2).getLogImages().get(0).getTitle());
}
public void testParseTrackableWithoutReleaseDate() {
- cgTrackable trackable = cgBase.parseTrackable(getFileContent(R.raw.tb14wfv), null, null);
+ cgTrackable trackable = GCParser.parseTrackable(getFileContent(R.raw.tb14wfv), null, null);
assertNotNull(trackable);
assertEquals("The Brickster", trackable.getName());
assertEquals("Adrian C", trackable.getOwner());
@@ -66,11 +67,11 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase {
}
private cgTrackable getTB2R124() {
- return cgBase.parseTrackable(BaseUtils.replaceWhitespace(getFileContent(R.raw.trackable_tb2r124)), null, null);
+ return GCParser.parseTrackable(BaseUtils.replaceWhitespace(getFileContent(R.raw.trackable_tb2r124)), null, null);
}
private cgTrackable getTBXATG() {
- return cgBase.parseTrackable(BaseUtils.replaceWhitespace(getFileContent(R.raw.trackable_tbxatg)), null, null);
+ return GCParser.parseTrackable(BaseUtils.replaceWhitespace(getFileContent(R.raw.trackable_tbxatg)), null, null);
}
}