JAL-2110 added another test case (should fail but doesn't)
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 4 Jul 2016 14:34:51 +0000 (15:34 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 4 Jul 2016 14:34:51 +0000 (15:34 +0100)
test/jalview/datamodel/SequenceTest.java

index 5c5c5c3..71719dd 100644 (file)
@@ -78,7 +78,17 @@ public class SequenceTest
     // change sequence, should trigger an update of cached result
     sq.setSequence("ASDFASDFADSF");
     assertTrue(sq.isProtein());
+    /*
+     * in situ change of sequence doesn't change hashcode :-O
+     * (sequence should not expose internal implementation)
+     */
+    for (int i = 0; i < sq.getSequence().length; i++)
+    {
+      sq.getSequence()[i] = "acgtu".charAt(i % 5);
+    }
+    assertTrue(sq.isProtein()); // but it isn't
   }
+
   @Test(groups = { "Functional" })
   public void testGetAnnotation()
   {