org.netbeans.jemmy.operators.JComboBoxOperator Java Examples

The following examples show how to use org.netbeans.jemmy.operators.JComboBoxOperator. 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: UseDatabaseTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected void addMethod() throws IOException {
    EditorOperator editor = EditorWindowOperator.getEditor(beanName + "Bean.java");
    editor.select("private javax.ejb.SessionContext context;");

    GenerateCodeOperator.openDialog(editorPopup, editor);
    NbDialogOperator chooseDatabaseOper = new NbDialogOperator(dialogTitle);
    new JButtonOperator(chooseDatabaseOper, "Add...").pushNoBlock();
    NbDialogOperator addReferenceOper = new NbDialogOperator("Add Data Source Reference");
    new JTextFieldOperator((JTextField) new JLabelOperator(addReferenceOper, "Reference Name:").getLabelFor()).typeText(name);
    new JButtonOperator(addReferenceOper, "Add...").pushNoBlock();
    NbDialogOperator createDataSourceOper = new NbDialogOperator("Create Data Source");
    new JTextFieldOperator((JTextField) new JLabelOperator(createDataSourceOper, "JNDI Name:").getLabelFor()).typeText(name);
    new JComboBoxOperator(createDataSourceOper).selectItem("/sample");
    createDataSourceOper.ok();
    addReferenceOper.ok();
    chooseDatabaseOper.ok();
    editor.txtEditorPane().waitText(toSearchInEditor);
    if (saveFile) {
        editor.save();
    }
    compareFiles();
}
 
Example #2
Source File: MethodBreakpointsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testMethodBreakpointFunctionalityOnExit() throws Throwable {        
    NbDialogOperator dialog = Utilities.newBreakpoint(54);
    setBreakpointType(dialog, "Method");
    new JComboBoxOperator(dialog, 2).setSelectedItem(Bundle.getString("org.netbeans.modules.debugger.jpda.ui.breakpoints.Bundle", "LBL_Method_Breakpoint_Type_Entry_or_Exit")); //method entry
    dialog.ok();

    dialog = Utilities.newBreakpoint(80);
    setBreakpointType(dialog, "Method");
    new JComboBoxOperator(dialog, 2).setSelectedItem(Bundle.getString("org.netbeans.modules.debugger.jpda.ui.breakpoints.Bundle", "LBL_Method_Breakpoint_Type_Entry")); //method entry
    dialog.ok();

    dialog = Utilities.newBreakpoint(102);
    setBreakpointType(dialog, "Method");
    new JComboBoxOperator(dialog, 2).setSelectedItem(Bundle.getString("org.netbeans.modules.debugger.jpda.ui.breakpoints.Bundle", "LBL_Method_Breakpoint_Type_Exit")); //method entry
    dialog.ok();

    Utilities.startDebugger();
    Utilities.waitStatusOrConsoleText("Thread main stopped at MemoryView.java:50");
    new ContinueAction().perform();
    Utilities.waitStatusOrConsoleText("Thread main stopped at MemoryView.java:76");
    new ContinueAction().perform();
    Utilities.waitStatusOrConsoleText("Thread main stopped at MemoryView.java:79");
    new ContinueAction().perform();
    Utilities.waitStatusOrConsoleText("Thread main stopped at MemoryView.java:109");
}
 
Example #3
Source File: ViewsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testViewsHeapWalker2() {
    EditorOperator eo = new EditorOperator("MemoryView.java");
    new EventTool().waitNoEvent(500);
    Utilities.toggleBreakpoint(eo, 92);
    Utilities.startDebugger();
    Utilities.checkConsoleLastLineForText("Thread main stopped at MemoryView.java:92");
    Utilities.showDebuggerView(Utilities.classesViewTitle);

    TopComponentOperator tco = new TopComponentOperator(Utilities.classesViewTitle);
    JTableOperator jTableOperator = new JTableOperator(tco);
    JComboBoxOperator filter = new JComboBoxOperator(tco);
    JPopupMenuOperator popup = new JPopupMenuOperator(jTableOperator.callPopupOnCell(0, 0));
    popup.pushMenuNoBlock("Show in Instances View");
    filter.clearText();
    filter.pushKey(KeyEvent.VK_ENTER);
    new EventTool().waitNoEvent(500);
}
 
