From: Jim Procter Date: Fri, 26 Aug 2016 12:43:06 +0000 (+0100) Subject: JAL-2154 report any db fetch failures as a fail at end X-Git-Tag: Release_2_10_0~47^2~4^2~43^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ec58d7c6a3ceadb413a2e11247adef2eaee3382b;p=jalview.git JAL-2154 report any db fetch failures as a fail at end --- diff --git a/test/jalview/io/CrossRef2xmlTests.java b/test/jalview/io/CrossRef2xmlTests.java index fc59e1f..838aa7a 100644 --- a/test/jalview/io/CrossRef2xmlTests.java +++ b/test/jalview/io/CrossRef2xmlTests.java @@ -52,6 +52,8 @@ public class CrossRef2xmlTests extends Jalview2xmlBase @Test(groups = { "Operational" }, enabled = true) public void testRetrieveAndShowCrossref() throws Exception { + + List failedDBRetr = new ArrayList(); List failedXrefMenuItems = new ArrayList(); List failedProjectRecoveries = new ArrayList(); @@ -97,11 +99,15 @@ public class CrossRef2xmlTests extends Jalview2xmlBase { // retrieve dbref + List afs = jalview.gui.SequenceFetcher.fetchAndShow( + did[0], did[1]); + if (afs.size() == 0) + { + failedDBRetr.add("Didn't retrieve " + first); + break; + } keyseq.add(first); - - af = jalview.gui.SequenceFetcher.fetchAndShow(did[0], did[1]) - .get(0); - Assert.assertTrue(af != null, "Didn't retrieve " + first); + af = afs.get(0); // verify references for retrieved data AlignmentTest.assertAlignmentDatasetRefs(af.getViewport() @@ -399,6 +405,15 @@ public class CrossRef2xmlTests extends Jalview2xmlBase Assert.fail("Didn't recover projects for some retrievals (did they retrieve ?) (" + failedProjectRecoveries.size() + " counts)"); } + if (failedDBRetr.size() > 0) + { + for (String s : failedProjectRecoveries) + { + System.err.println(s); + } + Assert.fail("Didn't retrieve some db refs for checking cross-refs (" + + failedDBRetr.size() + " counts)"); + } } private void assertProtein(AlignmentViewPanel alignmentViewPanel,