aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/files/GPXParserTest.java18
-rw-r--r--tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java1
-rw-r--r--tests/src/cgeo/geocaching/sorting/NameComparatorTest.java8
-rw-r--r--tests/src/cgeo/geocaching/test/RegExPerformanceTest.java2
-rw-r--r--tests/src/cgeo/geocaching/test/mock/MockedCache.java2
5 files changed, 8 insertions, 23 deletions
diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java
index f6e6e66..bf09256 100644
--- a/tests/src/cgeo/geocaching/files/GPXParserTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java
@@ -216,26 +216,16 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
return new ArrayList<cgCache>(cgData.loadCaches(result, LoadFlags.LOAD_ALL_DB_ONLY));
}
- public static void testParseDateWithFractionalSeconds() {
+ public static void testParseDateWithFractionalSeconds() throws ParseException {
// was experienced in GSAK file
final String dateString = "2011-08-13T02:52:18.103Z";
- try {
- GPXParser.parseDate(dateString);
- } catch (ParseException e) {
- fail();
- e.printStackTrace();
- }
+ GPXParser.parseDate(dateString);
}
- public static void testParseDateWithHugeFraction() {
+ public static void testParseDateWithHugeFraction() throws ParseException {
// see issue 821
String dateString = "2011-11-07T00:00:00.0000000-07:00";
- try {
- GPXParser.parseDate(dateString);
- } catch (ParseException e) {
- fail();
- e.printStackTrace();
- }
+ GPXParser.parseDate(dateString);
}
public void testSelfmadeGPXWithoutGeocodes() throws Exception {
diff --git a/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java b/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java
index c905bc2..cbcd176 100644
--- a/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java
+++ b/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java
@@ -20,6 +20,7 @@ public class SimpleDirChooserUITest extends ActivityInstrumentationTestCase2<Sim
@Override
public void setUp() throws Exception {
+ super.setUp();
solo = new Solo(getInstrumentation(), getActivity());
}
diff --git a/tests/src/cgeo/geocaching/sorting/NameComparatorTest.java b/tests/src/cgeo/geocaching/sorting/NameComparatorTest.java
index fa3b16c..98c77fd 100644
--- a/tests/src/cgeo/geocaching/sorting/NameComparatorTest.java
+++ b/tests/src/cgeo/geocaching/sorting/NameComparatorTest.java
@@ -13,13 +13,7 @@ public class NameComparatorTest extends AndroidTestCase {
}
}
- private NameComparator comp;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- comp = new NameComparator();
- }
+ private NameComparator comp = new NameComparator();
public void testLexical() {
assertSorted(new NamedCache("A"), new NamedCache("Z"));
diff --git a/tests/src/cgeo/geocaching/test/RegExPerformanceTest.java b/tests/src/cgeo/geocaching/test/RegExPerformanceTest.java
index b9f8138..5e46445 100644
--- a/tests/src/cgeo/geocaching/test/RegExPerformanceTest.java
+++ b/tests/src/cgeo/geocaching/test/RegExPerformanceTest.java
@@ -124,7 +124,7 @@ public class RegExPerformanceTest extends TestCase {
for (int j = 0; j < iterations; j++) {
BaseUtils.getMatch(page, pattern, true, "");
}
- return (System.currentTimeMillis() - start);
+ return System.currentTimeMillis() - start;
}
diff --git a/tests/src/cgeo/geocaching/test/mock/MockedCache.java b/tests/src/cgeo/geocaching/test/mock/MockedCache.java
index 352c34d..8517c81 100644
--- a/tests/src/cgeo/geocaching/test/mock/MockedCache.java
+++ b/tests/src/cgeo/geocaching/test/mock/MockedCache.java
@@ -70,7 +70,7 @@ public abstract class MockedCache implements ICache {
return BaseUtils.replaceWhitespace(buffer.toString());
} catch (IOException e) {
- e.printStackTrace();
+ Assert.fail(e.getMessage());
} finally {
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(br);