Example #4
Source File: testNavigation.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected void GoToLine( int iLineToGo, int iLineToCome )
{
  EditorOperator eoPHP = new EditorOperator( "EmptyPHPWebPage.php" );
  eoPHP.clickForPopup( );
  JPopupMenuOperator menu = new JPopupMenuOperator( );
  eoPHP.typeKey('g', InputEvent.CTRL_MASK);
  JDialogOperator jdGoto = new JDialogOperator( "Go to Line or Bookmark" );
  JComboBoxOperator jcLine = new JComboBoxOperator( jdGoto, 0 );
  JTextFieldOperator jtTemp = jcLine.getTextField( );
  jtTemp.setText( "" + iLineToGo );
  JButtonOperator jbGoto = new JButtonOperator( jdGoto, "Go To" );
  jbGoto.push( );
  jdGoto.waitClosed( );
  int iLine = eoPHP.getLineNumber( );
  if( iLineToCome != iLine )
  {
    fail( "Navigate go to line came to incorrect one. Found: " + iLine + ", expected: " + iLineToCome );
  }
}
 
Example #5
Source File: FindUsagesDialogOperator.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Select the scope
 *
 * @param projectName The name of project or null if find should be
 * performed on all projects
 */
public void setScope(String projectName) {
    JComboBoxOperator scopeOperator = getScope();
    String select_item;
    if (projectName == null) {
        select_item = Bundle.getStringTrimmed("org.netbeans.modules.refactoring.java.ui.scope.Bundle", "LBL_AllProjects");
    } else {
        select_item = projectName;
    }

    ComboBoxModel model = scopeOperator.getModel();
    int index = -1;
    String dn;
    for (int i = 0; i < model.getSize()-1; i++) { /// -1 ... it's custom and it fails
        dn = ((org.netbeans.modules.refactoring.spi.impl.DelegatingScopeProvider) model.getElementAt(i)).getDisplayName();
        if (dn.indexOf(select_item) != -1) {
            index = i;
        }
    }
    scopeOperator.selectItem(index);
}
 
Example #6
Source File: PerfUtil.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public static void setSwingBrowser() {
    // Set Swing HTML Browser as default browser
    OptionsOperator optionsOper = OptionsOperator.invoke();
    optionsOper.selectGeneral();
    // "Web Browser:"
    String webBrowserLabel = Bundle.getStringTrimmed(
            "org.netbeans.modules.options.general.Bundle",
            "CTL_Web_Browser");
    JLabelOperator jloWebBrowser = new JLabelOperator(optionsOper, webBrowserLabel);
    // "Swing HTML Browser"
    String swingBrowserLabel = Bundle.getString(
            "org.netbeans.core.ui.Bundle",
            "Services/Browsers/SwingBrowser.ser");
    new JComboBoxOperator((JComboBox)jloWebBrowser.getLabelFor()).
            selectItem(swingBrowserLabel);
    optionsOper.ok();
}
 
Example #7
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 #8
Source File: FieldBreakpointsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 *
 */
public void testFieldBreakpointCreation() {        
    //open source
    Node beanNode = new Node(new SourcePackagesNode(Utilities.testProjectName), "examples.advanced|MemoryView.java"); //NOI18N
    new OpenAction().performAPI(beanNode);
    EditorOperator eo = new EditorOperator("MemoryView.java");
    try {
        eo.clickMouse(50,50,1);
    } catch (Throwable t) {
        System.err.println(t.getMessage());
    }
    NbDialogOperator dialog = Utilities.newBreakpoint(36, 36);
    setBreakpointType(dialog, "Field");
    new JEditorPaneOperator(dialog, 0).setText("examples.advanced.MemoryView");
    new JEditorPaneOperator(dialog, 1).setText("msgMemory");
    new JComboBoxOperator(dialog, 2).selectItem(Bundle.getString("org.netbeans.modules.debugger.jpda.ui.breakpoints.Bundle", "LBL_Field_Breakpoint_Type_Access"));
    dialog.ok();
    Utilities.showDebuggerView(Utilities.breakpointsViewTitle);
    JTableOperator jTableOperator = new JTableOperator(new TopComponentOperator(Utilities.breakpointsViewTitle));
    assertEquals("Field breakpoint was not created.", "Field MemoryView.msgMemory access", jTableOperator.getValueAt(0, 0).toString());
}
 
