From 0f68d9445845550e0e207334de23ac9e61024d22 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 16 Aug 2016 14:41:35 +0100 Subject: [PATCH] JAL-2154 [test] verify reference integrity for alignment/dataset after each retrieval/crossref view --- test/jalview/io/CrossRef2xmlTests.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/jalview/io/CrossRef2xmlTests.java b/test/jalview/io/CrossRef2xmlTests.java index 56ffa52..d8cf9eb 100644 --- a/test/jalview/io/CrossRef2xmlTests.java +++ b/test/jalview/io/CrossRef2xmlTests.java @@ -26,6 +26,7 @@ import jalview.analysis.CrossRef; import jalview.api.AlignmentViewPanel; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.AlignmentI; +import jalview.datamodel.AlignmentTest; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; import jalview.gui.CrossRefAction; @@ -96,6 +97,11 @@ public class CrossRef2xmlTests extends Jalview2xmlBase af = jalview.gui.SequenceFetcher.fetchAndShow(did[0], did[1]) .get(0); assertTrue("Didn't retrieve " + first, af != null); + + // verify references for retrieved data + AlignmentTest.verifyAlignmentDatasetRefs(af.getViewport() + .getAlignment(), true); + // store project to recover on next pass stringify(dbtoviewBit, savedProjects, first, af.alignPanel); } @@ -105,6 +111,11 @@ public class CrossRef2xmlTests extends Jalview2xmlBase // recover stored project af = new FileLoader(false).LoadFileWaitTillLoaded(savedProjects .get(first).toString(), FormatAdapter.FILE); + + // verify references for recovered data + AlignmentTest.verifyAlignmentDatasetRefs(af.getViewport() + .getAlignment(), true); + } boolean dna = af.getViewport().getAlignment().isNucleotide(); @@ -175,6 +186,9 @@ public class CrossRef2xmlTests extends Jalview2xmlBase } for (AlignmentViewPanel avp : cra_views) { + // verify references for this panel + AlignmentTest.verifyAlignmentDatasetRefs(avp.getAlignment(), + true); SequenceI[] xrseqs = avp.getAlignment().getSequencesArray(); nextxref = first + " -> " + db + "{" + p++ + "}"; @@ -247,6 +261,11 @@ public class CrossRef2xmlTests extends Jalview2xmlBase { nextnextxref = "{" + p + "}" + nextxref + " -> " + xrefdb + "{" + q++ + "}"; + + // verify references for this panel + AlignmentTest.verifyAlignmentDatasetRefs( + nextavp.getAlignment(), true); + viewsourcedb.put(nextavp, nextnextxref); stringify(dbtoviewBit, savedProjects, nextnextxref, nextavp); -- 1.7.10.2