JAL-1665 patch for regression: failing jalview.ws.jabaws.DisorderAnnotExportImport...
authorJim Procter <jprocter@issues.jalview.org>
Mon, 15 Jun 2015 17:52:02 +0000 (18:52 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 15 Jun 2015 17:52:10 +0000 (18:52 +0100)
test/jalview/io/AnnotationFileIOTest.java
test/jalview/io/PhylipFileTests.java
test/jalview/io/StockholmFileTest.java
test/jalview/ws/jabaws/DisorderAnnotExportImport.java
test/jalview/ws/jabaws/JpredJabaStructExportImport.java
test/jalview/ws/jabaws/RNAStructExportImport.java

index 0962452..0e066c2 100644 (file)
@@ -144,7 +144,7 @@ public class AnnotationFileIOTest
                       FormatAdapter.PASTE));
 
       // test for consistency in io
-      StockholmFileTest.testAlignmentEquivalence(al, al_new);
+      StockholmFileTest.testAlignmentEquivalence(al, al_new, false);
       return;
     } catch (Exception e)
     {
index 70e3f2c..e411272 100644 (file)
@@ -160,7 +160,7 @@ public class PhylipFileTests
             AppletFormatAdapter.PASTE, PhylipFile.FILE_DESC);
     assertNotNull("Couldn't parse reimported alignment data.", al_input);
 
-    StockholmFileTest.testAlignmentEquivalence(al, al_input);
+    StockholmFileTest.testAlignmentEquivalence(al, al_input, false);
 
   }
 }
\ No newline at end of file
index 3bf0952..806e4dc 100644 (file)
@@ -119,7 +119,7 @@ public class StockholmFileTest
               "Identify routine could not recognise output generated by '"
                       + ioformat + "' writer",
               ioformat.equals(identifyoutput));
-      testAlignmentEquivalence(al, al_input);
+      testAlignmentEquivalence(al, al_input, false);
       int numaliannot = 0, numsqswithali = 0;
       for (AlignmentAnnotation ala : al_input.getAlignmentAnnotation())
       {
@@ -157,9 +157,11 @@ public class StockholmFileTest
    * @param al_input
    *          'secondary' or generated alignment from some datapreserving
    *          transformation
+   * @param ignoreFeatures
+   *          when true, differences in seuqence feature annotation are ignored.
    */
   public static void testAlignmentEquivalence(AlignmentI al,
-          AlignmentI al_input)
+          AlignmentI al_input, boolean ignoreFeatures)
   {
     assertNotNull("Original alignment was null", al);
     assertNotNull("Generated alignment was null", al_input);
@@ -261,8 +263,10 @@ public class StockholmFileTest
                   + " are not equal", ss_original.equals(ss_new));
 
           assertTrue(
-                  "Sequence Features were not equivalent",
-                  (seq_original[i].getSequenceFeatures() == null && seq_new[in]
+                  "Sequence Features were not equivalent"
+                          + (ignoreFeatures ? " ignoring." : ""),
+                  ignoreFeatures
+                          || (seq_original[i].getSequenceFeatures() == null && seq_new[in]
                           .getSequenceFeatures() == null)
                           || (seq_original[i].getSequenceFeatures() != null && seq_new[in]
                                   .getSequenceFeatures() != null));
index 6076dec..e561479 100644 (file)
@@ -151,7 +151,7 @@ public class DisorderAnnotExportImport
                       FormatAdapter.PASTE));
 
       // test for consistency in io
-      StockholmFileTest.testAlignmentEquivalence(al, al_new);
+      StockholmFileTest.testAlignmentEquivalence(al, al_new, true);
       return;
     } catch (Exception e)
     {
index c522bc3..7afaeed 100644 (file)
@@ -215,7 +215,7 @@ public class JpredJabaStructExportImport
                       FormatAdapter.PASTE));
 
       // test for consistency in io
-      StockholmFileTest.testAlignmentEquivalence(al, al_new);
+      StockholmFileTest.testAlignmentEquivalence(al, al_new, false);
       return;
     } catch (Exception e)
     {
index 665d9c8..1475b4e 100644 (file)
@@ -210,7 +210,7 @@ public class RNAStructExportImport
                       FormatAdapter.PASTE));
 
       // test for consistency in io
-      StockholmFileTest.testAlignmentEquivalence(al, al_new);
+      StockholmFileTest.testAlignmentEquivalence(al, al_new, false);
       return;
     } catch (Exception e)
     {