[hg] main-silver: Fixing search tests

  • From: Jiri Prox < >
  • To:
  • Subject: [hg] main-silver: Fixing search tests
  • Date: Mon, 21 Jan 2013 07:40:43 -0800

changeset fb33cea44f72 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/fb33cea44f72
description:
        Fixing search tests

diffstat:

 
editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceAll.pass
               |  42 +++++++++-
 
editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceInSelectionOnly.pass
   |  42 +++++++++-
 
editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceMatchCase.pass
         |  42 +++++++++-
 
editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceSelectionRepeated.pass
 |  44 +++++++++-
 
editor/test/qa-functional/src/org/netbeans/test/editor/search/IncrementalSearchTest.java
                                 |  33 +++---
 
editor/test/qa-functional/src/org/netbeans/test/editor/search/ReplaceTest.java
                                           |   4 +-
 6 files changed, 180 insertions(+), 27 deletions(-)

diffs (310 lines):

diff --git 
a/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceAll.pass
 
b/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceAll.pass
--- 
a/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceAll.pass
+++ 
b/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceAll.pass
@@ -1,7 +1,45 @@
 /*
- * testReplaceAll.java
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Created on January 28, 2005, 2:02 PM
+ * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
  */
 
 package org.netbeans.test.editor.search.ReplaceTest;
diff --git 
a/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceInSelectionOnly.pass
 
b/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceInSelectionOnly.pass
--- 
a/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceInSelectionOnly.pass
+++ 
b/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceInSelectionOnly.pass
@@ -1,7 +1,45 @@
 /*
- * testReplaceInSelectionOnly.java
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Created on January 28, 2005, 2:32 PM
+ * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
  */
 
 package org.netbeans.test.editor.search.ReplaceTest;
diff --git 
a/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceMatchCase.pass
 
b/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceMatchCase.pass
--- 
a/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceMatchCase.pass
+++ 
b/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceMatchCase.pass
@@ -1,7 +1,45 @@
 /*
- * testReplaceMatchCase.java
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Created on January 28, 2005, 1:23 PM
+ * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
  */
 
 package org.netbeans.test.editor.search.ReplaceTest;
diff --git 
a/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceSelectionRepeated.pass
 
b/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceSelectionRepeated.pass
--- 
a/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceSelectionRepeated.pass
+++ 
b/editor/test/qa-functional/data/goldenfiles/org/netbeans/test/editor/search/ReplaceTest/testReplaceSelectionRepeated.pass
@@ -1,7 +1,45 @@
 /*
- * testReplaceSelectionRepeated2.java
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Created on January 26, 2005, 11:38 AM
+ * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
  */
 
 package org.netbeans.test.editor.search.ReplaceTest;
