JAL-1270 Fixed failing tests due to race conditions in PDBSearchPanelTest and PDBSequ...
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 13 Apr 2016 09:44:22 +0000 (10:44 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 13 Apr 2016 09:44:22 +0000 (10:44 +0100)
test/jalview/gui/PDBSearchPanelTest.java
test/jalview/gui/StructureChooserTest.java

index 5e31bef..2310373 100644 (file)
@@ -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"));
index 28b9b83..6b726de 100644 (file)
@@ -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