JAL-4313 Clamp start and end ranges to array size
[jalview.git] / test / jalview / ext / jmol / JmolCommandsTest.java
index 6265c05..88e5833 100644 (file)
@@ -77,7 +77,7 @@ public class JmolCommandsTest
     SequenceRenderer sr = new SequenceRenderer(af.getViewport());
     SequenceI[][] seqs = new SequenceI[][] { { seq1 }, { seq2 } };
     String[] files = new String[] { "seq1.pdb", "seq2.pdb" };
-    StructureSelectionManager ssm = new StructureSelectionManager();
+    StructureSelectionManager ssm = StructureSelectionManager.getStructureSelectionManager(null);
 
     /*
      * map residues 1-10 to residues 21-30 (atoms 105-150) in structures
@@ -94,9 +94,9 @@ public class JmolCommandsTest
             "B", map, null);
     ssm.addStructureMapping(sm2);
 
-    String[] commands = testee.colourBySequence(ssm,
-            files,
-            seqs, sr, af.alignPanel);
+    // TODO - comments in testee suggest this tests an obsolete method!
+    String[] commands = testee.colourBySequence(ssm, files, seqs, sr,
+            af.alignPanel);
     assertEquals(commands.length, 2);
 
     String chainACommand = commands[0];
@@ -133,9 +133,11 @@ public class JmolCommandsTest
     AtomSpecModel model = new AtomSpecModel();
     assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "");
     model.addRange("1", 2, 4, "A");
-    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "2-4:A/1.1");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
+            "2-4:A/1.1");
     model.addRange("1", 8, 8, "A");
-    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "2-4:A/1.1|8:A/1.1");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
+            "2-4:A/1.1|8:A/1.1");
     model.addRange("1", 5, 7, "B");
     assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-4:A/1.1|8:A/1.1|5-7:B/1.1");
@@ -200,7 +202,8 @@ public class JmolCommandsTest
     toAlign.addRange("2", 20, 21, "B");
     toAlign.addRange("2", 22, 22, "C");
     List<StructureCommandI> command = testee.superposeStructures(ref,
-            toAlign, AtomSpecType.ALPHA); // doesn't matter for Jmol whether nuc or protein
+            toAlign, AtomSpecType.ALPHA); // doesn't matter for Jmol whether nuc
+                                          // or protein
     assertEquals(command.size(), 1);
     String refSpec = "12-14:A/1.1|18:B/1.1|22-23:B/1.1";
     String toAlignSpec = "15-17:B/2.1|20-21:B/2.1|22:C/2.1";