Example #9
Source File: TemplateTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void openTemplate(String templateName, String category) throws InterruptedException {

        NewFileWizardOperator nfwo = NewFileWizardOperator.invoke();
        nfwo.selectProject(DATA_PROJECT_NAME);
        Thread.sleep(3000);
        nfwo.selectCategory(category);
        nfwo.selectFileType(templateName);
        nfwo.next();
        JComboBoxOperator jcb_package = new JComboBoxOperator(nfwo, 1);
        jcb_package.clearText();
       // jcb_package.enterText("data");
        Thread.sleep(1000);
        
        if (templateName.equals("Bean Form")) {
            nfwo.next();
            JTextFieldOperator class_name = new JTextFieldOperator(nfwo);
            class_name.setText("javax.swing.JButton");
            //nfwo.finish();

        } 
        nfwo.finish();
        Thread.sleep(2000);
        log(templateName + " is created correctly");

    }
 
Example #10
Source File: actionsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void createForm(String formType, String name) throws InterruptedException {
    NewFileWizardOperator nfwo = NewFileWizardOperator.invoke();
    nfwo.selectProject(DATA_PROJECT_NAME);
    Thread.sleep(3000);
    nfwo.selectCategory("Swing GUI Forms");
    nfwo.selectFileType(formType);
    nfwo.next();
    JTextFieldOperator form_name = new JTextFieldOperator(nfwo, 0);
    form_name.setText(name);
    JComboBoxOperator jcb_package = new JComboBoxOperator(nfwo, 1);
    jcb_package.selectItem("data");
    Thread.sleep(3000);

    if (formType.equals("Bean Form")) {
        nfwo.next();
        JTextFieldOperator class_name = new JTextFieldOperator(nfwo);
        class_name.setText("javax.swing.JButton");
        nfwo.finish();
        log(formType + " is created correctly");
    } else {
        nfwo.finish();
        log(formType + " is created correctly");
        Thread.sleep(3000);
    }

}
 
Example #11
Source File: GeneralPHP.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void setPHPIndentation(int initialIndentation, int contIndentation, int arrayDeclarationIndentation) {
    JDialogOperator window = selectPHPFromEditorOptions(1, getPlatform());

    //categories - check if they are all present
    JComboBoxOperator category = new JComboBoxOperator(window, 1);
    category.selectItem("Tabs And Indents");

    JTextFieldOperator initialIndentTextField = new JTextFieldOperator(window, 1);
    initialIndentTextField.clearText();
    initialIndentTextField.enterText(
            String.valueOf(initialIndentation));

    JTextFieldOperator contIndentTextField = new JTextFieldOperator(window, 2);
    contIndentTextField.clearText();
    contIndentTextField.enterText(
            String.valueOf(contIndentation));

    JTextFieldOperator arrayDeclarationIndentTextField = new JTextFieldOperator(window, 1);
    arrayDeclarationIndentTextField.clearText();
    arrayDeclarationIndentTextField.enterText(
            String.valueOf(arrayDeclarationIndentation));


}
 
Example #12
Source File: AbbreviationsAddRemovePerformer.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testChangeExpansionKey() {
    Abbreviations abbrevs = Abbreviations.invoke("Java");
    JComboBoxOperator expandOnCombo = abbrevs.getExpandOnCombo();
    expandOnCombo.selectItem("Enter");                       
    abbrevs.ok();                
    new EventTool().waitNoEvent(2000);
    final EditorOperator editor = openFile("Test2");
    try {            
        editor.setCaretPosition(16, 9);
        System.out.println("here");
        editor.txtEditorPane().typeText("sout");            
        System.out.println("Typed");        
        new EventTool().waitNoEvent(2000);
        editor.pushKey(KeyEvent.VK_ENTER);
        System.out.println("here");
        ref(editor.getText());
    } finally {            
        editor.closeDiscard();
        abbrevs = Abbreviations.invoke("Java");
        expandOnCombo = abbrevs.getExpandOnCombo();
        expandOnCombo.selectItem("Tab");
        abbrevs.ok();
    }
}
 
