aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/geopoint
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-04-21 18:07:04 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-04-21 18:25:57 +0200
commit2dbaee334b97ea1123d8a245bc247d918ba2c6fb (patch)
treeb8801f2a24cad81c23fc0e101a7d84b0f622744d /tests/src/cgeo/geocaching/geopoint
parent1d1bcd7661e11ef079d8b23f9c531397e835ba3b (diff)
downloadcgeo-2dbaee334b97ea1123d8a245bc247d918ba2c6fb.zip
cgeo-2dbaee334b97ea1123d8a245bc247d918ba2c6fb.tar.gz
cgeo-2dbaee334b97ea1123d8a245bc247d918ba2c6fb.tar.bz2
Refactoring: keep GeopointParser private to its package
Geopoint exposes everything GeopointParser can do. By calling a Geopoint constructor instead of a GeopointParser method returning a Geopoint, Eclipse can do more null checks for free (a constuctor can never return a null object).
Diffstat (limited to 'tests/src/cgeo/geocaching/geopoint')
-rw-r--r--tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java b/tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java
index 4e24e5a..44fbe18 100644
--- a/tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java
+++ b/tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java
@@ -1,7 +1,5 @@
package cgeo.geocaching.geopoint;
-import cgeo.geocaching.geopoint.GeopointParser.ParseException;
-
import android.test.AndroidTestCase;
public class GeoPointParserTest extends AndroidTestCase {
@@ -27,7 +25,7 @@ public class GeoPointParserTest extends AndroidTestCase {
Geopoint point = null;
try {
point = GeopointParser.parse("N 49° 56.031");
- } catch (ParseException e) {
+ } catch (Geopoint.ParseException e) {
// expected
}
assertEquals(null, point);
@@ -64,7 +62,7 @@ public class GeoPointParserTest extends AndroidTestCase {
Geopoint point = null;
try {
point = GeopointParser.parse("N51 21.523 and some words in between, so there is no relation E07 02.680");
- } catch (ParseException e) {
+ } catch (Geopoint.ParseException e) {
// expected
}
assertEquals(null, point);