JAL-3130 Fixing a few more tests that pass on a Mac but not on linux (e.g. jv-bamboo)
authorBen Soares <bsoares@dundee.ac.uk>
Thu, 13 Dec 2018 14:50:02 +0000 (14:50 +0000)
committerBen Soares <bsoares@dundee.ac.uk>
Thu, 13 Dec 2018 14:50:02 +0000 (14:50 +0000)
src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java
test/jalview/ext/jmol/JmolParserTest.java
test/jalview/io/IdentifyFileTest.java
test/jalview/util/PlatformTest.java

index 09a9713..22c9098 100644 (file)
@@ -121,8 +121,8 @@ public class StructureManager
       for (String chimObjName : names)
       {
         // get or open the corresponding models if they already exist
-        List<ChimeraModel> currentModels = chimeraManager.getChimeraModels(
-                chimObjName, type);
+        List<ChimeraModel> currentModels = chimeraManager
+                .getChimeraModels(chimObjName, type);
         if (currentModels.size() == 0)
         {
           // open and return models
@@ -562,11 +562,11 @@ public class StructureManager
         // Get the corresponding "real" model
         if (chimeraManager.hasChimeraModel(modelNumber, subModelNumber))
         {
-          ChimeraModel dataModel = chimeraManager.getChimeraModel(
-                  modelNumber, subModelNumber);
-          if (dataModel.getResidueCount() == selectedModel
-                  .getResidueCount()
-                  || dataModel.getModelType() == StructureManager.ModelType.SMILES)
+          ChimeraModel dataModel = chimeraManager
+                  .getChimeraModel(modelNumber, subModelNumber);
+          if (dataModel.getResidueCount() == selectedModel.getResidueCount()
+                  || dataModel
+                          .getModelType() == StructureManager.ModelType.SMILES)
           {
             // Select the entire model
             addChimSelection(dataModel);
@@ -576,8 +576,8 @@ public class StructureManager
           {
             for (ChimeraChain selectedChain : selectedModel.getChains())
             {
-              ChimeraChain dataChain = dataModel.getChain(selectedChain
-                      .getChainId());
+              ChimeraChain dataChain = dataModel
+                      .getChain(selectedChain.getChainId());
               if (selectedChain.getResidueCount() == dataChain
                       .getResidueCount())
               {
@@ -931,6 +931,7 @@ public class StructureManager
       pathList.add("/usr/local/chimera/bin/chimera");
       pathList.add("/usr/local/bin/chimera");
       pathList.add("/usr/bin/chimera");
+      pathList.add(System.getProperty("user.home") + "/opt/bin/chimera");
     }
     else if (os.startsWith("Windows"))
     {
index f5e637c..bcad464 100644 (file)
@@ -62,9 +62,9 @@ public class JmolParserTest
    * 1GAQ has been reduced to alpha carbons only
    * 1QCF is the full PDB file including headers, HETATM etc
    */
-  String[] testFile = new String[] { "./examples/1GAQ.txt",
+  String[] testFile = new String[] { "./examples/1gaq.txt",
       "./test/jalview/ext/jmol/1xyz.pdb",
-      "./test/jalview/ext/jmol/1qcf.pdb" };
+      "./test/jalview/ext/jmol/1QCF.pdb" };
 
   //@formatter:off
   // a modified and very cut-down extract of 4UJ4
@@ -130,17 +130,17 @@ public class JmolParserTest
       JmolParser jtest = new JmolParser(pdbStr, DataSourceType.FILE);
       Vector<SequenceI> seqs = jtest.getSeqs(), mcseqs = mctest.getSeqs();
 
-      assertTrue(
-              "No sequences extracted from testfile\n"
-                      + (jtest.hasWarningMessage() ? jtest.getWarningMessage()
-                              : "(No warnings raised)"), seqs != null
-                      && seqs.size() > 0);
+      assertTrue("No sequences extracted from testfile\n"
+              + (jtest.hasWarningMessage() ? jtest.getWarningMessage()
+                      : "(No warnings raised)"),
+              seqs != null && seqs.size() > 0);
       for (SequenceI sq : seqs)
       {
-        assertEquals("JMol didn't process " + pdbStr
-                + " to the same sequence as MCView",
-                sq.getSequenceAsString(), mcseqs.remove(0)
-                        .getSequenceAsString());
+        assertEquals(
+                "JMol didn't process " + pdbStr
+                        + " to the same sequence as MCView",
+                sq.getSequenceAsString(),
+                mcseqs.remove(0).getSequenceAsString());
         AlignmentI al = new Alignment(new SequenceI[] { sq });
         validateSecStrRows(al);
       }
@@ -175,13 +175,15 @@ public class JmolParserTest
 
   private void checkFirstAAIsAssoc(SequenceI sq)
   {
-    assertTrue("No secondary structure assigned for protein sequence for "
-            + sq.getName(),
+    assertTrue(
+            "No secondary structure assigned for protein sequence for "
+                    + sq.getName(),
             sq.getAnnotation() != null && sq.getAnnotation().length >= 1
                     && sq.getAnnotation()[0].hasIcons);
     assertTrue(
             "Secondary structure not associated for sequence "
-                    + sq.getName(), sq.getAnnotation()[0].sequenceRef == sq);
+                    + sq.getName(),
+            sq.getAnnotation()[0].sequenceRef == sq);
   }
 
   /**
@@ -194,7 +196,8 @@ public class JmolParserTest
   {
     PDBfile mctest = new PDBfile(false, false, false,
             pastePDBDataWithChainBreak, DataSourceType.PASTE);
-    JmolParser jtest = new JmolParser(pastePDBDataWithChainBreak, DataSourceType.PASTE);
+    JmolParser jtest = new JmolParser(pastePDBDataWithChainBreak,
+            DataSourceType.PASTE);
     Vector<SequenceI> seqs = jtest.getSeqs();
     Vector<SequenceI> mcseqs = mctest.getSeqs();
 
@@ -216,8 +219,7 @@ public class JmolParserTest
   {
     PDBfile mctest = new PDBfile(false, false, false, pdbWithAltLoc,
             DataSourceType.PASTE);
-    JmolParser jtest = new JmolParser(pdbWithAltLoc,
-            DataSourceType.PASTE);
+    JmolParser jtest = new JmolParser(pdbWithAltLoc, DataSourceType.PASTE);
     Vector<SequenceI> seqs = jtest.getSeqs();
     Vector<SequenceI> mcseqs = mctest.getSeqs();
 
index dd4f6ba..cf7f58f 100644 (file)
@@ -89,12 +89,11 @@ public class IdentifyFileTest
   @DataProvider(name = "identifyFiles")
   public Object[][] IdentifyFileDP()
   {
-    return new Object[][] {
-        { "examples/example.json", FileFormat.Json },
+    return new Object[][] { { "examples/example.json", FileFormat.Json },
         { "examples/plantfdx.fa", FileFormat.Fasta },
         { "examples/dna_interleaved.phy", FileFormat.Phylip },
         { "examples/2GIS.pdb", FileFormat.PDB },
-        { "examples/rf00031_folded.stk", FileFormat.Stockholm },
+        { "examples/RF00031_folded.stk", FileFormat.Stockholm },
         { "examples/testdata/test.rnaml", FileFormat.Rnaml },
         { "examples/testdata/test.aln", FileFormat.Clustal },
         { "examples/testdata/test.pfam", FileFormat.Pfam },
@@ -107,13 +106,12 @@ public class IdentifyFileTest
         { "examples/testdata/simpleGff3.gff", FileFormat.Features },
         { "examples/testdata/test.jvp", FileFormat.Jalview },
         { "examples/testdata/test.cif", FileFormat.MMCif },
-        {
-            "examples/testdata/cullpdb_pc25_res3.0_R0.3_d150729_chains9361.fasta.15316",
+        { "examples/testdata/cullpdb_pc25_res3.0_R0.3_d150729_chains9361.fasta.15316",
             FileFormat.Fasta },
         { "resources/scoreModel/pam250.scm", FileFormat.ScoreMatrix },
         { "resources/scoreModel/blosum80.scm", FileFormat.ScoreMatrix }
-    // { "examples/testdata/test.amsa", "AMSA" },
-    // { "examples/test.jnet", "JnetFile" },
+        // { "examples/testdata/test.amsa", "AMSA" },
+        // { "examples/test.jnet", "JnetFile" },
     };
   }
 
@@ -126,8 +124,8 @@ public class IdentifyFileTest
     // too few columns:
     assertFalse(id.looksLikeFeatureData("1 \t 2 \t 3 \t 4 \t 5"));
     // GFF format:
-    assertTrue(id
-            .looksLikeFeatureData("Seq1\tlocal\tHelix\t2456\t2462\tss"));
+    assertTrue(
+            id.looksLikeFeatureData("Seq1\tlocal\tHelix\t2456\t2462\tss"));
     // Jalview format:
     assertTrue(id.looksLikeFeatureData("Helix\tSeq1\t-1\t2456\t2462\tss"));
     // non-numeric start column:
index 470e64d..2e5a786 100644 (file)
@@ -61,11 +61,11 @@ public class PlatformTest
     assertFalse(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0,
             0, 0, clickCount, isPopupTrigger, buttonNo), mac));
 
-    mods = InputEvent.CTRL_DOWN_MASK;
+    mods = InputEvent.CTRL_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK;
     assertFalse(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0,
             0, 0, clickCount, isPopupTrigger, buttonNo), mac));
 
-    mods = InputEvent.META_DOWN_MASK;
+    mods = InputEvent.META_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK;
     assertTrue(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0,
             0, 0, clickCount, isPopupTrigger, buttonNo), mac));