Example #13
Source File: MasterDetailFormTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Uses Master/Detail Sample wizard */
public void testMasterDetailWizard() {
    NewFileWizardOperator nfwo = NewFileWizardOperator.invoke();
    nfwo.selectProject(getTestProjectName());
    nfwo.selectCategory("Swing GUI Forms"); // NOI18N
    nfwo.selectFileType("Master/Detail Sample Form"); // NOI18N
    nfwo.next();
    
    NewJavaFileNameLocationStepOperator nfnlso = new NewJavaFileNameLocationStepOperator();
    nfnlso.txtObjectName().clearText();
    nfnlso.txtObjectName().typeText(_newFormName);
    nfnlso.setPackage(getTestPackageName());
    nfnlso.next();
    
    NbDialogOperator masterOp = new NbDialogOperator("New Master/Detail Form"); // NOI18N
    new JComboBoxOperator(masterOp,1).selectItem(SetUpDerbyDatabaseTest.JDBC_URL);
    new JButtonOperator(masterOp,"Next").clickMouse(); // NOI18N
    
    masterOp = new NbDialogOperator("New Master/Detail Form"); // NOI18N
    new JButtonOperator(masterOp,"Finish").clickMouse(); // NOI18N
    waitNoEvent(8000);
}
 
Example #14
Source File: OpenTempl_defaultPackTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void openTemplate(String templateName, String category) throws InterruptedException {

        NewFileWizardOperator nfwo = NewFileWizardOperator.invoke();
        nfwo.selectProject(DATA_PROJECT_NAME);
        Thread.sleep(3000);
        nfwo.selectCategory(category);
        nfwo.selectFileType(templateName);
        nfwo.next();
        JComboBoxOperator jcb_package = new JComboBoxOperator(nfwo, 1);
        jcb_package.clearText();
        Thread.sleep(1000);

        if (templateName.equals("Bean Form")) {
            nfwo.next();
            JTextFieldOperator class_name = new JTextFieldOperator(nfwo);
            class_name.setText("javax.swing.JButton");
            nfwo.finish();
            log(templateName + " is created correctly");
        } else {
            nfwo.finish();
            log(templateName + " is created correctly");
            Thread.sleep(1000);
        }
        
    }
 
Example #15
Source File: WsValidation.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Tests Call Web Service Operation action in a servlet
 */
public void testCallWsOperationInServlet() {
    assertServerRunning();
    //create a servlet
    //Web
    String webLabel = Bundle.getStringTrimmed("org.netbeans.modules.web.core.Bundle", "Templates/JSP_Servlet");
    //Servlet
    String servletLabel = Bundle.getStringTrimmed("org.netbeans.modules.web.core.Bundle", "Templates/JSP_Servlet/Servlet.java");
    createNewFile(getWsClientProject(), webLabel, servletLabel);
    NewJavaFileNameLocationStepOperator op = new NewJavaFileNameLocationStepOperator();
    JComboBoxOperator jcbo = new JComboBoxOperator(op, 1);
    jcbo.typeText("org.mycompany.servlets"); //NOI18N
    op.finish();
    //edit code in the servlet
    EditorOperator eo = new EditorOperator("NewServlet"); //NOI18N
    // add new line and select it
    eo.setCaretPosition("\"</h1>\");", false); //NOI18N
    eo.insert("\n//xxx"); //NOI18N
    eo.select("//xxx"); //NOI18N
    callWsOperation(eo, "myIntMethod", eo.getLineNumber()); //NOI18N
    assertTrue("@WebServiceRef has not been found", eo.contains("@WebServiceRef")); //NOI18N
    eo.close(true);
}
 
Example #16
Source File: NewFileWizardsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void puTest(String prjRoot, String name) throws Exception {
    Project p = J2eeProjectSupport.getProject(new File(projectLocation), prjRoot);
    NewFileWizardOperator nfwo = WizardUtils.createNewFile(p,
            "Persistence", "Persistence Unit");
    JTextFieldOperator jtfo = new JTextFieldOperator(nfwo, 0);
    jtfo.clearText();
    jtfo.typeText(name);
    JComboBoxOperator jcbo = new JComboBoxOperator(nfwo, 1);
    jcbo.selectItem("jdbc/sample");
    nfwo.finish();
    nfwo.waitClosed();
    List<File> files = new ArrayList<File>();
    File prjDir = new File(new File(projectLocation), prjRoot).getCanonicalFile();
    files.add(new File(prjDir, "src/conf/persistence.xml"));
    checkFiles(files);
}
 
Example #17
Source File: FixImportsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Complex fix imports test.
 */
