From 99df83b63b14b8bf9879b5ee4546bef68a1a1b14 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 26 Aug 2016 10:51:23 +0100 Subject: [PATCH] =?utf8?q?JAL-2154=20Defer=20failing=20cross-ref=20combinati?= =?utf8?q?ons=20that=20didn=E2=80=99t=20result=20in=20a=20new=20alignment=20?= =?utf8?q?window=20till=20end=20of=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- test/jalview/io/CrossRef2xmlTests.java | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/test/jalview/io/CrossRef2xmlTests.java b/test/jalview/io/CrossRef2xmlTests.java index 24074d0..65c0d2b 100644 --- a/test/jalview/io/CrossRef2xmlTests.java +++ b/test/jalview/io/CrossRef2xmlTests.java @@ -52,6 +52,7 @@ public class CrossRef2xmlTests extends Jalview2xmlBase @Test(groups = { "Operational" }, enabled = true) public void testRetrieveAndShowCrossref() throws Exception { + List failedXrefMenuItems = new ArrayList(); // for every set of db queries // retrieve db query // verify presence of expected xrefs @@ -155,8 +156,12 @@ public class CrossRef2xmlTests extends Jalview2xmlBase { // retrieve and show cross-refs in this thread cra = new CrossRefAction(af, seqs, dna, db); cra.run(); - Assert.assertTrue(cra.getXrefViews().size() > 0, - "No crossrefs retrieved for " + db); + if (cra.getXrefViews().size() == 0) + { + failedXrefMenuItems.add("No crossrefs retrieved for " + + first + " -> " + db); + continue; + } cra_views = cra.getXrefViews(); assertNucleotide(cra_views.get(0), "Nucleotide panel included proteins for " + first @@ -245,11 +250,14 @@ public class CrossRef2xmlTests extends Jalview2xmlBase cra = new CrossRefAction(nextaf, xrseqs, avp .getAlignViewport().isNucleotide(), xrefdb); cra.run(); - Assert.assertTrue( - cra.getXrefViews().size() > 0, - "No crossrefs found for '" + nextnextxref - + "' to " + xrefdb + " via '" - + nextaf.getTitle() + "'"); + if (cra.getXrefViews().size() == 0) + { + failedXrefMenuItems + .add("No crossrefs retrieved for '" + + nextxref + "' to " + xrefdb + " via '" + + nextaf.getTitle() + "'"); + continue; + } cra_views2 = cra.getXrefViews(); assertNucleotide(cra_views2.get(0), "Nucleotide panel included proteins for '" @@ -349,6 +357,16 @@ public class CrossRef2xmlTests extends Jalview2xmlBase } } while (pass3 < 2); } + if (failedXrefMenuItems.size() > 0) + { + StringBuilder sb = new StringBuilder(); + for (String s : failedXrefMenuItems) + { + sb.append(s + "\n"); + } + Assert.fail("Faulty xref menu (" + failedXrefMenuItems.size() + + " counts)\n" + sb.toString()); + } } private void assertProtein(AlignmentViewPanel alignmentViewPanel, -- 1.7.10.2