Merge branch 'alpha/JAL-3362_Jalview_212_alpha' into alpha/merge_212_JalviewJS_2112
[jalview.git] / test / jalview / fts / service / pdb / PDBFTSPanelTest.java
index ac1d304..4390873 100644 (file)
@@ -23,24 +23,33 @@ package jalview.fts.service.pdb;
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
 
-import jalview.fts.service.pdb.PDBFTSPanel;
+import jalview.gui.JvOptionPane;
 
 import javax.swing.JInternalFrame;
-import javax.swing.JTextField;
 
 import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import junit.extensions.PA;
+
 public class PDBFTSPanelTest
 {
 
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
   }
 
-  @AfterMethod
+  @AfterMethod(alwaysRun = true)
   public void tearDown() throws Exception
   {
   }
@@ -90,17 +99,18 @@ public class PDBFTSPanelTest
     assertEquals(expectedString, outcome);
   }
 
-  @Test(groups = { "External" }, timeOut = 7000)
+  @Test(groups = { "External" }, timeOut = 8000)
   public void txt_search_ActionPerformedTest()
   {
     PDBFTSPanel searchPanel = new PDBFTSPanel(null);
     JInternalFrame mainFrame = searchPanel.getMainFrame();
-    JTextField txt_search = searchPanel.getTxtSearch();
+//    JComboBox<String> txt_search = PA.gsearchPanel.getTxtSearch();
 
     assertTrue(mainFrame.getTitle().length() == 20);
     assertTrue(mainFrame.getTitle()
             .equalsIgnoreCase("PDB Sequence Fetcher"));
-    txt_search.setText("ABC");
+    PA.invokeMethod(PA.getValue(searchPanel, "txt_search"), "setSelectedItem(java.lang.String)", "ABC");
+  //  txt_search.setSelectedItem("ABC");
     try
     {
       // wait for web-service to handle response