Java Code Examples for org.netbeans.jemmy.operators.JTableOperator#selectCell()

The following examples show how to use org.netbeans.jemmy.operators.JTableOperator#selectCell() . 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: AntSanityTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Steps over expression at line 143.
 */
public void stepOverExpression() throws InterruptedException {
    new StepOverExpressionAction().perform();
    JTableOperator jTableOperator = new JTableOperator(new TopComponentOperator(VARIABLES_VIEW));
    jTableOperator.waitCell("Before call to '<init>()'", 1, 0);
    jTableOperator.waitCell("Arguments", 2, 0);
    jTableOperator.selectCell(2, 0);
    pressKey(KeyEvent.VK_RIGHT);
    Thread.sleep(3000); // Wait 3 seconds. Sometimes expanding Arguments node is slow.
    jTableOperator.waitCell("total", 3, 0);
    new StepOverExpressionAction().perform();
    jTableOperator.waitCell("free", 3, 0);
    jTableOperator.waitCell("Return values history", 4, 0);
    jTableOperator.waitCell("return <init>()", 5, 0);
    new StepOverExpressionAction().perform();
    jTableOperator.waitCell("taken", 3, 0);
    jTableOperator.waitCell("Return values history", 4, 0);
    jTableOperator.waitCell("return <init>()", 5, 0);
    jTableOperator.waitCell("return <init>()", 6, 0);
    new StepOverExpressionAction().perform();
    jTableOperator.waitCell("new Object[]{new Long(total), new Long(free), new Integer(taken)}", 3, 0);
    jTableOperator.waitCell("Return values history", 4, 0);
    jTableOperator.waitCell("return <init>()", 5, 0);
    jTableOperator.waitCell("return <init>()", 6, 0);
    jTableOperator.waitCell("return <init>()", 7, 0);
    new StepOverExpressionAction().perform();
    jTableOperator.waitCell("msgMemory.format(new Object[]{new Long(total), new Long(free), new Integer(taken)})", 3, 0);
    jTableOperator.waitCell("Return values history", 4, 0);
    jTableOperator.waitCell("return <init>()", 5, 0);
    jTableOperator.waitCell("return <init>()", 6, 0);
    jTableOperator.waitCell("return <init>()", 7, 0);
    jTableOperator.waitCell("return format()", 8, 0);
}
 
Example 2
Source File: CodeTemplatesOperator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public boolean selectTemplate(String abbrev) {
    JTableOperator templatesTable1 = getTemplatesTable();
    int row = templatesTable1.findCellRow(abbrev, 0, 0);
    if(row==-1) return false;
    templatesTable1.selectCell(row, 0);
    return true;                
}
 
Example 3
Source File: ProfilerValidationTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Test Profiler options.
 */
public void testOptions() {
    OptionsOperator options = OptionsOperator.invoke();
    options.selectJava();
    JTabbedPaneOperator tabbedPane = new JTabbedPaneOperator(options);
    tabbedPane.selectPage("Profiler");
    JListOperator categoriesOper = new JListOperator(options);
    // General category
    assertEquals("Wrong profiling port.", 5140, new JSpinnerOperator(options).getValue());
    // manage calibration data
    new JButtonOperator(options, "Manage").pushNoBlock();
    NbDialogOperator manageOper = new NbDialogOperator("Manage Calibration data");
    JTableOperator platformsOper = new JTableOperator(manageOper);
    platformsOper.selectCell(0, 0);
    new JButtonOperator(manageOper, "Calibrate").pushNoBlock();
    new NbDialogOperator("Information").ok();
    manageOper.closeByButton();
    // reset
    new JButtonOperator(options, "Reset").push();
    // Snapshots category
    categoriesOper.selectItem("Snapshots");
    JLabelOperator lblSnapshotOper = new JLabelOperator(options, "When taking snapshot:");
    assertEquals("Wrong value for " + lblSnapshotOper.getText(), "Open snapshot", new JComboBoxOperator((JComboBox) lblSnapshotOper.getLabelFor()).getSelectedItem());
    JLabelOperator lblOpenOper = new JLabelOperator(options, "Open automatically:");
    assertEquals("Wrong value for " + lblOpenOper.getText(), "On first saved snapshot", new JComboBoxOperator((JComboBox) lblOpenOper.getLabelFor()).getSelectedItem());
    // Engine category
    categoriesOper.selectItem("Engine");
    JLabelOperator lblSamplingOper = new JLabelOperator(options, "Sampling frequency");
    assertEquals("Wrong value for " + lblSamplingOper.getText(), 10, new JSpinnerOperator((JSpinner) lblSamplingOper.getLabelFor()).getValue());
    options.cancel();
}
 
Example 4
Source File: PluginsOperator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Selects plugins in the table.
 * @param pluginNames array of plugin names to be selected
 */
