From ec58d7c6a3ceadb413a2e11247adef2eaee3382b Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 26 Aug 2016 13:43:06 +0100 Subject: [PATCH] JAL-2154 report any db fetch failures as a fail at end --- test/jalview/io/CrossRef2xmlTests.java | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) 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, -- 1.7.10.2