JAL-2046 test behaviour of copy constructor in different contexts
authorJim Procter <jprocter@issues.jalview.org>
Tue, 5 Apr 2016 17:33:13 +0000 (18:33 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 5 Apr 2016 17:45:36 +0000 (18:45 +0100)
test/jalview/datamodel/SequenceTest.java

index b8a4b3a..24a63dc 100644 (file)
@@ -518,7 +518,11 @@ public class SequenceTest
     // copy has a copy of the sequence feature:
     SequenceFeature[] sfs = copy.getSequenceFeatures();
     assertEquals(1, sfs.length);
-    assertFalse(sfs[0] == seq1.getSequenceFeatures()[0]);
+    if (seq1.getDatasetSequence()!=null && copy.getDatasetSequence()==seq1.getDatasetSequence()) {
+      assertTrue(sfs[0] == seq1.getSequenceFeatures()[0]);
+    } else {
+      assertFalse(sfs[0] == seq1.getSequenceFeatures()[0]);
+    }
     assertTrue(sfs[0].equals(seq1.getSequenceFeatures()[0]));
 
     // copy has a copy of the PDB entry