JAL-629 Tidy up tests and replaced methods before merge to develop
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 17 May 2023 13:16:03 +0000 (14:16 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 17 May 2023 13:16:03 +0000 (14:16 +0100)
src/jalview/io/BackupFiles.java
src/jalview/io/StructureFile.java
test/jalview/bin/CommandLineOperations.java
test/jalview/io/BackupFilesTest.java
test/jalview/renderer/seqfeatures/FeatureRendererTest.java

index af9df86..bec584f 100644 (file)
@@ -234,7 +234,7 @@ public class BackupFiles
     classInit();
     if (file.getParentFile() == null)
     {
-      // filename probably in pwd represented with no parent -- fix this!
+      // filename probably in pwd represented with no parent -- fix it before it's a problem
       file = file.getAbsoluteFile();
     }
     this.file = file;
index 61b3d1d..6ec0298 100644 (file)
@@ -359,54 +359,6 @@ public abstract class StructureFile extends AlignFile
     }
   }
 
-  @SuppressWarnings({ "unchecked", "rawtypes" })
-  private void NOTprocessWithJmolParser(List<SequenceI> prot)
-          throws Exception
-  {
-    try
-    {
-
-      Class cl = Class.forName("jalview.ext.jmol.JmolParser");
-      if (cl != null)
-      {
-        final Constructor constructor = cl
-                .getConstructor(new Class[]
-                { FileParse.class });
-        final Object[] args = new Object[] {
-            new FileParse(getDataName(), dataSourceType) };
-
-        StructureImportSettings.setShowSeqFeatures(false);
-        StructureImportSettings.setVisibleChainAnnotation(false);
-        StructureImportSettings
-                .setProcessSecondaryStructure(predictSecondaryStructure);
-        StructureImportSettings
-                .setExternalSecondaryStructure(externalSecondaryStructure);
-        StructureImportSettings
-                .setTemperatureFactorType(temperatureFactorType);
-        Object jmf = constructor.newInstance(args);
-        AlignmentI al = new Alignment((SequenceI[]) cl
-                .getMethod("getSeqsAsArray", new Class[] {}).invoke(jmf));
-        cl.getMethod("addAnnotations", new Class[] { AlignmentI.class })
-                .invoke(jmf, al);
-        for (SequenceI sq : al.getSequences())
-        {
-          if (sq.getDatasetSequence() != null)
-          {
-            sq.getDatasetSequence().getAllPDBEntries().clear();
-          }
-          else
-          {
-            sq.getAllPDBEntries().clear();
-          }
-        }
-        replaceAndUpdateChains(prot, al, AlignSeq.PEP, false);
-      }
-    } catch (ClassNotFoundException q)
-    {
-    }
-    StructureImportSettings.setShowSeqFeatures(true);
-  }
-
   private void processWithJmolParser(List<SequenceI> prot,
           boolean doXferSettings) throws MalformedURLException, IOException
   {
index 0ab18d9..0486744 100644 (file)
@@ -53,7 +53,7 @@ public class CommandLineOperations
   }
 
   // Note longer timeout needed on full test run than on individual tests
-  private static final int TEST_TIMEOUT = 23000;
+  private static final int TEST_TIMEOUT = 15000;
 
   private static final int SETUP_TIMEOUT = 9500;
 
index 01a9ab0..7f04749 100644 (file)
@@ -34,7 +34,6 @@ import java.util.TreeMap;
 
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
@@ -45,7 +44,6 @@ import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
 import jalview.gui.JvOptionPane;
 
-@Test(singleThreaded = true)
 public class BackupFilesTest
 {
   @BeforeClass(alwaysRun = true)
@@ -329,7 +327,6 @@ public class BackupFilesTest
   }
 
   // this deletes the newFile (if it exists) and any saved backup file for it
-  @AfterTest(alwaysRun = true)
   @AfterClass(alwaysRun = true)
   private void cleanupTmpFiles()
   {
@@ -345,7 +342,6 @@ public class BackupFilesTest
       newfile.delete();
     }
     File[] tmpFiles = getBackupFiles(file, mysuffix, mydigits);
-    boolean a = true;
     for (int i = 0; i < tmpFiles.length; i++)
     {
       if (actuallyDeleteTmpFiles)
index f7d8be5..944f147 100644 (file)
@@ -625,7 +625,7 @@ public class FeatureRendererTest
   {
     Jalview.main(
             new String[]
-            { "-nonews", "--props", "test/jalview/testProps.jvprops" });
+            { "-nonews", "-props", "test/jalview/testProps.jvprops" });
 
     // codons for MCWHSE
     String cdsSeq = ">cds\nATGtgtTGGcacTCAgaa";