Java Code Examples for org.netbeans.jemmy.operators.JTableOperator#getValueAt()
The following examples show how to use
org.netbeans.jemmy.operators.JTableOperator#getValueAt() .
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 | 6 votes |
/** * 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"); }
Example 2
Source File: AntSanityTest.java From netbeans with Apache License 2.0 | 6 votes |
/** * 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()); } }
Example 3
Source File: ViewsTest.java From netbeans with Apache License 2.0 | 6 votes |
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); } }
Example 4
Source File: Property.java From netbeans with Apache License 2.0 | 6 votes |
/** 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); } }
Example 5
Source File: LocalVariablesTest.java From netbeans with Apache License 2.0 | 5 votes |
/** * */ public void testLocalVariablesValues() throws Throwable { EditorOperator eo = new EditorOperator("MemoryView.java"); //NOI18N new EventTool().waitNoEvent(500); Utilities.toggleBreakpoint(eo, 104); new EventTool().waitNoEvent(500); Utilities.startDebugger(); Utilities.checkConsoleLastLineForText("Thread main stopped at MemoryView.java:104."); expandNodes(); Utilities.showDebuggerView(Utilities.variablesViewTitle); JTableOperator jTableOperator = new JTableOperator(new TopComponentOperator(Utilities.variablesViewTitle)); try { org.openide.nodes.Node.Property property; property = (org.openide.nodes.Node.Property)jTableOperator.getValueAt(25, 2); long free = Long.parseLong(property.getValue().toString()); property = (org.openide.nodes.Node.Property)jTableOperator.getValueAt(26, 2); long total = Long.parseLong(property.getValue().toString()); property = (org.openide.nodes.Node.Property)jTableOperator.getValueAt(27, 2); long taken = Long.parseLong(property.getValue().toString()); assertTrue("Local varaibles values does not seem to be correct (total != free + taken) - "+total+" != "+free+" + "+taken, (total == free + taken)); } catch (java.lang.IllegalAccessException e1) { assertTrue(e1.getMessage(), false); } catch (java.lang.reflect.InvocationTargetException e2) { assertTrue(e2.getMessage(), false); } }
Example 6
Source File: CodeTemplatesOperator.java From netbeans with Apache License 2.0 | 5 votes |
public List<String[]> dumpTemplatesTable() { List<String[]> res = new LinkedList<>(); JTableOperator tableOperator = getTemplatesTable(); for (int i = 0; i < tableOperator.getRowCount(); i++) { String[] items = new String[3]; for (int j = 0; j < 3; j++) { items[j] = (String) tableOperator.getValueAt(i, j); } res.add(items); } return res; }
Example 7
Source File: Property.java From netbeans with Apache License 2.0 | 5 votes |
/** Waits for index-th property in specified property sheet. * @param propSheetOper PropertySheetOperator where to find property. * @param index index (row number) of property inside property sheet * (starts at 0). If there are categories shown in property sheet, * rows occupied by their names must by added to index. */ private Node.Property waitProperty(final PropertySheetOperator propSheetOper, final int index) { try { Waiter waiter = new Waiter(new Waitable() { public Object actionProduced(Object param) { JTableOperator table = propSheetOper.tblSheet(); if(table.getRowCount() <= index) { // If table is empty or index out of bounds, // it returns null to wait until table is populated by values return null; } Object property = table.getValueAt(index, 1); if(property instanceof Node.Property) { return (Node.Property)property; } else { throw new JemmyException("On row "+index+" in table there is no property"); } } public String getDescription() { return("Wait property on row "+index+" in property sheet."); } }); //waiter.setOutput(TestOut.getNullOutput()); return (Node.Property)waiter.waitAction(null); } catch (InterruptedException e) { throw new JemmyException("Interrupted.", e); } }
Example 8
Source File: Property.java From netbeans with Apache License 2.0 | 5 votes |
public int getRow() { JTableOperator table = this.propertySheetOper.tblSheet(); for(int row=0;row<table.getRowCount();row++) { if(table.getValueAt(row, 1) instanceof Node.Property) { if(this.property == (Node.Property)table.getValueAt(row, 1)) { return row; } } } throw new JemmyException("Cannot determine row number of property \""+getName()+"\""); }
Example 9
Source File: CodeTemplatesOperator.java From netbeans with Apache License 2.0 | 4 votes |
public String getSelectedTemplate() { JTableOperator tableOperator = getTemplatesTable(); int selectedRow = tableOperator.getSelectedRow(); if(selectedRow<0) return null; return (String) tableOperator.getValueAt(selectedRow, 0); }