JAL-1775 fix broken test due to missing file (RF0031_unfolded).
authorJim Procter <jprocter@issues.jalview.org>
Mon, 15 Jun 2015 10:42:52 +0000 (11:42 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 15 Jun 2015 10:42:52 +0000 (11:42 +0100)
test/jalview/ws/jabaws/RNAStructExportImport.java

index 36b3196..c1c3357 100644 (file)
@@ -23,6 +23,17 @@ package jalview.ws.jabaws;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.gui.Jalview2XML;
+import jalview.io.AnnotationFile;
+import jalview.io.FormatAdapter;
+import jalview.io.StockholmFileTest;
+import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.jws2.RNAalifoldClient;
+import jalview.ws.jws2.SequenceAnnotationWSClient;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.AutoCalcSetting;
 
 import java.awt.Component;
 import java.util.ArrayList;
@@ -32,25 +43,15 @@ import javax.swing.JMenu;
 import javax.swing.JMenuItem;
 
 import org.junit.AfterClass;
+import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 import compbio.metadata.WrongParameterException;
 
-import jalview.datamodel.AlignmentI;
-import jalview.gui.Jalview2XML;
-import jalview.io.AnnotationFile;
-import jalview.io.FormatAdapter;
-import jalview.io.StockholmFileTest;
-import jalview.ws.jws2.Jws2Discoverer;
-import jalview.ws.jws2.RNAalifoldClient;
-import jalview.ws.jws2.SequenceAnnotationWSClient;
-import jalview.ws.jws2.jabaws2.Jws2Instance;
-import jalview.ws.params.AutoCalcSetting;
-
 public class RNAStructExportImport
 {
-  public static String testseqs = "examples/unfolded_RF00031.aln";
+  public static String testseqs = "examples/RF00031_folded.stk";
 
   public static Jws2Discoverer disc;
 
@@ -89,6 +90,22 @@ public class RNAStructExportImport
 
     assertNotNull("Couldn't load test data ('" + testseqs + "')", af);
 
+    // remove any existing annotation
+    List<AlignmentAnnotation> aal = new ArrayList<AlignmentAnnotation>();
+    for (AlignmentAnnotation rna : af.getViewport().getAlignment()
+            .getAlignmentAnnotation())
+    {
+      if (rna.isRNA())
+      {
+        aal.add(rna);
+      }
+    }
+    for (AlignmentAnnotation rna : aal)
+    {
+      af.getViewport().getAlignment().deleteAnnotation(rna);
+    }
+    af.getViewport().alignmentChanged(af.alignPanel); // why is af.alignPanel
+                                                      // public?
   }
 
   @AfterClass