public void testFixImportsComplex() {
    // test fix imports on List
    EditorOperator editor = new EditorOperator(TEST_CLASS_NAME);
    editor.insert("List l = new List();\n", 51, 1);
    
    Utilities.takeANap(100);
    
    // invoke fix imports
    MainWindowOperator.getDefault().pushKey(KeyEvent.VK_I,
                KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK);        
    FixAllImports fio = new FixAllImports();
    
    JComboBoxOperator cbo = fio.cbo(0);
    ComboBoxModel cbm = cbo.getModel();                
    fio.ok();
    // wait for fix imports
    for (int i=0; i<10; i++) {
        Utilities.takeANap(1000);
        if (editor.getText().contains("import java.util.List;")) break;
        //System.out.println(MainWindowOperator.getDefault().getStatusText());
    }
    ref(editor.getText());
    compareReferenceFiles();
    editor.close(false);
}
 
Example #18
Source File: KeyMapOperator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void selectProfile(String profile) {
    JComboBoxOperator combo = profile();
    if (combo.getSelectedItem().toString().equals(profile)) {
        return; //no need to switch profile
    }
    ComboBoxModel model = combo.getModel();
    for (int i = 0; i < model.getSize(); i++) {
        Object item = model.getElementAt(i);
        if (item.toString().equals(profile)) {
            combo.setSelectedIndex(i);
            return;
        }
    }
    throw new IllegalArgumentException("Profile " + profile + " not found");
}
 
