本文整理汇总了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( );
}
示例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));
}
示例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();
}
示例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();
}
示例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( );
}
示例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();
}
示例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();
}
示例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." );
}
示例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( );
}
示例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( );
}
示例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( );
}
示例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();
}
示例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
}
}
示例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();
}
示例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();
}