X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fdatamodel%2Ffeatures%2FFeatureStoreTest.java;fp=test%2Fjalview%2Fdatamodel%2Ffeatures%2FFeatureStoreTest.java;h=b0a1ac8fe6bab3f9324701b1a528a177d188bd4b;hb=3459a8a691cb22508d7067f240b7254e588e77d3;hp=c38cb1eabfa2de895aa7c2ea7e14ac7388f28c6d;hpb=5b27f1062b2203c4c31702e205f4c78e1992063e;p=jalview.git
diff --git a/test/jalview/datamodel/features/FeatureStoreTest.java b/test/jalview/datamodel/features/FeatureStoreTest.java
index c38cb1e..b0a1ac8 100644
--- a/test/jalview/datamodel/features/FeatureStoreTest.java
+++ b/test/jalview/datamodel/features/FeatureStoreTest.java
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.datamodel.features;
import static org.testng.Assert.assertEquals;
@@ -20,8 +40,7 @@ public class FeatureStoreTest
public void testFindFeatures_nonNested()
{
FeatureStore fs = new FeatureStore();
- fs.addFeature(new SequenceFeature("", "", 10, 20, Float.NaN,
- null));
+ fs.addFeature(new SequenceFeature("", "", 10, 20, Float.NaN, null));
// same range different description
fs.addFeature(new SequenceFeature("", "desc", 10, 20, Float.NaN, null));
fs.addFeature(new SequenceFeature("", "", 15, 25, Float.NaN, null));
@@ -213,8 +232,8 @@ public class FeatureStoreTest
Float.NaN, null);
store.addFeature(sf6);
// contact feature
- SequenceFeature sf7 = new SequenceFeature("Disulphide bond", "desc",
- 18, 45, Float.NaN, null);
+ SequenceFeature sf7 = new SequenceFeature("Disulphide bond", "desc", 18,
+ 45, Float.NaN, null);
store.addFeature(sf7);
List features = store.getPositionalFeatures();
@@ -257,8 +276,8 @@ public class FeatureStoreTest
/*
* contact feature deletion
*/
- SequenceFeature sf3 = new SequenceFeature("", "Disulphide Bond", 11,
- 23, Float.NaN, null);
+ SequenceFeature sf3 = new SequenceFeature("", "Disulphide Bond", 11, 23,
+ Float.NaN, null);
store.addFeature(sf3);
assertEquals(store.getPositionalFeatures().size(), 1);
assertTrue(store.getPositionalFeatures().contains(sf3));
@@ -309,10 +328,10 @@ public class FeatureStoreTest
{
FeatureStore fs = new FeatureStore();
- SequenceFeature sf1 = new SequenceFeature("Cath", "", 10, 20,
- Float.NaN, null);
- SequenceFeature sf2 = new SequenceFeature("Cath", "", 10, 20,
- Float.NaN, null);
+ SequenceFeature sf1 = new SequenceFeature("Cath", "", 10, 20, Float.NaN,
+ null);
+ SequenceFeature sf2 = new SequenceFeature("Cath", "", 10, 20, Float.NaN,
+ null);
assertTrue(fs.addFeature(sf1));
assertEquals(fs.getFeatureCount(true), 1); // positional
@@ -365,8 +384,8 @@ public class FeatureStoreTest
/*
* non-nested feature
*/
- SequenceFeature sf1 = new SequenceFeature("Cath", "", 10, 20,
- Float.NaN, null);
+ SequenceFeature sf1 = new SequenceFeature("Cath", "", 10, 20, Float.NaN,
+ null);
fs.addFeature(sf1);
assertFalse(fs.isEmpty());
assertEquals(fs.getFeatureCount(true), 1);
@@ -389,7 +408,8 @@ public class FeatureStoreTest
/*
* contact feature
*/
- sf1 = new SequenceFeature("Disulfide bond", "", 19, 49, Float.NaN, null);
+ sf1 = new SequenceFeature("Disulfide bond", "", 19, 49, Float.NaN,
+ null);
fs.addFeature(sf1);
assertFalse(fs.isEmpty());
assertEquals(fs.getFeatureCount(true), 1);
@@ -401,10 +421,10 @@ public class FeatureStoreTest
* sf2, sf3 added as nested features
*/
sf1 = new SequenceFeature("Cath", "", 19, 49, Float.NaN, null);
- SequenceFeature sf2 = new SequenceFeature("Cath", "", 20, 40,
- Float.NaN, null);
- SequenceFeature sf3 = new SequenceFeature("Cath", "", 25, 35,
- Float.NaN, null);
+ SequenceFeature sf2 = new SequenceFeature("Cath", "", 20, 40, Float.NaN,
+ null);
+ SequenceFeature sf3 = new SequenceFeature("Cath", "", 25, 35, Float.NaN,
+ null);
fs.addFeature(sf1);
fs.addFeature(sf2);
fs.addFeature(sf3);
@@ -428,7 +448,8 @@ public class FeatureStoreTest
assertTrue(fs.getFeatureGroups(true).isEmpty());
assertTrue(fs.getFeatureGroups(false).isEmpty());
- SequenceFeature sf1 = new SequenceFeature("Cath", "desc", 10, 20, 1f, "group1");
+ SequenceFeature sf1 = new SequenceFeature("Cath", "desc", 10, 20, 1f,
+ "group1");
fs.addFeature(sf1);
Set groups = fs.getFeatureGroups(true);
assertEquals(groups.size(), 1);
@@ -437,7 +458,8 @@ public class FeatureStoreTest
/*
* add another feature of the same group, delete one, delete both
*/
- SequenceFeature sf2 = new SequenceFeature("Cath", "desc", 20, 30, 1f, "group1");
+ SequenceFeature sf2 = new SequenceFeature("Cath", "desc", 20, 30, 1f,
+ "group1");
fs.addFeature(sf2);
groups = fs.getFeatureGroups(true);
assertEquals(groups.size(), 1);
@@ -450,11 +472,14 @@ public class FeatureStoreTest
groups = fs.getFeatureGroups(true);
assertTrue(fs.getFeatureGroups(true).isEmpty());
- SequenceFeature sf3 = new SequenceFeature("Cath", "desc", 20, 30, 1f, "group2");
+ SequenceFeature sf3 = new SequenceFeature("Cath", "desc", 20, 30, 1f,
+ "group2");
fs.addFeature(sf3);
- SequenceFeature sf4 = new SequenceFeature("Cath", "desc", 20, 30, 1f, "Group2");
+ SequenceFeature sf4 = new SequenceFeature("Cath", "desc", 20, 30, 1f,
+ "Group2");
fs.addFeature(sf4);
- SequenceFeature sf5 = new SequenceFeature("Cath", "desc", 20, 30, 1f, null);
+ SequenceFeature sf5 = new SequenceFeature("Cath", "desc", 20, 30, 1f,
+ null);
fs.addFeature(sf5);
groups = fs.getFeatureGroups(true);
assertEquals(groups.size(), 3);
@@ -507,8 +532,8 @@ public class FeatureStoreTest
assertEquals(fs.getTotalFeatureLength(), 93);
// contact features count 1
- SequenceFeature sf3 = new SequenceFeature("disulphide bond", "desc",
- 15, 35, 1f, "group1");
+ SequenceFeature sf3 = new SequenceFeature("disulphide bond", "desc", 15,
+ 35, 1f, "group1");
fs.addFeature(sf3);
assertEquals(fs.getTotalFeatureLength(), 94);
@@ -528,9 +553,10 @@ public class FeatureStoreTest
/*
* positional feature
*/
- SequenceFeature sf1 = new SequenceFeature("Cath", "desc", 10, 20, 1f, "group1");
+ SequenceFeature sf1 = new SequenceFeature("Cath", "desc", 10, 20, 1f,
+ "group1");
assertEquals(FeatureStore.getFeatureLength(sf1), 11);
-
+
/*
* non-positional feature
*/
@@ -541,8 +567,8 @@ public class FeatureStoreTest
/*
* contact feature counts 1
*/
- SequenceFeature sf3 = new SequenceFeature("Disulphide Bond", "desc",
- 14, 28, 1f, "AGroup");
+ SequenceFeature sf3 = new SequenceFeature("Disulphide Bond", "desc", 14,
+ 28, 1f, "AGroup");
assertEquals(FeatureStore.getFeatureLength(sf3), 1);
}
@@ -817,7 +843,7 @@ public class FeatureStoreTest
assertTrue(features.contains(sf2));
assertTrue(store.features.contains(sf1));
assertTrue(store.features.contains(sf2));
-
+
/*
* delete the first feature
*/
@@ -839,10 +865,10 @@ public class FeatureStoreTest
public void testContains()
{
FeatureStore fs = new FeatureStore();
- SequenceFeature sf1 = new SequenceFeature("Cath", "", 10, 20,
- Float.NaN, "group1");
- SequenceFeature sf2 = new SequenceFeature("Cath", "", 10, 20,
- Float.NaN, "group2");
+ SequenceFeature sf1 = new SequenceFeature("Cath", "", 10, 20, Float.NaN,
+ "group1");
+ SequenceFeature sf2 = new SequenceFeature("Cath", "", 10, 20, Float.NaN,
+ "group2");
SequenceFeature sf3 = new SequenceFeature("Cath", "", 0, 0, Float.NaN,
"group1");
SequenceFeature sf4 = new SequenceFeature("Cath", "", 0, 0, 0f,
@@ -868,8 +894,8 @@ public class FeatureStoreTest
/*
* add a nested feature
*/
- SequenceFeature sf7 = new SequenceFeature("Cath", "", 12, 16,
- Float.NaN, "group1");
+ SequenceFeature sf7 = new SequenceFeature("Cath", "", 12, 16, Float.NaN,
+ "group1");
fs.addFeature(sf7);
assertTrue(fs.contains(sf7));
assertTrue(fs.contains(new SequenceFeature(sf7)));