From: Jim Procter Date: Fri, 26 Aug 2016 09:51:23 +0000 (+0100) Subject: JAL-2154 Defer failing cross-ref combinations that didn’t result in a new alignment... X-Git-Tag: Release_2_10_0~47^2~4^2~43^2~8 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=99df83b63b14b8bf9879b5ee4546bef68a1a1b14;p=jalview.git JAL-2154 Defer failing cross-ref combinations that didn’t result in a new alignment window till end of test --- 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,