Java Code Examples for org.netbeans.jemmy.operators.JButtonOperator#pushNoBlock()

The following examples show how to use org.netbeans.jemmy.operators.JButtonOperator#pushNoBlock() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CloseProjectPropertyTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void prepare(){

      Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName);
      pNode.select();
      pNode.performPopupAction("Properties");
       
     jdo = new NbDialogOperator(testProjectName);
     JTreeOperator cattree = new JTreeOperator(jdo);       
     Node cNode = new Node(cattree,"Abilities") ;
     cNode.select();
      
     JButtonOperator addButton = new JButtonOperator(jdo,"Add");
     addButton.pushNoBlock();

     NbDialogOperator add_abil = new NbDialogOperator("Add Ability");
     JComboBoxOperator abilityCombo = new JComboBoxOperator(add_abil); 
     abilityCombo.clearText();
     abilityCombo.typeText("Ability_"+System.currentTimeMillis());
     JButtonOperator abil_okButton = new JButtonOperator(add_abil,"OK");
     abil_okButton.push();
     
  }
 
Example 2
Source File: MavenWebProjectValidation.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Cancel Indexing Maven repository or Unpacking index tasks which are not
 * necessary for tests.
 */
protected void cancelIndexing() {
    String[] labels = {"Indexing Maven repository", "Transferring Maven repository index", "Unpacking index"};
    for (String label : labels) {
        Object lblIndexing = JLabelOperator.findJLabel(
                (Container) MainWindowOperator.getDefault().getSource(),
                label, false, false);
        if (lblIndexing != null) {
            JButton cancelJButton = (JButton) JButtonOperator.findJComponent(
                    (Container) MainWindowOperator.getDefault().getSource(),
                    "Click to cancel process", true, true);
            if (cancelJButton != null) {
                JButtonOperator btnCancel = new JButtonOperator(cancelJButton);
                btnCancel.pushNoBlock();
                try {
                    new NbDialogOperator("Cancel Running Task").yes();
                } catch (TimeoutExpiredException tee) {
                    // ignore if not opened
                }
            }
        }
    }
}
 
Example 3
Source File: AcceptanceTestCaseXSD.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void DeleteJAXBBinding( )
{
    startTest( );

    ProjectsTabOperator pto = ProjectsTabOperator.invoke( );

    ProjectRootNode prn = pto.getProjectRootNode( TEST_JAVA_APP_NAME );
    prn.select( );

    Node bindingNode = new Node( prn, "JAXB Binding|" + JAXB_BINDING_NAME );
    bindingNode.select( );
    bindingNode.performPopupAction( POPUP_DELETE );

    JDialogOperator dlg = new JDialogOperator( "Confirm Object Deletion" );
    JButtonOperator btn = new JButtonOperator( dlg, BUTTON_NAME_YES );
    btn.pushNoBlock( );

    // Wait till JAXB really deleted
    MainWindowOperator.StatusTextTracer stt = MainWindowOperator.getDefault( ).getStatusTextTracer( );
    stt.start( );
    stt.waitText( "Finished building " + TEST_JAVA_APP_NAME + " (jaxb-clean-code-generation)." );
    stt.stop( );

    CreateJAXBBindingInternal(
        JAXB_BINDING_NAME,
        JAXB_PACKAGE_NAME,
        TEST_JAVA_APP_NAME,
        "CreditReport.xsd",
        false
      );

    endTest( );
}
 
Example 4
Source File: AcceptanceTestCaseWSDL.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void DeleteJAXBBinding( )
{
    startTest( );

    ProjectsTabOperator pto = ProjectsTabOperator.invoke( );

    ProjectRootNode prn = pto.getProjectRootNode( TEST_JAVA_APP_NAME );
    prn.select( );

    Node bindingNode = new Node( prn, "JAXB Binding|" + JAXB_BINDING_NAME );
    bindingNode.select( );
    bindingNode.performPopupAction( POPUP_DELETE );

    JDialogOperator dlg = new JDialogOperator( "Confirm Object Deletion" );
    JButtonOperator btn = new JButtonOperator( dlg, BUTTON_NAME_YES );
    btn.pushNoBlock( );

    // Wait till JAXB really deleted
    MainWindowOperator.StatusTextTracer stt = MainWindowOperator.getDefault( ).getStatusTextTracer( );
    stt.start( );
    stt.waitText( "Finished building " + TEST_JAVA_APP_NAME + " (jaxb-clean-code-generation)." );
    stt.stop( );

    CreateJAXBBindingInternal(
        JAXB_BINDING_NAME,
        JAXB_PACKAGE_NAME,
        TEST_JAVA_APP_NAME,
        "CreditReportSimple.wsdl",
        true
      );

    endTest( );
}
 
