本文整理汇总了Java中org.netbeans.jemmy.operators.JTableOperator类的典型用法代码示例。如果您正苦于以下问题:Java JTableOperator类的具体用法?Java JTableOperator怎么用?Java JTableOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JTableOperator类属于org.netbeans.jemmy.operators包,在下文中一共展示了JTableOperator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testInvokeWindow
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
public void testInvokeWindow() {
new Action("Window|Other|Application Actions",null).perform(); // NOI18N
waitAMoment();
// invoke edit dialog for first action in table
JTableOperator tableOp = new JTableOperator(getTopComponent());
tableOp.clickOnCell(1, 1); // select first row in table
// invoke edit dialog
new JButtonOperator(getTopComponent(), "Edit Action").pushNoBlock(); // NOI18N
waitAMoment();
// closing edit dialog
new JButtonOperator(new NbDialogOperator("Edit Action Properties"), "OK").pushNoBlock(); // NOI18N
}
示例2: runToCursor
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/**
* Sets line 280 breakpoint, disables it and then continues to run to cursor
* at line 283.
*/
public void runToCursor() {
EditorOperator eo = new EditorOperator("MemoryView.java");
eo.setCaretPositionToLine(280);
new ToggleBreakpointAction().perform();
JTableOperator jTableOperator = new JTableOperator(new TopComponentOperator(BREAKPOINTS_VIEW));
jTableOperator.waitCell("Line MemoryView.java:280", 1, 0);
new JPopupMenuOperator(jTableOperator.callPopupOnCell(1, 0)).pushMenu("Disable");
MainWindowOperator.StatusTextTracer stt = MainWindowOperator.getDefault().getStatusTextTracer();
stt.start();
eo.makeComponentVisible();
eo.setCaretPositionToLine(283);
new RunToCursorAction().perform();
stt.waitText("Thread main stopped at MemoryView.java:283.");
stt.stop();
assertEquals(new EditorOperator("MemoryView.java").getLineNumber(), 283);
}
示例3: newWatch
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/**
* Tests that it is possible to add watches.
*/
public void newWatch() throws IllegalAccessException, InvocationTargetException, InvalidExpressionException {
Node projectNode = new ProjectsTabOperator().getProjectRootNode(DEBUG_TEST_PROJECT_ANT);
Node testFile = new Node(new SourcePackagesNode(projectNode), "advanced|VariablesTest.java");
new OpenAction().perform(testFile);
EditorOperator eo = new EditorOperator("VariablesTest.java");
eo.setCaretPositionToLine(49);
new ToggleBreakpointAction().perform();
MainWindowOperator.StatusTextTracer stt = MainWindowOperator.getDefault().getStatusTextTracer();
stt.start();
new DebugJavaFileAction().perform(testFile);
stt.waitText("Thread main stopped at VariablesTest.java:49");
stt.stop();
new ActionNoBlock("Debug|New Watch...", null).perform();
NbDialogOperator newWatchDialog = new NbDialogOperator("New Watch");
new JEditorPaneOperator(newWatchDialog, 0).setText("n");
newWatchDialog.ok();
TopComponentOperator variablesView = new TopComponentOperator(new ContainerOperator(MainWindowOperator.getDefault(), VIEW_CHOOSER), "Variables");
JTableOperator variablesTable = new JTableOperator(variablesView);
assertEquals("n", variablesTable.getValueAt(0, 0).toString());
org.openide.nodes.Node.Property property = (org.openide.nodes.Node.Property) variablesTable.getValueAt(0, 2);
assertEquals("50", property.getValue());
JPopupMenuOperator menu = new JPopupMenuOperator(variablesTable.callPopupOnCell(0, 0));
menu.pushMenu("Delete All");
}
示例4: evaluateExpression
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/**
* Evaluates simple expression during debugging session.
*/
public void evaluateExpression() throws IllegalAccessException, InvocationTargetException, InterruptedException, InvalidExpressionException {
TopComponentOperator variablesView = new TopComponentOperator(new ContainerOperator(MainWindowOperator.getDefault(), VIEW_CHOOSER), "Variables");
JToggleButtonOperator showEvaluationResultButton = new JToggleButtonOperator(variablesView, 0);
showEvaluationResultButton.clickMouse();
TopComponentOperator evaluationResultView = new TopComponentOperator("Evaluation Result");
new Action("Debug|Evaluate Expression...", null).perform();
TopComponentOperator expressionEvaluator = new TopComponentOperator("Evaluate Expression");
JEditorPaneOperator expressionEditor = new JEditorPaneOperator(expressionEvaluator);
new EventTool().waitNoEvent(1000);
expressionEditor.setText("\"If n is: \" + n + \", then n + 1 is: \" + (n + 1)");
JPanel buttonsPanel = (JPanel) expressionEvaluator.getComponent(2);
JButton expressionEvaluatorButton = (JButton) buttonsPanel.getComponent(1);
assertEquals("Evaluate code fragment (Ctrl + Enter)", expressionEvaluatorButton.getToolTipText());
expressionEvaluatorButton.doClick();
JTableOperator variablesTable = new JTableOperator(evaluationResultView);
assertValue(variablesTable, 0, 2, "\"If n is: 50, then n + 1 is: 51\"");
assertEquals("\"If n is: \" + n + \", then n + 1 is: \" + (n + 1)", variablesTable.getValueAt(0, 0).toString().trim());
}
示例5: assertValue
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/**
* Tests that table contains required value in cell with given coordinates.
*
* @param table Table to be used for the search.
* @param row Row of the cell.
* @param column Column of the cell.
* @param value Value to be searched for.
*/
private void assertValue(JTableOperator table, int row, int column, String value) throws IllegalAccessException, InvocationTargetException, InvalidExpressionException {
org.openide.nodes.Node.Property property = null;
for (int i = 0; i < 10; i++) {
property = (org.openide.nodes.Node.Property) table.getValueAt(row, column);
if (property != null)
if (!"Evaluating...".equals(property.getValue())) break;
new EventTool().waitNoEvent(1000);
}
assertNotNull(property);
if (property.getValue() instanceof ObjectVariable) {
assertEquals(value, ((ObjectVariable) property.getValue()).getToStringValue());
} else {
assertEquals(value, property.getValue().toString());
}
}
示例6: testFieldBreakpointCreation
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/**
*
*/
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());
}
示例7: testThreadBreakpointCreation
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/**
*
*/
public void testThreadBreakpointCreation() {
//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());
}
new NewBreakpointAction().perform();
NbDialogOperator dialog = new NbDialogOperator(Utilities.newBreakpointTitle);
setBreakpointType(dialog, "Thread");
dialog.ok();
Utilities.showDebuggerView(Utilities.breakpointsViewTitle);
JTableOperator jTableOperator = new JTableOperator(new TopComponentOperator(Utilities.breakpointsViewTitle));
assertEquals("Thread breakpoint was not created.", "Thread started", jTableOperator.getValueAt(0, 0).toString());
}
示例8: testViewsHeapWalker1
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
public void testViewsHeapWalker1() {
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);
filter.clearText();
filter.enterText("example");
filter.pushKey(KeyEvent.VK_ENTER);
new EventTool().waitNoEvent(500);
assertEquals("MemoryView class is not in classes", "examples.advanced.MemoryView", Utilities.removeTags(jTableOperator.getValueAt(0,0).toString()));
assertEquals("Instances number is wrong", "1 (0%)", Utilities.removeTags(jTableOperator.getValueAt(0,2).toString()));
}
示例9: testViewsHeapWalker2
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
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);
}
示例10: testViewsSessions
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
public void testViewsSessions() {
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.sessionsViewTitle);
JTableOperator jTableOperator = new JTableOperator(new TopComponentOperator(Utilities.sessionsViewTitle));
assertEquals("examples.advanced.MemoryView", Utilities.removeTags(jTableOperator.getValueAt(0,0).toString()));
try {
org.openide.nodes.Node.Property property = (org.openide.nodes.Node.Property)jTableOperator.getValueAt(0,1);
assertEquals("Stopped", Utilities.removeTags(property.getValue().toString()));
property = (org.openide.nodes.Node.Property)jTableOperator.getValueAt(0,2);
assertEquals("org.netbeans.api.debugger.Session localhost:examples.advanced.MemoryView", Utilities.removeTags(property.getValue().toString()));
} catch (Exception ex) {
ex.printStackTrace();
assertTrue(ex.getClass()+": "+ex.getMessage(), false);
}
}
示例11: testViewsSources
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
public void testViewsSources() {
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.sourcesViewTitle);
JTableOperator jTableOperator = new JTableOperator(new TopComponentOperator(Utilities.sourcesViewTitle));
String debugAppSource = "debugTestProject" + java.io.File.separator + "src (Project debugTestProject)";
boolean jdk = false, project = false;
for (int i=0;i < jTableOperator.getRowCount();i++) {
String src = Utilities.removeTags(jTableOperator.getValueAt(i,0).toString());
if (src.endsWith("src.zip")) {
jdk=true;
} else if (src.endsWith(debugAppSource)) {
project = true;
}
}
assertTrue("JDK source root is not shown in threads view", jdk);
assertTrue("MemoryView source root is not shown in threads view", project);
}
示例12: testMethodBreakpointCreation
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/**
*
*/
public void testMethodBreakpointCreation() {
EditorOperator eo = new EditorOperator("MemoryView.java");
try {
eo.clickMouse(50,50,1);
} catch (Throwable t) {
System.err.println(t.getMessage());
}
NbDialogOperator dialog = Utilities.newBreakpoint(92);
setBreakpointType(dialog, "Method");
new JEditorPaneOperator(dialog, 0).setText("examples.advanced.MemoryView");
new JEditorPaneOperator(dialog, 1).setText("updateStatus()");
dialog.ok();
Utilities.showDebuggerView(Utilities.breakpointsViewTitle);
JTableOperator jTableOperator = new JTableOperator(new TopComponentOperator(Utilities.breakpointsViewTitle));
assertEquals("Method MemoryView.updateStatus", jTableOperator.getValueAt(0, 0).toString());
}
示例13: waitProperty
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/** Waits for property with given name in specified property sheet.
* @param propSheetOper PropertySheetOperator where to find property.
* @param name property display name
*/
private Node.Property waitProperty(final PropertySheetOperator propSheetOper, final String name) {
try {
Waiter waiter = new Waiter(new Waitable() {
public Object actionProduced(Object param) {
Node.Property property = null;
JTableOperator table = propSheetOper.tblSheet();
for(int row=0;row<table.getRowCount();row++) {
if(table.getValueAt(row, 1) instanceof Node.Property) {
property = (Node.Property)table.getValueAt(row, 1);
if(propSheetOper.getComparator().equals(property.getDisplayName(), name)) {
return property;
}
}
}
return null;
}
public String getDescription() {
return("Wait property "+name);
}
});
return (Node.Property)waiter.waitAction(null);
} catch (InterruptedException e) {
throw new JemmyException("Interrupted.", e);
}
}
示例14: unassignAlternativeShortcutToAction
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
public boolean unassignAlternativeShortcutToAction(String actionName, String shortcutStr) {
System.out.println("[TEST_DEBUG]");
System.out.println("[TEST_DEBUG] ### Unassigning alternative shortcut for " + actionName + " - Started");
String tmpStr = actionSearchByName().getText();
searchActionName(actionName);
JTableOperator tab = actionsTable();
TableModel tm = tab.getModel();
String _str;
System.out.println("[TEST_DEBUG] Found " + tab.getRowCount() + " actions matching action pattern: " + actionName);
for (int i = 0; i < tab.getRowCount(); i++) {
_str = tm.getValueAt(i, 0).toString();
System.out.println("[TEST_DEBUG] Examining action " + _str + ", which is no. " + (i + 1) + "in the table...");
if (_str.toLowerCase().startsWith(actionName.toLowerCase()) && tm.getValueAt(i, 1).toString().toLowerCase().equals(shortcutStr.toLowerCase())) {
System.out.println("[TEST_DEBUG] Action " + actionName + "was found");
JListOperator jli = clickShortcutEllipsisButton(tab, i);
jli.clickOnItem("Clear");
sleep(100);
System.out.println("[TEST_DEBUG] ### Unassigning alternative shortcut for " + actionName + " - OK");
break;
}
}
searchActionName(tmpStr);
return true;
}
示例15: makeCurrent
import org.netbeans.jemmy.operators.JTableOperator; //导入依赖的package包/类
/**
* Calls Make Current popup on given session. It throws TimeoutExpiredException
* if session with given name not found.
*
* @param sessionName display name of session
*/
public void makeCurrent(final String sessionName) {
final JTableOperator table = new JTableOperator(this);
table.waitState(new ComponentChooser() {
@Override
public boolean checkComponent(Component comp) {
for (int i = 0; i < table.getRowCount(); i++) {
String text = table.getValueAt(i, 0).toString();
if (table.getComparator().equals(text, sessionName)) {
table.clickOnCell(i, 0, 2);
return true;
}
}
return false;
}
@Override
public String getDescription() {
return "Session " + sessionName + " in table of sessions";
}
});
}