JAL-2759 setup hideBitSet over range for hideInsertions
[jalview.git] / test / jalview / gui / PopupMenuTest.java
index 7e077d0..8f60021 100644 (file)
@@ -573,14 +573,8 @@ public class PopupMenuTest
     // get sequences from the alignment
     List<SequenceI> seqs = parentPanel.getAlignment().getSequences();
     
-    // get the Popup Menu for first sequence - no insertions
-    testee = new PopupMenu(parentPanel, (Sequence) seqs.get(0), null);
-    testee.hideInsertions_actionPerformed(null);
-    
-    HiddenColumns hidden = parentPanel.av.getAlignment().getHiddenColumns();
-    Iterator<int[]> it = hidden.iterator();
-    assertFalse(it.hasNext());
-
+    // add our own seqs to avoid problems with changes to existing sequences
+    // (gap at end of sequences varies depending on how tests are run!)
     Sequence seqGap1 = new Sequence("GappySeq",
             "AAAA----AA-AAAAAAA---AAA-----------AAAAAAAAAA--");
     seqGap1.createDatasetSequence();
@@ -589,10 +583,26 @@ public class PopupMenuTest
             "AAAAAA-AAAAA---AAA--AAAAA--AAAAAAA-AAAAAA");
     seqGap2.createDatasetSequence();
     seqs.add(seqGap2);
-    Sequence seqGap3 = new Sequence("OneGapSeq",
+    Sequence seqGap3 = new Sequence("AnotherGapSeq",
             "AAAAAA-AAAAAA--AAAAAA-AAAAAAAAAAA---AAAAAAAA");
     seqGap3.createDatasetSequence();
     seqs.add(seqGap3);
+    Sequence seqGap4 = new Sequence("NoGaps",
+            "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
+    seqGap4.createDatasetSequence();
+    seqs.add(seqGap4);
+
+    ColumnSelection sel = new ColumnSelection();
+    parentPanel.av.getAlignment().getHiddenColumns()
+            .revealAllHiddenColumns(sel);
+
+    // get the Popup Menu for 7th sequence - no insertions
+    testee = new PopupMenu(parentPanel, (Sequence) seqs.get(7), null);
+    testee.hideInsertions_actionPerformed(null);
+    
+    HiddenColumns hidden = parentPanel.av.getAlignment().getHiddenColumns();
+    Iterator<int[]> it = hidden.iterator();
+    assertFalse(it.hasNext());
 
     // get the Popup Menu for GappySeq - this time we have insertions
     testee = new PopupMenu(parentPanel, (Sequence) seqs.get(4), null);
@@ -627,7 +637,7 @@ public class PopupMenuTest
 
     assertFalse(it.hasNext());
 
-    ColumnSelection sel = new ColumnSelection();
+    sel = new ColumnSelection();
     hidden.revealAllHiddenColumns(sel);
 
     // make a sequence group and hide insertions within the group