X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fintervalstore%2Fnonc%2FIntervalStoreTest.java;h=2c4e14b95c9c0bb787e817e64e109349a1448fcc;hb=5ef61dcb1cc4a94ac6f88e90fc186521ce7224c1;hp=581f5f4960a859f7a6a21f25eb2319242878eb0c;hpb=03f096cdbf0479379723637198be7653d0868224;p=jalview.git diff --git a/test/intervalstore/nonc/IntervalStoreTest.java b/test/intervalstore/nonc/IntervalStoreTest.java index 581f5f4..2c4e14b 100644 --- a/test/intervalstore/nonc/IntervalStoreTest.java +++ b/test/intervalstore/nonc/IntervalStoreTest.java @@ -60,7 +60,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testFindOverlaps_nonNested() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = add(store, 10, 20); // same range different description SimpleFeature sf2 = new SimpleFeature(10, 20, "desc"); @@ -100,7 +100,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testFindOverlaps_nested() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = add(store, 10, 50); SimpleFeature sf2 = add(store, 10, 40); SimpleFeature sf3 = add(store, 20, 30); @@ -138,7 +138,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testFindOverlaps_mixed() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = add(store, 10, 50); SimpleFeature sf2 = add(store, 1, 15); SimpleFeature sf3 = add(store, 20, 30); @@ -195,7 +195,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testRemove() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = add(store, 10, 20); assertTrue(store.contains(sf1)); @@ -261,31 +261,10 @@ public class IntervalStoreTest assertTrue(store.isEmpty()); } - /** - * A helper method to test whether a list contains a specific object (by - * object identity, not equality test as used by List.contains()) - * - * @param list - * @param o - * @return - */ - private static boolean containsObject(List list, - Object o) - { - for (Object i : list) - { - if (i == o) - { - return true; - } - } - return false; - } - @Test(groups = "Functional") public void testAdd() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); assertFalse(store.add(null)); @@ -315,7 +294,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testAdd_noDuplicates() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = new SimpleFeature(10, 20, "Cath"); SimpleFeature sf2 = new SimpleFeature(10, 20, "Cath"); @@ -331,7 +310,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testIsEmpty() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); assertTrue(store.isEmpty()); assertEquals(store.size(), 0); @@ -384,7 +363,7 @@ public class IntervalStoreTest /* * add a feature and a nested feature */ - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = add(store, 10, 20); // sf2 is nested in sf1 so will be stored in nestedFeatures SimpleFeature sf2 = add(store, 12, 14); @@ -410,7 +389,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testContains() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = new SimpleFeature(10, 20, "Cath"); SimpleFeature sf2 = new SimpleFeature(10, 20, "Pfam"); @@ -447,7 +426,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testFindOverlaps_resultsArg_mixed() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = add(store, 10, 50); SimpleFeature sf2 = add(store, 1, 15); SimpleFeature sf3 = add(store, 20, 30); @@ -510,7 +489,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testFindOverlaps_resultsArg_nested() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = add(store, 10, 50); SimpleFeature sf2 = add(store, 10, 40); SimpleFeature sf3 = add(store, 20, 30); @@ -552,7 +531,7 @@ public class IntervalStoreTest @Test(groups = "Functional") public void testFindOverlaps_resultsArg_nonNested() { - IntervalStore store = new IntervalStoreImpl(); + IntervalStore store = new IntervalStore<>(); SimpleFeature sf1 = add(store, 10, 20); // same range different description SimpleFeature sf2 = new SimpleFeature(10, 20, "desc"); @@ -669,7 +648,8 @@ public class IntervalStoreTest } if (!isNCList) { - ((intervalstore.nonc.IntervalStore) store).revalidate(); + ((intervalstore.nonc.IntervalStore) store) + .revalidate(); } String line = "time to load " + (isNCList ? "NClist " : "NCArray ") + (System.nanoTime() - ntimeLoad) / K / K + " ms scale "