/** @see junit.framework.TestCase#tearDown() */
  protected void tearDown() throws Exception {
    // Only dispose if the dialog hasn't already been dismissed by the
    // test case.
    if (JDialogOperator.findJDialog("Select font", true, false) != null) {
      JDialogOperator dialog = new JDialogOperator("Select font");
      JDialog dialogSource = (JDialog) dialog.getSource();
      dialogSource.setVisible(false);
      dialogSource.dispose();
    }

    // new QueueTool().waitEmpty(10000);
    // dialog.waitClosed();
    // QueueTool.uninstallQueue();

    super.tearDown();
  }
예제 #2
0
 public void pushButtonAndWaitAndApproveDialog(
     String buttonName, String windowName, String dialogButton) throws Exception {
   JFrameOperator mainFrame = new JFrameOperator("JSystem");
   new JButtonOperator(mainFrame, new TooltipChooser(buttonName)).push();
   Thread.sleep(500);
   JDialogOperator dialog = new JDialogOperator(windowName);
   dialog.setModal(true);
   if (!dialog.isActive()) {
     System.out.println(
         "The Dialog "
             + windowName
             + " was not opened successfully.  is visible="
             + dialog.isVisible());
     Thread.sleep(1000);
     System.out.println(
         "The Dialog "
             + windowName
             + " after 1 second sleep active= "
             + dialog.isActive()
             + " is visible="
             + dialog.isVisible());
   } else {
     System.out.println("The Dialog " + windowName + " was opened successfully");
   }
   if (dialogButton != null) {
     new JButtonOperator(dialog, new TooltipChooser(dialogButton)).push();
   }
 }
 /** Tests the JFontChooserDialog. */
 public void testOKButton() {
   logger_.info("Running testOKButton...");
   okButton_.clickMouse();
   assertTrue(!dialog_.getSource().isVisible());
 }