aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/test')
-rw-r--r--tests/src/cgeo/geocaching/test/RegExPerformanceTest.java7
-rw-r--r--tests/src/cgeo/geocaching/test/RegExRealPerformanceTest.java6
-rw-r--r--tests/src/cgeo/geocaching/test/WhitespaceTest.java14
-rw-r--r--tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java4
-rw-r--r--tests/src/cgeo/geocaching/test/mock/GC2CJPF.java4
-rw-r--r--tests/src/cgeo/geocaching/test/mock/GC2JVEH.java4
-rw-r--r--tests/src/cgeo/geocaching/test/mock/MockedCache.java11
7 files changed, 16 insertions, 34 deletions
diff --git a/tests/src/cgeo/geocaching/test/RegExPerformanceTest.java b/tests/src/cgeo/geocaching/test/RegExPerformanceTest.java
index 552c225..3075d0e 100644
--- a/tests/src/cgeo/geocaching/test/RegExPerformanceTest.java
+++ b/tests/src/cgeo/geocaching/test/RegExPerformanceTest.java
@@ -68,12 +68,7 @@ public class RegExPerformanceTest extends TestCase {
public final static Pattern PATTERN_DESCRIPTION = Pattern.compile("<span id=\"ctl00_ContentBody_LongDescription\">(.*?)</span>[^<]*</div>[^<]*<p>[^<]*</p>[^<]*<p>[^<]*<strong>\\W*Additional Hints</strong>");
- public final static List<MockedCache> MOCKED_CACHES = new ArrayList<MockedCache>();
- static {
- MOCKED_CACHES.add(new GC2CJPF());
- MOCKED_CACHES.add(new GC1ZXX2());
- MOCKED_CACHES.add(new GC2JVEH());
- }
+ public final static MockedCache[] MOCKED_CACHES = { new GC2CJPF(), new GC1ZXX2(), new GC2JVEH() };
public static void testRegEx() {
List<String> output = doTheTests(10);
diff --git a/tests/src/cgeo/geocaching/test/RegExRealPerformanceTest.java b/tests/src/cgeo/geocaching/test/RegExRealPerformanceTest.java
index b920772..3867082 100644
--- a/tests/src/cgeo/geocaching/test/RegExRealPerformanceTest.java
+++ b/tests/src/cgeo/geocaching/test/RegExRealPerformanceTest.java
@@ -1,9 +1,9 @@
package cgeo.geocaching.test;
-import cgeo.geocaching.Settings;
+
+import cgeo.geocaching.utils.Log;
import android.test.AndroidTestCase;
-import android.util.Log;
import java.util.List;
@@ -20,7 +20,7 @@ public class RegExRealPerformanceTest extends AndroidTestCase {
List<String> output = RegExPerformanceTest.doTheTests(10);
for (String s : output) {
- Log.d(Settings.tag, s);
+ Log.d(s);
}
}
diff --git a/tests/src/cgeo/geocaching/test/WhitespaceTest.java b/tests/src/cgeo/geocaching/test/WhitespaceTest.java
index 59367a5..a78f2fa 100644
--- a/tests/src/cgeo/geocaching/test/WhitespaceTest.java
+++ b/tests/src/cgeo/geocaching/test/WhitespaceTest.java
@@ -1,13 +1,11 @@
package cgeo.geocaching.test;
-import cgeo.geocaching.Settings;
import cgeo.geocaching.utils.BaseUtils;
+import cgeo.geocaching.utils.Log;
import org.apache.commons.lang3.StringUtils;
-import android.util.Log;
-
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -65,7 +63,7 @@ public class WhitespaceTest extends AbstractResourceInstrumentationTestCase {
String result = matcher.replaceAll(" ").trim();
final long end = System.currentTimeMillis();
assertEquals(EXPECTED_SIZE - 1, result.length());
- Log.d(Settings.tag, (end - start) + " ms regex");
+ Log.d((end - start) + " ms regex");
}
public void testReplaceAll() {
@@ -73,7 +71,7 @@ public class WhitespaceTest extends AbstractResourceInstrumentationTestCase {
String result = data.replaceAll("\\s+", " ");
final long end = System.currentTimeMillis();
assertEquals(EXPECTED_SIZE + 1, result.length());
- Log.d(Settings.tag, (end - start) + " ms replaceAll");
+ Log.d((end - start) + " ms replaceAll");
}
public void testActualImplementation() {
@@ -82,7 +80,7 @@ public class WhitespaceTest extends AbstractResourceInstrumentationTestCase {
result = BaseUtils.replaceWhitespace(data);
final long end = System.currentTimeMillis();
assertEquals(EXPECTED_SIZE, result.length());
- Log.d(Settings.tag, (end - start) + " ms actual implementation");
+ Log.d((end - start) + " ms actual implementation");
}
public void testManually() {
@@ -91,7 +89,7 @@ public class WhitespaceTest extends AbstractResourceInstrumentationTestCase {
result = replaceWhitespaceManually(data);
final long end = System.currentTimeMillis();
assertEquals(EXPECTED_SIZE, result.length());
- Log.d(Settings.tag, (end - start) + " ms manually");
+ Log.d((end - start) + " ms manually");
}
public void testStringUtils() {
@@ -100,6 +98,6 @@ public class WhitespaceTest extends AbstractResourceInstrumentationTestCase {
result = replaceWhitespaceStringUtils(data);
final long end = System.currentTimeMillis();
assertEquals(EXPECTED_SIZE - 1, result.length());
- Log.d(Settings.tag, (end - start) + " ms StringUtils");
+ Log.d((end - start) + " ms StringUtils");
}
} \ No newline at end of file
diff --git a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java
index bf4d0cf..7376718 100644
--- a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java
+++ b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java
@@ -1,10 +1,10 @@
package cgeo.geocaching.test.mock;
+import cgeo.geocaching.connector.gc.Login;
import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.network.Login;
import java.text.ParseException;
import java.util.Arrays;
@@ -17,7 +17,7 @@ import java.util.Map;
public class GC1ZXX2 extends MockedCache {
public GC1ZXX2() {
- super(new Geopoint(52373217, 9710800));
+ super(new Geopoint(52.373217, 9.710800));
}
@Override
diff --git a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
index b97d2bc..670fee4 100644
--- a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
+++ b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
@@ -1,11 +1,11 @@
package cgeo.geocaching.test.mock;
import cgeo.geocaching.Settings;
+import cgeo.geocaching.connector.gc.Login;
import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.network.Login;
import java.text.ParseException;
import java.util.Arrays;
@@ -18,7 +18,7 @@ import java.util.Map;
public class GC2CJPF extends MockedCache {
public GC2CJPF() {
- super(new Geopoint(52425067, 9664200));
+ super(new Geopoint(52.425067, 9.664200));
}
@Override
diff --git a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java
index 6fdd753..590c86a 100644
--- a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java
+++ b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java
@@ -2,11 +2,11 @@ package cgeo.geocaching.test.mock;
import cgeo.geocaching.cgImage;
import cgeo.geocaching.cgTrackable;
+import cgeo.geocaching.connector.gc.Login;
import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.network.Login;
import java.text.ParseException;
import java.util.ArrayList;
@@ -24,7 +24,7 @@ public class GC2JVEH extends MockedCache {
}
public GC2JVEH() {
- super(new Geopoint(52.37225, 9.73537));
+ super(new Geopoint(52.37225, 9.735367));
}
@Override
diff --git a/tests/src/cgeo/geocaching/test/mock/MockedCache.java b/tests/src/cgeo/geocaching/test/mock/MockedCache.java
index 61369ee..2c717a4 100644
--- a/tests/src/cgeo/geocaching/test/mock/MockedCache.java
+++ b/tests/src/cgeo/geocaching/test/mock/MockedCache.java
@@ -5,7 +5,6 @@ import cgeo.geocaching.cgImage;
import cgeo.geocaching.cgTrackable;
import cgeo.geocaching.connector.gc.GCConstants;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.geopoint.GeopointFormatter;
import cgeo.geocaching.utils.BaseUtils;
import org.apache.commons.lang3.StringUtils;
@@ -75,16 +74,6 @@ public abstract class MockedCache implements ICache {
}
@Override
- public String getLatitude() {
- return coords.format(GeopointFormatter.Format.LAT_DECMINUTE);
- }
-
- @Override
- public String getLongitude() {
- return coords.format(GeopointFormatter.Format.LON_DECMINUTE);
- }
-
- @Override
public boolean isArchived() {
return false;
}