JAL-2154 Optional message parameter for assertDatasetNormalised
authorJim Procter <jprocter@issues.jalview.org>
Mon, 29 Aug 2016 11:07:13 +0000 (12:07 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 29 Aug 2016 11:07:13 +0000 (12:07 +0100)
test/jalview/datamodel/AlignmentTest.java

index 58e024f..5568c8c 100644 (file)
@@ -428,11 +428,16 @@ public class AlignmentTest
    * checks that the sequence data for an alignment's dataset is non-redundant.
    * Fails if there are sequences with same id, sequence, start, and.
    */
+
   public static void assertDatasetIsNormalised(AlignmentI al)
   {
+    assertAlignmentDatasetRefs(al, null);
+  }
+  public static void assertDatasetIsNormalised(AlignmentI al, String message)
+  {
     if (al.getDataset()!=null)
     {
-      assertDatasetIsNormalised(al.getDataset());
+      assertDatasetIsNormalised(al.getDataset(), message);
       return;
     }
     /*
@@ -461,7 +466,9 @@ public class AlignmentTest
         {
           continue;
         }
-        Assert.fail("Found similar sequences at position "+p+" and "+q+"\n"+pSeq.toString());
+        Assert.fail((message == null ? "" : message + " :")
+                + "Found similar sequences at position " + p + " and " + q
+                + "\n" + pSeq.toString());
       }
     }
   }
@@ -1024,4 +1031,5 @@ public class AlignmentTest
     assertEquals(1, startEnd[0]);
     assertEquals(23, startEnd[1]);
   }
+
 }