@@ -13,7 +51,7 @@
 public class testReplaceSelectionRepeated2 {
     
     /** Creates a new instance of testReplaceSelectionRepeated2 */
-    public testReplaceSelectionRepeated() {
+    public testReplaceSelectionRepeated2() {
     }
     
 }
diff --git 
a/editor/test/qa-functional/src/org/netbeans/test/editor/search/IncrementalSearchTest.java
 
b/editor/test/qa-functional/src/org/netbeans/test/editor/search/IncrementalSearchTest.java
--- 
a/editor/test/qa-functional/src/org/netbeans/test/editor/search/IncrementalSearchTest.java
+++ 
b/editor/test/qa-functional/src/org/netbeans/test/editor/search/IncrementalSearchTest.java
@@ -65,34 +65,34 @@
         openDefaultProject();
         openDefaultSampleFile();
         EditorOperator editor = new EditorOperator("testSearchForward.java");
-        editor.setCaretPosition(4, 1);
+        editor.setCaretPosition(47, 1);
         SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
         JTextComponentOperator t = barOperator.findCombo();        
         t.clearText();
         new EventTool().waitNoEvent(100);
         t.typeText("p");
         t.pushKey(KeyEvent.VK_ENTER);
-        assertSelection(editor, 114, 115);
-        editor.setCaretPosition(4, 1);
+        assertSelection(editor, 2373, 2374);
+        editor.setCaretPosition(47, 1);
         t.pushKey(KeyEvent.VK_F, KeyEvent.CTRL_DOWN_MASK);
         t.clearText();
         new EventTool().waitNoEvent(100);
         t.typeText("pu");
         t.pushKey(KeyEvent.VK_ENTER);
-        assertSelection(editor, 130, 132);        
-        editor.setCaretPosition(4, 1);
+        assertSelection(editor, 2389, 2391);        
+        editor.setCaretPosition(47, 1);
         t.pushKey(KeyEvent.VK_F, KeyEvent.CTRL_DOWN_MASK);
         t.clearText();
         new EventTool().waitNoEvent(100);
         t.typeText("pub");
         t.pushKey(KeyEvent.VK_ENTER);
-        assertSelection(editor, 143, 146);        
-        t.pushKey(KeyEvent.VK_N, KeyEvent.ALT_DOWN_MASK);        
-        assertSelection(editor, 187, 190);
-        t.pushKey(KeyEvent.VK_N, KeyEvent.ALT_DOWN_MASK);
-        assertSelection(editor, 64, 67);
+        assertSelection(editor, 2402, 2405);        
+        barOperator.nextButton().push();        
+        assertSelection(editor, 2446, 2449);
+        barOperator.nextButton().push();        
+        assertSelection(editor, 368, 371);
         MainWindowOperator mwo = MainWindowOperator.getDefault();
-        assertEquals("'pub' found at 3:1; End of the document reached. 
Continuing search from beginning.",mwo.getStatusText());
+        assertEquals("'pub' found at 10:12; End of the document reached. 
Continuing search from beginning.",mwo.getStatusText());
         t.pushKey(KeyEvent.VK_F, KeyEvent.CTRL_DOWN_MASK);
         t.pushKey(KeyEvent.VK_ESCAPE);
         new EventTool().waitNoEvent(100);
@@ -104,20 +104,21 @@
         openDefaultProject();
         openFile("Source 
Packages|org.netbeans.test.editor.search.IncrementalSearchTest", 
"testSearchForward");
         EditorOperator editor = new EditorOperator("testSearchForward");
-        editor.setCaretPosition(11, 1);
+        editor.setCaretPosition(54, 1);
         SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
         JTextComponentOperator t = barOperator.findCombo();
         t.clearText();
         new EventTool().waitNoEvent(100);
         t.typeText("pub");
         t.pushKey(KeyEvent.VK_ENTER,KeyEvent.SHIFT_DOWN_MASK);
-        assertSelection(editor, 143, 146);
+        assertSelection(editor, 2402, 2405);
         t.pushKey(KeyEvent.VK_ENTER,KeyEvent.SHIFT_DOWN_MASK);
-        assertSelection(editor, 64, 67);
+        assertSelection(editor, 2323, 2326);
         t.pushKey(KeyEvent.VK_ENTER,KeyEvent.SHIFT_DOWN_MASK);
-        assertSelection(editor, 187, 190);        
+        assertSelection(editor, 368, 371);        
+        t.pushKey(KeyEvent.VK_ENTER,KeyEvent.SHIFT_DOWN_MASK);
         MainWindowOperator mwo = MainWindowOperator.getDefault();
-        assertEquals("'pub' found at 12:5; Beginning of the document 
reached. Continuing search from end.",mwo.getStatusText());
+        assertEquals("'pub' found at 55:5; Beginning of the document 
reached. Continuing search from end.",mwo.getStatusText());
         t.pushKey(KeyEvent.VK_ESCAPE);
         new EventTool().waitNoEvent(100);
         assertFalse("ToolBar not closed",barOperator.isVisible());
diff --git 
a/editor/test/qa-functional/src/org/netbeans/test/editor/search/ReplaceTest.java
 
b/editor/test/qa-functional/src/org/netbeans/test/editor/search/ReplaceTest.java
--- 
a/editor/test/qa-functional/src/org/netbeans/test/editor/search/ReplaceTest.java
+++ 
b/editor/test/qa-functional/src/org/netbeans/test/editor/search/ReplaceTest.java
@@ -132,7 +132,7 @@
             new EventTool().waitNoEvent(REPLACE_TIMEOUT);            
             bar.replaceButton().doClick();            
             new EventTool().waitNoEvent(REPLACE_TIMEOUT);            
-            editor.setCaretPosition(12,1);                        
+            editor.setCaretPosition(52,1);                        
             bar.getSearchBar().findCombo().clearText();
             
bar.getSearchBar().findCombo().typeText("testReplaceSelectionRepeated");      
      
             bar.replaceCombo().clearText();
@@ -285,7 +285,7 @@
         openDefaultSampleFile();
         try {
             EditorOperator editor = getDefaultSampleEditorOperator();
-            editor.select(20, 24);
+            editor.select(58, 62);
             ReplaceBarOperator bar = ReplaceBarOperator.invoke(editor);
             bar.uncheckAll();
             final SearchBarOperator searchBar = bar.getSearchBar();

[hg] main-silver: Fixing search tests

Jiri Prox 01/21/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close