Example 5
Source File: ImportSourceFilters.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void validate() {
    NbDialogOperator propsDialog = invokeProjectPropertiesDialog(projectName,"Sources");
    
    String btnCaption = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "CustomizerSources.includeExcludeButton");
    JButtonOperator btn = new JButtonOperator(propsDialog,btnCaption);
    btn.pushNoBlock();
    String customizerCaption = Bundle.getString("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "CustomizerSources.title.includeExclude");

    NbDialogOperator customizer = new NbDialogOperator(customizerCaption);
    
    JTextFieldOperator includesBox = new JTextFieldOperator(customizer,1);
    JTextFieldOperator excludesBox = new JTextFieldOperator(customizer,0);

    log(includesBox.getText());
    log(excludesBox.getText());
    
    if(!includesBox.getText().contains("IncludeOne*.java")) {
        fail("Includes doesn't contain expected "+"IncludeOne*.java"+" mask");
    }
    if(!includesBox.getText().contains("IncludeTwo*.java")) {
        fail("Includes doesn't contain expected "+"IncludeTwo*.java"+" mask");
    }
    if(!includesBox.getText().contains("IncludeThree*.java")) {
        fail("Includes doesn't contain expected "+"IncludeThree*.java"+" mask");
    } 
    if(!excludesBox.getText().contains("ExcludeThree*.java")) {
        fail("Excludes doesn't contain expected "+"ExcludeThree*.java"+" mask");
    }
    if(!excludesBox.getText().contains("ExcludeTwo*.java")) {
        fail("Excludes doesn't contain expected "+"ExcludeTwo*.java"+" mask");
    }   
    if(!excludesBox.getText().contains("ExcludeOne*.java")) {
        fail("Excludes doesn't contain expected "+"ExcludeOne*.java"+" mask");
    }           
    customizer.close();
    propsDialog.close();
}
 
Example 6
Source File: CodeTemplatesOperator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public CodeTemplatesOperator addNewTemplate(String abbrev) {
    getNewBt().pushNoBlock();        
    new EventTool().waitNoEvent(250);
    JDialogOperator newDialog = new JDialogOperator("New Code Template");        
    JTextFieldOperator textField = new JTextFieldOperator(newDialog);
    textField.typeText(abbrev);
    new EventTool().waitNoEvent(250);
    JButtonOperator jbo = new JButtonOperator(newDialog, "OK");
    jbo.pushNoBlock();
    new EventTool().waitNoEvent(500);
    return this;
}
 
Example 7
Source File: ProgressBarDemoTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void checkCompleteProgress(JFrameOperator frame, JButtonOperator startButton, JButtonOperator stopButton, JProgressBarOperator progressBar) throws Exception {
    startButton.pushNoBlock();

    progressBar.waitValue(progressBar.getMaximum());

    startButton.waitComponentEnabled();

    assertEquals("Complete Progress", progressBar.getMaximum(), progressBar.getValue());
    assertTrue("Start Button Enabled", startButton.isEnabled());
    assertFalse("Stop Button Disabled", stopButton.isEnabled());
}
 
Example 8
Source File: testInsertDatabase.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void InsertConnectionToDatabase( ) throws Exception
{
  startTest( );

  // Get editor
  EditorOperator eoPHP = new EditorOperator( "index.php" );
  // Locate comment
  eoPHP.setCaretPosition( "// put your code here\n", false );
  eoPHP.insert( "\nclass name\n{\n\n}\n" );
  eoPHP.setCaretPosition( "}", false );
  TypeCode(eoPHP, " ");
  Sleep( 1000 );
  InvokeInsert( eoPHP );
  Sleep( 1000 );

  JDialogOperator jdInsetter = new JDialogOperator( );
  JListOperator jlList = new JListOperator( jdInsetter );

  ClickListItemNoBlock( jlList, 0, 1 );

  JDialogOperator jdGenerator = new JDialogOperator( "Select Database Connection" );

  JButtonOperator jbCancel = new JButtonOperator( jdGenerator, "Cancel" );
  jbCancel.pushNoBlock( );
  jdGenerator.waitClosed( );

  endTest( );
}
 
