aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-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.java3
-rw-r--r--tests/src/cgeo/geocaching/test/mock/GC3XX5J.java4
-rw-r--r--tests/src/cgeo/geocaching/test/mock/MockedLazyInitializedList.java6
-rw-r--r--tests/src/cgeo/geocaching/utils/LazyInitializedListTest.java10
6 files changed, 14 insertions, 17 deletions
diff --git a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java
index e566ca2..035c7bc 100644
--- a/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java
+++ b/tests/src/cgeo/geocaching/test/mock/GC1ZXX2.java
@@ -5,11 +5,11 @@ import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.utils.LazyInitializedList;
import java.text.ParseException;
import java.util.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
@@ -95,7 +95,7 @@ public class GC1ZXX2 extends MockedCache {
}
@Override
- public LazyInitializedList<String> getAttributes() {
+ public List<String> getAttributes() {
String[] attributes = new String[] {
"bicycles_yes",
"available_yes",
diff --git a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
index d6601d5..a7722d4 100644
--- a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
+++ b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
@@ -6,11 +6,11 @@ import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.utils.LazyInitializedList;
import java.text.ParseException;
import java.util.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
@@ -129,7 +129,7 @@ public class GC2CJPF extends MockedCache {
}
@Override
- public LazyInitializedList<String> getAttributes() {
+ public List<String> getAttributes() {
String[] attributes = new String[] {
"motorcycles_no",
"wheelchair_no",
diff --git a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java
index 5e8a1d7..9557991 100644
--- a/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java
+++ b/tests/src/cgeo/geocaching/test/mock/GC2JVEH.java
@@ -7,7 +7,6 @@ import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.utils.LazyInitializedList;
import java.text.ParseException;
import java.util.ArrayList;
@@ -98,7 +97,7 @@ public class GC2JVEH extends MockedCache {
}
@Override
- public LazyInitializedList<String> getAttributes() {
+ public List<String> getAttributes() {
final String[] attributes = new String[] {
"winter_yes",
"flashlight_yes",
diff --git a/tests/src/cgeo/geocaching/test/mock/GC3XX5J.java b/tests/src/cgeo/geocaching/test/mock/GC3XX5J.java
index 540ae12..ca558ac 100644
--- a/tests/src/cgeo/geocaching/test/mock/GC3XX5J.java
+++ b/tests/src/cgeo/geocaching/test/mock/GC3XX5J.java
@@ -5,11 +5,11 @@ import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.utils.LazyInitializedList;
import java.text.ParseException;
import java.util.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
@@ -95,7 +95,7 @@ public class GC3XX5J extends MockedCache {
}
@Override
- public LazyInitializedList<String> getAttributes() {
+ public List<String> getAttributes() {
String[] attributes = new String[] {
"stroller_no",
"kids_no",
diff --git a/tests/src/cgeo/geocaching/test/mock/MockedLazyInitializedList.java b/tests/src/cgeo/geocaching/test/mock/MockedLazyInitializedList.java
index a3dd5e3..4dd0797 100644
--- a/tests/src/cgeo/geocaching/test/mock/MockedLazyInitializedList.java
+++ b/tests/src/cgeo/geocaching/test/mock/MockedLazyInitializedList.java
@@ -9,7 +9,11 @@ import java.util.List;
class MockedLazyInitializedList<ElementType> extends LazyInitializedList<ElementType> {
public MockedLazyInitializedList(ElementType[] elements) {
- set(Arrays.asList(elements));
+ final List<ElementType> elements1 = Arrays.asList(elements);
+ clear();
+ if (elements1 != null) {
+ addAll(elements1);
+ }
}
@Override
diff --git a/tests/src/cgeo/geocaching/utils/LazyInitializedListTest.java b/tests/src/cgeo/geocaching/utils/LazyInitializedListTest.java
index e570b1d..6c19c32 100644
--- a/tests/src/cgeo/geocaching/utils/LazyInitializedListTest.java
+++ b/tests/src/cgeo/geocaching/utils/LazyInitializedListTest.java
@@ -1,10 +1,10 @@
package cgeo.geocaching.utils;
+import junit.framework.TestCase;
+
import java.util.ArrayList;
import java.util.List;
-import junit.framework.TestCase;
-
public class LazyInitializedListTest extends TestCase {
private static final class MockedLazyInitializedList extends LazyInitializedList<String> {
@@ -28,10 +28,4 @@ public class LazyInitializedListTest extends TestCase {
assertEquals(1, iterations);
}
- public static void testNull() {
- final LazyInitializedList<String> list = new MockedLazyInitializedList();
- list.set((LazyInitializedList<String>) null);
- list.set((ArrayList<String>) null);
- }
-
}