Example #19
Source File: NewUnicastEventSource.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** testGenerateEmpty method */
    public void testGenerateEmpty() {
//
        RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
        
        Node repositoryRootNode = explorerOperator.getRootNode();
        Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
        patternsNode.select();
        patternsNode.performPopupActionNoBlock("Add"+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_UNICASTSE"));
        String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewUniCastES");
        NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

        JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
        jComboBoxOperator.setSelectedItem("java.awt.event.ActionListener");

        JRadioButtonOperator jRadioButtonOperator = new JRadioButtonOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_UEventSetPanel_emptyRadioButton"));
        jRadioButtonOperator.push();        

        new EventTool().waitNoEvent(2000);
                               
        nbDialogOperator.ok();
        
        new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

        EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
        ref(eo.getText());
        compareReferenceFiles();                               
//                                       
    }
 
Example #20
Source File: NewMulticastEventSource.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testPassEventAsParameter() {
//
        RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
        
        Node repositoryRootNode = explorerOperator.getRootNode();
        Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
        patternsNode.select();
        patternsNode.performPopupActionNoBlock(Bundle.getString("org.openide.src.nodes.Bundle", "LAB_Add")+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_MULTICASTSE"));
        String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewMultiCastES");
        NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

        JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
        jComboBoxOperator.setSelectedItem("java.awt.event.ActionListener");

        JRadioButtonOperator jRadioButtonOperator = new JRadioButtonOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_EventSetPanel_ellRadioButton"));
        jRadioButtonOperator.push();        
        JCheckBoxOperator jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle","CTL_EventSetPanel_fireCheckBox"));
        jCheckBoxOperator.push();
        jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle","CTL_EventSetPanel_passEventCheckBox"));
        jCheckBoxOperator.push();

        new EventTool().waitNoEvent(3000);
                               
        nbDialogOperator.ok();

        new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

        EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
        ref(eo.getText());
        compareReferenceFiles();                               
//                                       
    }
 
Example #21
Source File: WrappingOperator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public JComboBoxOperator getExtendsImplementsList() {
    if (extendsImplementsList == null) {
        extendsImplementsList = formattingOperator.getComboBoxByLabel("Extends/Implements List:");
        storeDefaultValue(Settings.WRAP_EXTENDSLIST);
    }
    return extendsImplementsList;
}
 
Example #22
Source File: NewMulticastEventSource.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testGenerateEventFiringMethods() {
//
        RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
        
        Node repositoryRootNode = explorerOperator.getRootNode();
        Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
        patternsNode.select();
        patternsNode.performPopupActionNoBlock(Bundle.getString("org.openide.src.nodes.Bundle", "LAB_Add")+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_MULTICASTSE"));
        String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewMultiCastES");
        NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

        JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
        jComboBoxOperator.setSelectedItem("java.awt.event.ActionListener");

        JRadioButtonOperator jRadioButtonOperator = new JRadioButtonOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_EventSetPanel_alRadioButton"));
        jRadioButtonOperator.push();        
        JCheckBoxOperator jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle","CTL_EventSetPanel_fireCheckBox"));
        jCheckBoxOperator.push();

        new EventTool().waitNoEvent(3000);
                               
        nbDialogOperator.ok();

        new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

        EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
        ref(eo.getText());
        compareReferenceFiles();                               
//                                       
    }
 
Example #23
Source File: NewMulticastEventSource.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testGenerateEventListenerListImplementation() {
//
        RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
        
        Node repositoryRootNode = explorerOperator.getRootNode();
        Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
        patternsNode.select();
        patternsNode.performPopupActionNoBlock(Bundle.getString("org.openide.src.nodes.Bundle", "LAB_Add")+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_MULTICASTSE"));
        String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewMultiCastES");
        NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

        JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
        jComboBoxOperator.setSelectedItem("java.awt.event.ActionListener");

        JRadioButtonOperator jRadioButtonOperator = new JRadioButtonOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_EventSetPanel_ellRadioButton"));
        jRadioButtonOperator.push();        

        new EventTool().waitNoEvent(3000);
                               
        nbDialogOperator.ok();

        new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

        EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
        ref(eo.getText());
        compareReferenceFiles();                               
//                                       
    }
 
Example #24
Source File: NewMulticastEventSource.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testGenerateArrayListImplementation() {
//
        RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
        
        Node repositoryRootNode = explorerOperator.getRootNode();
        Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
        patternsNode.select();
        patternsNode.performPopupActionNoBlock(Bundle.getString("org.openide.src.nodes.Bundle", "LAB_Add")+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_MULTICASTSE"));
        String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewMultiCastES");
        NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

        JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
        jComboBoxOperator.setSelectedItem("java.awt.event.ActionListener");

        JRadioButtonOperator jRadioButtonOperator = new JRadioButtonOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_EventSetPanel_alRadioButton"));
        jRadioButtonOperator.push();        

        new EventTool().waitNoEvent(2000);
                               
        nbDialogOperator.ok();

        new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

        EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
        ref(eo.getText());
        compareReferenceFiles();                               
//                                       
    }
 
Example #25
Source File: NewMulticastEventSource.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testGenerateEmpty() {
//
        RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
        
        Node repositoryRootNode = explorerOperator.getRootNode();
        Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
        patternsNode.select();
        patternsNode.performPopupActionNoBlock(Bundle.getString("org.openide.src.nodes.Bundle", "LAB_Add")+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_MULTICASTSE"));
        String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewMultiCastES");
        NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

        JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
        jComboBoxOperator.setSelectedItem("java.awt.event.ActionListener");

        JRadioButtonOperator jRadioButtonOperator = new JRadioButtonOperator(nbDialogOperator, Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_EventSetPanel_emptyRadioButton"));
        jRadioButtonOperator.push();        

        new EventTool().waitNoEvent(2000);
                               
        nbDialogOperator.ok();

        new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

        EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
        ref(eo.getText());
        compareReferenceFiles();                               
//                                       
    }
 
Example #26
Source File: CreateNewNonIndexedProperty.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** testType method */ 
public void testType() {

    RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
    
    
    Node repositoryRootNode = explorerOperator.getRootNode();
    Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
    patternsNode.select();
    patternsNode.performPopupActionNoBlock(Bundle.getString("org.openide.src.nodes.Bundle", "LAB_Add")+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_PROPERTY"));
    String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewProperty");
    NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

    JTextFieldOperator jTextFieldOperator = new JTextFieldOperator(nbDialogOperator, 0);       
    jTextFieldOperator.typeText(NAME_NON_INDEX_PROPERTY);
    
    JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
    jComboBoxOperator.typeText(TYPE_WRONG);
    nbDialogOperator.ok();

    new EventTool().waitNoEvent(3000);
    new NbDialogOperator("Error").ok();

    jTextFieldOperator.clearText();
    jTextFieldOperator.typeText(NAME_NON_INDEX_PROPERTY);
    jComboBoxOperator.clearText();
    jComboBoxOperator.setSelectedItem("Double");
                   
    nbDialogOperator.ok();
    new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

    EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
    ref(eo.getText());
    compareReferenceFiles();                               
                                   
}
 
Example #27
Source File: CreateNewNonIndexedProperty.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** testName method */
public void testName() {
    RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
    
    Node repositoryRootNode = explorerOperator.getRootNode();
    Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
    patternsNode.select();
    patternsNode.performPopupActionNoBlock(Bundle.getString("org.openide.src.nodes.Bundle", "LAB_Add")+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_PROPERTY"));
    String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewProperty");
    NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

    JTextFieldOperator jTextFieldOperator = new JTextFieldOperator(nbDialogOperator, 0);       
    jTextFieldOperator.typeText(NAME_WRONG);        

    JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
    jComboBoxOperator.setSelectedItem("String");
    
    nbDialogOperator.ok();

    new EventTool().waitNoEvent(3000);

    new NbDialogOperator("Error").ok();
                          
    jTextFieldOperator.clearText();
    jTextFieldOperator.typeText(NAME_NON_INDEX_PROPERTY);
    
    jComboBoxOperator.setSelectedItem("String");
                   
    nbDialogOperator.ok();

    new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

    EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
    ref(eo.getText());
    compareReferenceFiles();                               
}
 
Example #28
Source File: CreateNewIndexedProperty.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** testType method */
public void testType() {
    RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
    
    Node repositoryRootNode = explorerOperator.getRootNode();
    Node patternsNode = new Node(repositoryRootNode, sampleDir+"|"+NAME_TEST_FILE+"|"+"class "+NAME_TEST_FILE+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "Patterns"));
    patternsNode.select();
    patternsNode.performPopupActionNoBlock(Bundle.getString("org.openide.src.nodes.Bundle", "LAB_Add")+"|"+Bundle.getString("org.netbeans.modules.beans.Bundle", "MENU_CREATE_IDXPROPERTY"));
    String dialogTitle = Bundle.getString("org.netbeans.modules.beans.Bundle", "CTL_TITLE_NewIdxProperty");
    NbDialogOperator nbDialogOperator = new NbDialogOperator(dialogTitle);

    JTextFieldOperator jTextFieldOperator = new JTextFieldOperator(nbDialogOperator, 0);       
    jTextFieldOperator.typeText(NAME_INDEX_PROPERTY);        
    
    JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
    jComboBoxOperator.typeText(TYPE_WRONG);
    
    nbDialogOperator.ok();

    new EventTool().waitNoEvent(3000);

    new NbDialogOperator("Error").ok();
                          
    jTextFieldOperator.clearText();
    jTextFieldOperator.typeText(NAME_INDEX_PROPERTY);
    jComboBoxOperator.clearText();
    jComboBoxOperator.setSelectedItem("Double");
                   
    nbDialogOperator.ok();

    new JavaNode(repositoryRootNode, sampleDir + "|" + NAME_TEST_FILE).open();

    EditorOperator eo = new EditorOperator(NAME_TEST_FILE);
    ref(eo.getText());
    compareReferenceFiles();                       
}
 
Example #29
Source File: WrappingOperator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public JComboBoxOperator getLambdaArrow() {
    if (lambdaArrow == null) {
        lambdaArrow = formattingOperator.getComboBoxByLabel("Lambda Arrow:");
        storeDefaultValue(Settings.WRAP_LAMBDAARROW);
    }
    return lambdaArrow;
}
 
Example #30
Source File: MoveTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void performMove(String fileName, String pkgName, String newPkg, boolean performInEditor, MoveTest.TargetDestination target) {
    if (performInEditor) {
        openSourceFile(pkgName, fileName);
        EditorOperator editor = new EditorOperator(fileName);
        editor.setCaretPosition(1, 1);
        new RefactorMoveAction().performPopup(editor);
    } else {
        SourcePackagesNode src = new SourcePackagesNode(testProjectRootNode);
        Node node = new Node(src, pkgName + TREE_SEPARATOR + fileName);
        node.select();
        new RefactorMoveAction().performPopup(node);
    }
    MoveClassDialogOperator mo = new MoveClassDialogOperator();
    JComboBoxOperator location = mo.getLocationCombo();
    switch (target) {
        case SOURCE:
            location.selectItem(0);
            break;
        case TESTS:
            location.selectItem(1);
            break;
    }
    mo.getPackageCombo().clearText();
    mo.getPackageCombo().typeText(newPkg);
    mo.preview();
    dumpRefactoringResults();
}