当前位置: 首页>>代码示例>>Java>>正文


Java JDialogOperator.waitClosed方法代码示例

本文整理汇总了Java中org.netbeans.jemmy.operators.JDialogOperator.waitClosed方法的典型用法代码示例。如果您正苦于以下问题:Java JDialogOperator.waitClosed方法的具体用法?Java JDialogOperator.waitClosed怎么用?Java JDialogOperator.waitClosed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.jemmy.operators.JDialogOperator的用法示例。


在下文中一共展示了JDialogOperator.waitClosed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CheckUpdated

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public void CheckUpdated( )
{
  startTest( );

  // Open
  new JMenuBarOperator(MainWindowOperator.getDefault()).pushMenuNoBlock("Tools|Plugins");

  JDialogOperator jdPlugins = new JDialogOperator( "Plugins" );

  JTabbedPaneOperator jtTabs = new JTabbedPaneOperator( jdPlugins, 0 );
  jtTabs.setSelectedIndex( jtTabs.findPage( "Updated" ) );

  // Close by button
  JButtonOperator jbClose = new JButtonOperator( jdPlugins, "Close" );
  jbClose.push( );
  jdPlugins.waitClosed( );

  endTest( );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:Autoupdate.java

示例2: checkShowDialogButton

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
private void checkShowDialogButton(JDialogOperator jdo, JButtonOperator jbo)
        throws InterruptedException {
    //Check that the button does not change the number of JDialog
    jbo.push();
    Thread.sleep(500);
    assertEquals("Only one JDialog is present", 1,
            countWindows(jDialogClassChooser));
    assertTrue("Check JDialog is visible", jdo.isVisible());
    jdo.requestClose();
    jdo.waitClosed();
    //Check that the button makes the JDialog visible
    //and that 1 jDialog is present.
    jbo.push();
    jdo.waitComponentVisible(true);
    Thread.sleep(500);
    assertEquals("Only one JDialog is present", 1,
            countWindows(jDialogClassChooser));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:DialogDemoTest.java

示例3: testRefactoring

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
/** Runs refactoring  */
public void testRefactoring() {
    Node node = openFile(CLASS_OLD_NAME);
    runNoBlockPopupOverNode("Refactor|Rename...", node); // NOI18N

    JDialogOperator dialog = new JDialogOperator("Rename"); // NOI18N
    waitNoEvent(3000);
    new JTextFieldOperator(dialog).setText(CLASS_NEW_NAME);
    new JButtonOperator(dialog,"Refactor").clickMouse(); // NOI18N
    dialog.waitClosed();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:RenameFormClassTest.java

示例4: testRefactoring

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
/** Runs refactoring  */
public void testRefactoring() {
    openFile(JAVA_FILE_NAME);
    FormDesignerOperator designer = new FormDesignerOperator(JAVA_FILE_NAME);
    ComponentInspectorOperator inspector = new ComponentInspectorOperator();
    Node node = new Node(inspector.treeComponents(), NODE_PATH);
    
    runNoBlockPopupOverNode("Change Variable Name ...", node); // NOI18N
    
    JDialogOperator dialog = new JDialogOperator("Rename"); // NOI18N
    new JTextFieldOperator(dialog).setText(VARIABLE_NEW_NAME);
    new JButtonOperator(dialog,"OK").clickMouse(); // NOI18N
    dialog.waitClosed();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:RenameComponentVariableTest.java

示例5: CheckDownloaded

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public void CheckDownloaded( )
{
  startTest( );

  // Open
  new JMenuBarOperator(MainWindowOperator.getDefault()).pushMenuNoBlock("Tools|Plugins");

  JDialogOperator jdPlugins = new JDialogOperator( "Plugins" );

  JTabbedPaneOperator jtTabs = new JTabbedPaneOperator( jdPlugins, 0 );
  jtTabs.setSelectedIndex( jtTabs.findPage( "Downloaded" ) );

  // Check buttons
  JButtonOperator jbAdd = new JButtonOperator( jdPlugins, "Add Plugins..." );
  JButtonOperator jbInstall = new JButtonOperator( jdPlugins, "Install" );

  // Check table
  JTableOperator jtTable = new JTableOperator( jdPlugins, 0 );
  int iOriginalRows = jtTable.getRowCount( );

  // Close by button
  JButtonOperator jbClose = new JButtonOperator( jdPlugins, "Close" );
  jbClose.push( );
  jdPlugins.waitClosed( );

  endTest( );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:Autoupdate.java

示例6: useInputDialog

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
private void useInputDialog(JFrameOperator jfo, String textToType, String buttonToPush) {
    new JButtonOperator(jfo, INPUT_BUTTON).pushNoBlock();
    JDialogOperator jdo = new JDialogOperator(INPUT);
    if(textToType != null) {
        JTextFieldOperator jto = new JTextFieldOperator(jdo);
        jto.typeText(textToType);
        jto.waitText(textToType);
    }
    new JButtonOperator(jdo, buttonToPush).push();
    jdo.waitClosed();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:OptionPaneDemoTest.java

示例7: callADialogAndClose

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
private void callADialogAndClose(JFrameOperator jfo, String buttonToOpenDialog,
                                 String dialogTitle, String buttonToPush) {
    new JButtonOperator(jfo, buttonToOpenDialog).pushNoBlock();
    JDialogOperator jdo = new JDialogOperator(dialogTitle);
    new JButtonOperator(jdo, buttonToPush).push();
    jdo.waitClosed();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:OptionPaneDemoTest.java

示例8: AddItInternal

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
protected void AddItInternal(
    int iColumn,
    String sItName,
    String sMenuToAdd,
    String sRadioName,
    String sTypePath,
    String sAddedName
  )
{
  // Swicth to Schema view
  new JMenuBarOperator(MainWindowOperator.getDefault()).pushMenu("View|Editors|Schema");

  // Select first column, Attributes
  SchemaMultiView opMultiView = new SchemaMultiView( JAXB_PACKAGE_NAME + ".xsd" );
  opMultiView.switchToSchema( );
  opMultiView.switchToSchemaColumns( );
  JListOperator opList = opMultiView.getColumnListOperator( iColumn );
  opList.selectItem( sItName );

  // Right click on Reference Schemas
  int iIndex = opList.findItemIndex( sItName );
  Point pt = opList.getClickPoint( iIndex );
  opList.clickForPopup( pt.x, pt.y );

  // Click Add Attribute...
  JPopupMenuOperator popup = new JPopupMenuOperator( );
  popup.pushMenuNoBlock( sMenuToAdd + "..." );

  // Get dialog
  JDialogOperator jadd = new JDialogOperator( sMenuToAdd.replace( "|", " " ) );

  // Set unique name
  JTextFieldOperator txt = new JTextFieldOperator( jadd, 0 );
  txt.setText( sAddedName );

  // Use existing definition
  if( null != sRadioName )
  {
    JRadioButtonOperator jex = new JRadioButtonOperator( jadd, sRadioName );
    jex.setSelected( true );
  }

  // Get tree
  if( null != sTypePath )
  {
    JTreeOperator jtree = new JTreeOperator( jadd, 0 );
    TreePath path = jtree.findPath( sTypePath );
  
    jtree.selectPath( path );
    jtree.clickOnPath( path );
  }

  // Close
  JButtonOperator jOK = new JButtonOperator( jadd, "OK" ); // TODO : OK
  jOK.push( );
  jadd.waitClosed( );

  // Check attribute was added successfully
  opList = opMultiView.getColumnListOperator( iColumn + 1 );
  iIndex = opList.findItemIndex( sAddedName );
  if( -1 == iIndex )
    fail( "It was not added." );

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:65,代码来源:AcceptanceTestCaseXSD.java

示例9: GeneralChecks

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public void GeneralChecks( )
{
  startTest( );

  // Open
  new JMenuBarOperator(MainWindowOperator.getDefault()).pushMenuNoBlock("Tools|Plugins");

  JDialogOperator jdPlugins = new JDialogOperator( "Plugins" );
  //try{ Dumper.dumpAll( "c:\\dump.txt" ); } catch( IOException ex ) { }

  // Wait for a while because tab selection might change.
  Sleep( 2000 );

  // Check tabs
  JTabbedPaneOperator jtTabs = new JTabbedPaneOperator( jdPlugins, 0 );
  String[] asTabs =
  {
    "Updates",
    "Available Plugins",
    "Downloaded",
    "Installed",
    "Settings"
  };

  int iCount = jtTabs.getTabCount( );
  if( iCount != asTabs.length )
    fail( "Invalid number of tabs: " + iCount + ", expected: " + asTabs.length );
  for( int iIndex = 0; iIndex < asTabs.length; iIndex++ )
  {
    String sTitle = jtTabs.getTitleAt( iIndex );
    if( !sTitle.startsWith( asTabs[ iIndex ] ) )
      fail( "Invalid tab at index " + iIndex + ": \"" + sTitle + "\"" );
  }

  // Check buttons
  new JButtonOperator( jdPlugins, "Reload Catalog" );
  new JButtonOperator( jdPlugins, "Uninstall" );
  new JButtonOperator( jdPlugins, "Deactivate" );
  new JButtonOperator( jdPlugins, "Help" );

  // Check there is label
  new JLabelOperator( jdPlugins, "Search:" );

  // Check there is table operator
  new JTableOperator( jdPlugins, 0 );

  // Search text field
  JTextFieldOperator jtSearch = new JTextFieldOperator( jdPlugins, 0 );
  // Check does this field affect selection
  String sSelected = jtTabs.getTitleAt( jtTabs.getSelectedIndex( ) );
  System.out.println( "===" + sSelected );
  jtSearch.enterText( "java" );
  Sleep( 2000 );
  sSelected = jtTabs.getTitleAt( jtTabs.getSelectedIndex( ) );
  System.out.println( "===" + sSelected );
  if( !sSelected.matches( "Installed [(][0-9]+/[0-9]+[)]" ) )
    fail( "Invalid result of filtering." );
  jtSearch.enterText( "" );

  // Close by button
  JButtonOperator jbClose = new JButtonOperator( jdPlugins, "Close" );
  jbClose.push( );
  jdPlugins.waitClosed( );

  endTest( );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:67,代码来源:Autoupdate.java

示例10: CheckInstalled

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public void CheckInstalled( )
{
  startTest( );

  // Open
  new JMenuBarOperator(MainWindowOperator.getDefault()).pushMenuNoBlock("Tools|Plugins");

  JDialogOperator jdPlugins = new JDialogOperator( "Plugins" );

  JTabbedPaneOperator jtTabs = new JTabbedPaneOperator( jdPlugins, 0 );
  jtTabs.setSelectedIndex( jtTabs.findPage( "Installed" ) );

  // HERE THE TESTS

  // Click reload and wait results
  JButtonOperator jbReload = new JButtonOperator( jdPlugins, "Reload Catalog" );
  jbReload.push( );
  Sleep( 5000 );
  boolean bRedo = true;
  int iCount = 0;
  while( bRedo )
  {
    try
    {
      Sleep( 1000 );
      new JLabelOperator( jdPlugins, "Checking for updates in " );
      if( 60 <= ++iCount )
        fail( "Reloading is too long." );
    }
    catch( JemmyException ex )
    {
      bRedo = false;
    }
  }

  // Check buttons
  JButtonOperator jbUninstall = new JButtonOperator( jdPlugins, "Uninstall" );

  // Check table
  JTableOperator jtTable = new JTableOperator( jdPlugins, 0 );
  int iOriginalRows = jtTable.getRowCount( );

  for( int i = 0; i < 10; i++ )
  {
    // Check uninstall disabled
    if( jbUninstall.isEnabled( ) )
      fail( "Uninstall button enabled without selection." );
    // Click first column
    jtTable.clickOnCell( i, 0 );
    // Check uninstall enabled
    if( !jbUninstall.isEnabled( ) )
      fail( "Uninstall button disabled with selection." );

    // Check 
      // ToDo

    // Click first column
    jtTable.clickOnCell( i, 0 );
    // Check uninstall disabled
    if( jbUninstall.isEnabled( ) )
      fail( "Uninstall button enabled without selection." );
  }

  // Close by button
  JButtonOperator jbClose = new JButtonOperator( jdPlugins, "Close" );
  jbClose.push( );
  jdPlugins.waitClosed( );

  endTest( );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:71,代码来源:Autoupdate.java

示例11: CheckAvailablePlugins

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public void CheckAvailablePlugins( )
{
  startTest( );

  // Open
  new JMenuBarOperator(MainWindowOperator.getDefault()).pushMenuNoBlock("Tools|Plugins");

  JDialogOperator jdPlugins = new JDialogOperator( "Plugins" );

  JTabbedPaneOperator jtTabs = new JTabbedPaneOperator( jdPlugins, 0 );
  jtTabs.setSelectedIndex( jtTabs.findPage( "Available Plugins" ) );

  Sleep( 1000 );

  // Check buttons
  JButtonOperator jbReload = new JButtonOperator( jdPlugins, "Reload Catalog" );
  JButtonOperator jbInstall = new JButtonOperator( jdPlugins, "Install" );

  // Check table
  JTableOperator jtTable = new JTableOperator( jdPlugins, 0 );
  int iOriginalRows = jtTable.getRowCount( );

  for( int i = 0; i < iOriginalRows; i++ )
  {
    // Check install disabled
    if( jbInstall.isEnabled( ) )
      fail( "Install button enabled without selection." );
    // Click first column
    jtTable.clickOnCell( i, 0 );
    // Check install enabled
    if( !jbInstall.isEnabled( ) )
      fail( "Install button disabled with selection." );

    // Check 
      // ToDo

    // Click first column
    jtTable.clickOnCell( i, 0 );
    // Check install disabled
    if( jbInstall.isEnabled( ) )
      fail( "Install button enabled without selection." );
  }

  // Close by button
  JButtonOperator jbClose = new JButtonOperator( jdPlugins, "Close" );
  jbClose.push( );
  jdPlugins.waitClosed( );
  endTest( );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:50,代码来源:Autoupdate.java

示例12: checkMessage

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
private void checkMessage(String message) {
    JDialogOperator jdo = new JDialogOperator(MESSAGE);
    new JLabelOperator(jdo, message);
    new JButtonOperator(jdo, OK).push();
    jdo.waitClosed();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:OptionPaneDemoTest.java

示例13: showComponentDialog

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public void showComponentDialog(JFrameOperator jfo) throws Exception {
    // Case: Cancel
    callADialogAndClose(jfo, COMPONENT_BUTTON, COMPONENT_TITLE, COMPONENT_OP5);
    //TODO: wait for no dialog displayed

    // Case: Yes option selected
    {
        callADialogAndClose(jfo, COMPONENT_BUTTON, COMPONENT_TITLE, COMPONENT_OP1);
        checkMessage(COMPONENT_R1);
    }

    // Case: No option selected
    {
        callADialogAndClose(jfo, COMPONENT_BUTTON, COMPONENT_TITLE, COMPONENT_OP2);
        checkMessage(COMPONENT_R2);
    }

    // Case: Maybe option selected
    {
        callADialogAndClose(jfo, COMPONENT_BUTTON, COMPONENT_TITLE, COMPONENT_OP3);
        checkMessage(COMPONENT_R3);
    }

    // Case: Probably option selected
    {
        callADialogAndClose(jfo, COMPONENT_BUTTON, COMPONENT_TITLE, COMPONENT_OP4);
        checkMessage(COMPONENT_R4);
    }

    // Case TextField and ComboBox functional
    {
        new JButtonOperator(jfo, COMPONENT_BUTTON).push();

        JDialogOperator jdo = new JDialogOperator(COMPONENT_TITLE);

        JTextFieldOperator jto = new JTextFieldOperator(jdo);
        jto.clearText();
        jto.typeText(TEXT_TO_TYPE);
        jto.waitText(TEXT_TO_TYPE);

        JComboBoxOperator jcbo = new JComboBoxOperator(jdo);
        jcbo.selectItem(2);
        jcbo.waitItemSelected(2);

        new JButtonOperator(jdo, COMPONENT_OP5).push();
        jdo.waitClosed();
        //TODO: wait for no dialog displayed
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:50,代码来源:OptionPaneDemoTest.java

示例14: showWarningDialog

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public void showWarningDialog(JFrameOperator jfo) throws Exception {
    new JButtonOperator(jfo, WARNING_BUTTON).pushNoBlock();

    JDialogOperator jdo = new JDialogOperator(WARNING_TITLE);

    new JButtonOperator(jdo, OK).push();

    jdo.waitClosed();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:OptionPaneDemoTest.java

示例15: showMessageDialog

import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public void showMessageDialog(JFrameOperator jfo) throws Exception {
    new JButtonOperator(jfo, MESSAGE_BUTTON).pushNoBlock();

    JDialogOperator jdo = new JDialogOperator(MESSAGE);

    new JButtonOperator(jdo, OK).push();

    jdo.waitClosed();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:OptionPaneDemoTest.java


注:本文中的org.netbeans.jemmy.operators.JDialogOperator.waitClosed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。