JAL-1270 remove test artefact file after test
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 21 Jun 2016 14:26:16 +0000 (15:26 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 21 Jun 2016 14:26:16 +0000 (15:26 +0100)
test/jalview/ws/jabaws/RNAStructExportImport.java

index b57e5d0..8994e67 100644 (file)
@@ -36,6 +36,7 @@ import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.AutoCalcSetting;
 
 import java.awt.Component;
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -51,6 +52,8 @@ import compbio.metadata.WrongParameterException;
 
 public class RNAStructExportImport
 {
+  private static final String JAR_FILE_NAME = "testRnalifold_param.jar";
+
   public static String testseqs = "examples/RF00031_folded.stk";
 
   public static Jws2Discoverer disc;
@@ -115,6 +118,11 @@ public class RNAStructExportImport
     {
       af.setVisible(false);
       af.dispose();
+      File f = new File(JAR_FILE_NAME);
+      if (f.exists())
+      {
+        f.delete();
+      }
     }
   }
 
@@ -267,10 +275,10 @@ public class RNAStructExportImport
     // write out parameters
     jalview.gui.AlignFrame nalf = null;
     assertTrue("Couldn't write out the Jar file",
-            new Jalview2XML(false).saveAlignment(af,
-                    "testRnalifold_param.jar", "trial parameter writeout"));
+            new Jalview2XML(false).saveAlignment(af, JAR_FILE_NAME,
+                    "trial parameter writeout"));
     assertTrue("Couldn't read back the Jar file", (nalf = new Jalview2XML(
-            false).loadJalviewAlign("testRnalifold_param.jar")) != null);
+            false).loadJalviewAlign(JAR_FILE_NAME)) != null);
     if (nalf != null)
     {
       AutoCalcSetting acs = af.getViewport().getCalcIdSettingsFor(