Example 9
Source File: testInsertSetter.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void InsertSetter( ) throws Exception
{
  startTest( );

  // Invoke Alt+Insert without any code
  // List should contain two database related items

  // Get editor
  EditorOperator eoPHP = new EditorOperator( "index.php" );
  // Locate comment
  eoPHP.setCaretPosition( "// put your code here\n", false );
  eoPHP.insert( "\nclass name\n{\npublic $a;\nprotected $b;\nprivate $c, $d;\n}" );
  eoPHP.setCaretPosition( "$d;\n", false );
  Sleep( 1000 );
  InvokeInsert( eoPHP );
  Sleep( 1000 );

  JDialogOperator jdInsetter = new JDialogOperator( );
  JListOperator jlList = new JListOperator( jdInsetter );

  ClickListItemNoBlock( jlList, 2, 1 );

  JDialogOperator jdGenerator = new JDialogOperator( "Generate Setters" );

  // Sleect all but $c
  JTreeOperator jtTree = new JTreeOperator( jdGenerator, 0 );
  jtTree.clickOnPath( jtTree.findPath( "a" ) );
  jtTree.clickOnPath( jtTree.findPath( "b" ) );
  jtTree.clickOnPath( jtTree.findPath( "d" ) );
  new JCheckBoxOperator(jdGenerator, "Use Public Modifier").push();

  JButtonOperator jbOk = new JButtonOperator( jdGenerator, "OK" );
  jbOk.pushNoBlock( );
  jdGenerator.waitClosed( );

  // Check result
  /*
  String[] asResult =
  {
    "public function setA($a)",
    "{",
    "$this->a = $a;",
    "}",
    "",
    "public function setB($b)",
    "{",
    "$this->b = $b;",
    "}",
    "",
    "public function setD($d)",
    "{",
    "$this->d = $d;",
    "}"
  };
  CheckResult( eoPHP, asResult, -15 );
  */
  CheckFlex( eoPHP, "public function setA($a){$this->a=$a;}public function setB($b){$this->b=$b;}public function setD($d){$this->d=$d;}", false );

  endTest( );
}
 
Example 10
Source File: testInsertGetter.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void InsertGetter( ) throws Exception
{
  startTest( );

  // Invoke Alt+Insert without any code
  // List should contain two database related items

  // Get editor
  EditorOperator eoPHP = new EditorOperator( "index.php" );
  // Locate comment
  eoPHP.setCaretPosition( "// put your code here\n", false );
  eoPHP.insert( "\nclass name\n{\npublic $a;\nprotected $b;\nprivate $c, $d;\n}" );
  eoPHP.setCaretPosition( "$d;\n", false );
  Sleep( 1000 );
  InvokeInsert( eoPHP );
  Sleep( 1000 );

  JDialogOperator jdInsetter = new JDialogOperator( );
  JListOperator jlList = new JListOperator( jdInsetter );

  ClickListItemNoBlock( jlList, 1, 1 );

  JDialogOperator jdGenerator = new JDialogOperator( "Generate Getters" );
  
  // Select all but $c
  JTreeOperator jtTree = new JTreeOperator( jdGenerator, 0 );
  jtTree.clickOnPath( jtTree.findPath( "a" ) );
  jtTree.clickOnPath( jtTree.findPath( "b" ) );
  jtTree.clickOnPath( jtTree.findPath( "d" ) );
  new JCheckBoxOperator(jdGenerator, "Use Public Modifier").push();
  
  JButtonOperator jbOk = new JButtonOperator( jdGenerator, "OK" );
  jbOk.pushNoBlock( );
  jdGenerator.waitClosed( );

  // Check result
  /*
  String[] asResult =
  {
    "public function getA()",
    "{",
    "return $this->a;",
    "}",
    "",
    "public function getB()",
    "{",
    "return $this->b;",
    "}",
    "",
    "public function getD()",
    "{",
    "return $this->d;",
    "}"
  };
  CheckResult( eoPHP, asResult, -15 );
  */
  CheckFlex( eoPHP, "public function getA(){return $this->a;}public function getB(){return $this->b;}public function getD(){return $this->d;}", false );

  endTest( );
}
 
Example 11
Source File: ManageInspectionsOperatot.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void pressCancel() {
    JButtonOperator button = new JButtonOperator(this, "Cancel");
    button.pushNoBlock();
}
 
Example 12
Source File: ManageInspectionsOperatot.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void pressOK() {
    JButtonOperator button = new JButtonOperator(this, "OK");
    button.pushNoBlock();
}
 
Example 13
Source File: ManageInspectionsOperatot.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void presstEditScript() {
    JButtonOperator button = new JButtonOperator(this, "Edit Script");
    button.pushNoBlock();
}
 
Example 14
Source File: ManageInspectionsOperatot.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void pressNew() {
    JButtonOperator button = new JButtonOperator(this, "New...");
    button.pushNoBlock();
}
 
Example 15
Source File: InspectAndTransformOperator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void pressManage(){
    JButtonOperator button = new JButtonOperator(this, "Manage...");
    button.pushNoBlock();
}
 
