From 1361f8e20a0829234025bfeb06d3b8de6c660e0a Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 29 Aug 2016 12:02:03 +0100 Subject: [PATCH] JAL-2154 new assertDatasetIsNormalised to trivially test for the addition of identical sequence data in the dataset (e.g. due to faulty create CDS sequence processes) --- test/jalview/datamodel/AlignmentTest.java | 116 +++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/test/jalview/datamodel/AlignmentTest.java b/test/jalview/datamodel/AlignmentTest.java index fe76df5..58e024f 100644 --- a/test/jalview/datamodel/AlignmentTest.java +++ b/test/jalview/datamodel/AlignmentTest.java @@ -422,7 +422,123 @@ public class AlignmentTest al.getDataset().deleteSequence(sqanotherout); assertVerifyAlignment(al, true, "verify should have passed after duplicate entry for sequence was removed"); + } + + /** + * 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) + { + if (al.getDataset()!=null) + { + assertDatasetIsNormalised(al.getDataset()); + return; + } + /* + * look for pairs of sequences with same ID, start, end, and sequence + */ + List seqSet = al.getSequences(); + for (int p=0;p