diff options
| author | Bananeweizen <Bananeweizen@gmx.de> | 2012-12-26 12:59:14 +0100 |
|---|---|---|
| committer | Bananeweizen <Bananeweizen@gmx.de> | 2012-12-26 12:59:14 +0100 |
| commit | e29b64e963af24f9c85c12ea110bf5255ef6fbec (patch) | |
| tree | e7e4ffbebed28023d3c1f6a42f6a1910fb1f6646 /tests | |
| parent | c29c80e9b8cccc552e6747dbcaf0c5738fadd92a (diff) | |
| download | cgeo-e29b64e963af24f9c85c12ea110bf5255ef6fbec.zip cgeo-e29b64e963af24f9c85c12ea110bf5255ef6fbec.tar.gz cgeo-e29b64e963af24f9c85c12ea110bf5255ef6fbec.tar.bz2 | |
code cleanup: remove debug code
* fixed some more issues of Findbugs and CodePro
Diffstat (limited to 'tests')
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); |
