diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-04-11 13:46:22 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-04-11 14:27:00 +0200 |
| commit | bcbd5b8c58d40b52ae3243245c9716b95fe41ff3 (patch) | |
| tree | e1d4e57f30e84afaf2eb2631ea3ba0a6f0590a78 /tests | |
| parent | 6f0722b7e104ad0370b939a2983bd596fac6c5d2 (diff) | |
| download | cgeo-bcbd5b8c58d40b52ae3243245c9716b95fe41ff3.zip cgeo-bcbd5b8c58d40b52ae3243245c9716b95fe41ff3.tar.gz cgeo-bcbd5b8c58d40b52ae3243245c9716b95fe41ff3.tar.bz2 | |
Use an array with in-place constructor instead of a List
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/src/cgeo/geocaching/cgBaseTest.java | 2 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/test/RegExPerformanceTest.java | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/tests/src/cgeo/geocaching/cgBaseTest.java b/tests/src/cgeo/geocaching/cgBaseTest.java index b6ad561..d0a7b98 100644 --- a/tests/src/cgeo/geocaching/cgBaseTest.java +++ b/tests/src/cgeo/geocaching/cgBaseTest.java @@ -156,7 +156,7 @@ public class cgBaseTest extends AbstractResourceInstrumentationTestCase { } public static cgCache createCache(int index) { - final MockedCache mockedCache = RegExPerformanceTest.MOCKED_CACHES.get(index); + final MockedCache mockedCache = RegExPerformanceTest.MOCKED_CACHES[index]; // to get the same results we have to use the date format used when the mocked data was created String oldCustomDate = Settings.getGcCustomDate(); 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); |
