From a4ff95a8db54817a175579ba15c070dd74a2b650 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Wed, 13 Apr 2016 10:44:22 +0100 Subject: [PATCH] JAL-1270 Fixed failing tests due to race conditions in PDBSearchPanelTest and PDBSequenceFetcherTest classes --- test/jalview/gui/PDBSearchPanelTest.java | 12 +++++++++--- test/jalview/gui/StructureChooserTest.java | 7 +++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/test/jalview/gui/PDBSearchPanelTest.java b/test/jalview/gui/PDBSearchPanelTest.java index 5e31bef..2310373 100644 --- a/test/jalview/gui/PDBSearchPanelTest.java +++ b/test/jalview/gui/PDBSearchPanelTest.java @@ -88,7 +88,7 @@ public class PDBSearchPanelTest assertEquals(expectedString, outcome); } - @Test(groups = { "Network", "External" }, timeOut = 5000) + @Test(groups = { "Network", "External" }, timeOut = 7000) public void txt_search_ActionPerformedTest() { PDBSearchPanel searchPanel = new PDBSearchPanel(null); @@ -98,9 +98,15 @@ public class PDBSearchPanelTest assertTrue(mainFrame.getTitle().length() == 20); assertTrue(mainFrame.getTitle() .equalsIgnoreCase("PDB Sequence Fetcher")); - txt_search.setText("ABC"); - + try + { + // wait for web-service to handle response + Thread.sleep(3000); + } catch (InterruptedException e) + { + e.printStackTrace(); + } assertTrue(mainFrame.getTitle().length() > 20); assertTrue(!mainFrame.getTitle().equalsIgnoreCase( "PDB Sequence Fetcher")); diff --git a/test/jalview/gui/StructureChooserTest.java b/test/jalview/gui/StructureChooserTest.java index 28b9b83..6b726de 100644 --- a/test/jalview/gui/StructureChooserTest.java +++ b/test/jalview/gui/StructureChooserTest.java @@ -94,6 +94,13 @@ public class StructureChooserTest sc.setStructuresDiscovered(true); sc.populateFilterComboBox(); + try + { + Thread.sleep(1000); + } catch (InterruptedException e) + { + e.printStackTrace(); + } optionsSize = sc.getCmbFilterOption().getItemCount(); assertTrue(optionsSize > 3); // if structures are found, filter options // should be populated -- 1.7.10.2