Example 16
Source File: testInsertConstructor.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void InsertConstructor( ) throws Exception
{
  startTest( );

  // Invoke Alt+Insert without any code
  // List should contain two database related items

  // Get editor
  EditorOperator eoPHP = new EditorOperator( "index.php" );
  // Locate comment
  eoPHP.setCaretPosition( "// put your code here\n", false );
  eoPHP.insert( "\nclass a\n{\n\n}" );
  eoPHP.setCaretPosition( "{\n", false );
  Sleep( 1000 );
  InvokeInsert( eoPHP );
  Sleep( 1000 );

  JDialogOperator jdInsetter = new JDialogOperator( );
  JListOperator jlList = new JListOperator( jdInsetter );

  ClickListItemNoBlock( jlList, 0, 1 );

  JDialogOperator jdGenerator = new JDialogOperator( "Generate Constructor" );
  JButtonOperator jbOk = new JButtonOperator( jdGenerator, "OK" );
  jbOk.pushNoBlock( );
  jdGenerator.waitClosed( );

  // Check result
  /*
  String[] asResult =
  {
    "class a",
    "{",
    "function __construct()",
    "{",
    "}"
  };
  CheckResult( eoPHP, asResult, -3 );
  */
  CheckFlex( eoPHP, "class a{function __construct(){}", false );

  endTest( );
}
 
Example 17
Source File: InspectAndTransformOperator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void pressHelp(){
    JButtonOperator button = new JButtonOperator(this, "Help");
    button.pushNoBlock();
}
 
Example 18
Source File: InspectAndTransformOperator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void pressCancel(){
    JButtonOperator button = new JButtonOperator(this, "Cancel");
    button.pushNoBlock();
}
 
Example 19
Source File: InspectAndTransformOperator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void pressInspect(){
    JButtonOperator button = new JButtonOperator(this, "Inspect");
    button.pushNoBlock();
}
 
Example 20
Source File: testInsertGetterAndSetter.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void InsertGetterAndSetter( ) throws Exception
{
  startTest( );

  // Get editor
  EditorOperator eoPHP = new EditorOperator( "index.php" );
  // Locate comment
  eoPHP.setCaretPosition( "// put your code here\n", false );
  eoPHP.insert( "\nclass name\n{\npublic $a;\nprotected $b;\nprivate $c, $d;\n}" );
  eoPHP.setCaretPosition( "$d;\n", false );
  Sleep( 1000 );
  InvokeInsert( eoPHP );
  Sleep( 1000 );

  JDialogOperator jdInsetter = new JDialogOperator( );
  JListOperator jlList = new JListOperator( jdInsetter );

  ClickListItemNoBlock( jlList, 3, 1 );

  JDialogOperator jdGenerator = new JDialogOperator( "Generate Getters and Setters" );

  // Sleect all but $c
  JTreeOperator jtTree = new JTreeOperator( jdGenerator, 0 );
  jtTree.clickOnPath( jtTree.findPath( "a" ) );
  jtTree.clickOnPath( jtTree.findPath( "b" ) );
  jtTree.clickOnPath( jtTree.findPath( "d" ) );
  new JCheckBoxOperator(jdGenerator, "Use Public Modifier").push();

  JButtonOperator jbOk = new JButtonOperator( jdGenerator, "OK" );
  jbOk.pushNoBlock( );
  jdGenerator.waitClosed( );

  // Check result
  /*
  String[] asResult =
  {
    "public function getA()",
    "{",
    "return $this->a;",
    "}",
    "",
    "public function setA($a)",
    "{",
    "$this->a = $a;",
    "}",
    "",
    "public function getB()",
    "{",
    "return $this->b;",
    "}",
    "",
    "public function setB($b)",
    "{",
    "$this->b = $b;",
    "}",
    "",
    "public function getD()",
    "{",
    "return $this->d;",
    "}",
    "",
    "public function setD($d)",
    "{",
    "$this->d = $d;",
    "}",
    "",
  };
  CheckResult( eoPHP, asResult, -30 );
  */
  //CheckFlex( eoPHP, "public function getA(){return $this->a;}public function setA($a){$this->a=$a;}public function getB(){return $this->b;}public function setB($b){$this->b=$b;}public function getD(){return $this->d;}public function setD($d){$this->d=$d;}", false );
  CheckFlex( eoPHP, "public function getA(){return $this->a;}", false );
  CheckFlex( eoPHP, "public function setA($a){$this->a=$a;}", false );
  CheckFlex( eoPHP, "public function getB(){return $this->b;}", false );
  CheckFlex( eoPHP, "public function setB($b){$this->b=$b;}", false );
  CheckFlex( eoPHP, "public function getD(){return $this->d;}", false );
  CheckFlex( eoPHP, "public function setD($d){$this->d=$d;}", false );

  endTest( );
}