public void selectPlugins(String[] pluginNames) {
    JTableOperator tableOper = table();
    for (int i = 0; i < pluginNames.length; i++) {
        String name = pluginNames[i];
        int row = tableOper.findCellRow(name, new DefaultStringComparator(true, true), 1, 0);
        if(row == -1) {
            throw new JemmyException("Plugin "+name+" not found.");
        }
        tableOper.selectCell(row, 1);
        tableOper.clickOnCell(row, 0);
    }
}
 
Example 5
Source File: WsValidation.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void removeHandlers(NbDialogOperator ndo, String[] handlers) {
    //Confirm Handler Configuration Change
    String changeTitle = Bundle.getStringTrimmed("org.netbeans.modules.websvc.spi.support.Bundle", "TTL_CONFIRM_DELETE");
    JTableOperator jto = new JTableOperator(ndo);
    for (int i = 0; i < handlers.length; i++) {
        jto.selectCell(jto.findCellRow(handlers[i]), jto.findCellColumn(handlers[i]));
        //Remove
        new JButtonOperator(ndo, "Remove").pushNoBlock();
        new NbDialogOperator(changeTitle).yes();
    }
}
 
Example 6
Source File: EditorWindowOperator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Pushes down arrow control button in top right corner intended to 
 * show list of opened documents and selects document with given name
 * in the list.
 */
public static void selectDocument(String name) {
    btDown().push();
    JTableOperator tableOper = new JTableOperator(MainWindowOperator.getDefault());
    int row = tableOper.findCellRow(name);
    if (row > -1) {
        tableOper.selectCell(row, 0);
    } else {
        throw new JemmyException("Cannot select document \"" + name + "\".");
    }
}
 
Example 7
Source File: ProfilerValidationTest.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test Profiler options.
 */
public void testOptions() {
    OptionsOperator options = OptionsOperator.invoke();
    options.selectJava();
    JTabbedPaneOperator tabbedPane = new JTabbedPaneOperator(options);
    tabbedPane.selectPage("Profiler");
    JListOperator categoriesOper = new JListOperator(options);
    // General category
    assertEquals("Wrong profiling port.", 5140, new JSpinnerOperator(options).getValue());
    // manage calibration data
    new JButtonOperator(options, "Manage").pushNoBlock();
    NbDialogOperator manageOper = new NbDialogOperator("Manage Calibration data");
    JTableOperator platformsOper = new JTableOperator(manageOper);
    platformsOper.selectCell(0, 0);
    new JButtonOperator(manageOper, "Calibrate").pushNoBlock();
    new NbDialogOperator("Information").ok();
    manageOper.closeByButton();
    // reset
    new JButtonOperator(options, "Reset").push();
    // Snapshots category
    categoriesOper.selectItem("Snapshots");
    JLabelOperator lblSnapshotOper = new JLabelOperator(options, "When taking snapshot:");
    assertEquals("Wrong value for " + lblSnapshotOper.getText(), "Open snapshot", new JComboBoxOperator((JComboBox) lblSnapshotOper.getLabelFor()).getSelectedItem());
    JLabelOperator lblOpenOper = new JLabelOperator(options, "Open automatically:");
    assertEquals("Wrong value for " + lblOpenOper.getText(), "On first saved snapshot", new JComboBoxOperator((JComboBox) lblOpenOper.getLabelFor()).getSelectedItem());
    // Engine category
    categoriesOper.selectItem("Engine");
    JLabelOperator lblSamplingOper = new JLabelOperator(options, "Sampling frequency");
    assertEquals("Wrong value for " + lblSamplingOper.getText(), 10, new JSpinnerOperator((JSpinner) lblSamplingOper.getLabelFor()).getValue());
    options.cancel();
}
 
Example 8
Source File: WsValidation.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private void moveUpHandler(NbDialogOperator ndo, String handler) {
    JTableOperator jto = new JTableOperator(ndo);
    jto.selectCell(jto.findCellRow(handler), jto.findCellColumn(handler));
    new JButtonOperator(ndo, "Move Up").push();
}
 
Example 9
Source File: WsValidation.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private void moveDownHandler(NbDialogOperator ndo, String handler) {
    JTableOperator jto = new JTableOperator(ndo);
    jto.selectCell(jto.findCellRow(handler), jto.findCellColumn(handler));
    new JButtonOperator(ndo, "Move Down").push();
}
 
Example 10
Source File: EditorWindowOperator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Pushes down arrow control button in top right corner intended to 
 * show list of opened documents and selects index-th documents in the list.
 */
public static void selectDocument(int index) {
    btDown().push();
    JTableOperator tableOper = new JTableOperator(MainWindowOperator.getDefault());
    tableOper.selectCell(index, 0);
}