[hg] main-silver: Stabilized evaluateExpression test case.

  • From: Jiri Kovalsky < >
  • To:
  • Subject: [hg] main-silver: Stabilized evaluateExpression test case.
  • Date: Thu, 03 Apr 2014 21:31:17 +0000

changeset 9b4f328ea89f in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/9b4f328ea89f
description:
        Stabilized evaluateExpression test case.

diffstat:

 
debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/AntSanityTest.java
 |  21 ++++++---
 1 files changed, 14 insertions(+), 7 deletions(-)

diffs (63 lines):

diff --git 
a/debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/AntSanityTest.java
 
b/debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/AntSanityTest.java
--- 
a/debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/AntSanityTest.java
+++ 
b/debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/AntSanityTest.java
@@ -86,6 +86,7 @@
 import org.netbeans.jemmy.operators.JEditorPaneOperator;
 import org.netbeans.jemmy.operators.JPopupMenuOperator;
 import org.netbeans.jemmy.operators.JTableOperator;
+import org.netbeans.jemmy.operators.JToggleButtonOperator;
 import org.netbeans.jemmy.operators.JTreeOperator;
 import static 
org.netbeans.modules.debugger.jpda.ui.Utilities.debuggerConsoleTitle;
 import org.openide.util.Exceptions;
@@ -114,8 +115,8 @@
         "finishDebugger",
         "applyCodeChanges",
         "takeGUISnapshot",
-        "newWatch"
-        // "evaluateExpression"
+        "newWatch",
+        "evaluateExpression"
     };
 
     /**
@@ -375,6 +376,10 @@
      * 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);
@@ -383,10 +388,9 @@
         JButton expressionEvaluatorButton = (JButton) 
buttonsPanel.getComponent(1);
         assertEquals("Evaluate code fragment (Ctrl + Enter)", 
expressionEvaluatorButton.getToolTipText());
         expressionEvaluatorButton.doClick();
-        TopComponentOperator variablesView = new TopComponentOperator(new 
ContainerOperator(MainWindowOperator.getDefault(), VIEW_CHOOSER), 
"Variables");
-        JTableOperator variablesTable = new JTableOperator(variablesView);
-        assertValue(variablesTable, 0, 0, "\"If n is: \" + n + \", then n + 
1 is: \" + (n + 1)");
+        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());
     }
     
     /**
@@ -443,11 +447,14 @@
      * @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 = 
(org.openide.nodes.Node.Property) table.getValueAt(row, column);
+        org.openide.nodes.Node.Property property = null;
         for (int i = 0; i < 10; i++) {
-            if (!property.getValue().equals("Evaluating...")) break;
+            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 {

[hg] main-silver: Stabilized evaluateExpression test case.

Jiri Kovalsky 04/03/2014

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 36 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20150626.29986a4). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close