[hg] main-silver: Enforcing order to tests to get predictable re...

  • From: Jan Lahoda < >
  • To: ,
  • Subject: [hg] main-silver: Enforcing order to tests to get predictable re...
  • Date: Fri, 29 Mar 2013 15:44:09 -0700

changeset fafedcdcd8d9 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/fafedcdcd8d9
description:
        Enforcing order to tests to get predictable results (and reverting 
expected test outcomes in testRanges to the original values.

diffstat:

 
editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlightingTest.java
 |  21 ++++++++-
 1 files changed, 18 insertions(+), 3 deletions(-)

diffs (55 lines):

diff --git 
a/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlightingTest.java
 
b/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlightingTest.java
--- 
a/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlightingTest.java
+++ 
b/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlightingTest.java
@@ -47,17 +47,18 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import javax.swing.text.AttributeSet;
 import javax.swing.text.BadLocationException;
 import javax.swing.text.DefaultStyledDocument;
 import javax.swing.text.Document;
 import javax.swing.text.SimpleAttributeSet;
+import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 import org.netbeans.api.lexer.Language;
 import org.netbeans.api.lexer.TokenHierarchy;
 import org.netbeans.api.lexer.TokenSequence;
 import org.netbeans.junit.Filter;
 import org.netbeans.junit.NbTestCase;
+import org.netbeans.junit.NbTestSuite;
 import org.netbeans.lib.lexer.lang.TestPlainTokenId;
 import org.netbeans.lib.lexer.lang.TestTokenId;
 import org.netbeans.spi.editor.highlighting.HighlightsChangeEvent;
@@ -95,6 +96,21 @@
         setFilter(filter);
     }
 
+    public static TestSuite suite() {
+        TestSuite suite = new NbTestSuite();
+        
+        suite.addTest(new SyntaxHighlightingTest("testSimple"));
+        suite.addTest(new SyntaxHighlightingTest("testEmbedded"));
+        suite.addTest(new SyntaxHighlightingTest("testComplex"));
+        suite.addTest(new 
SyntaxHighlightingTest("testNoPrologEpilogEmbedding"));
+        suite.addTest(new 
SyntaxHighlightingTest("testConcurrentModifications"));
+        suite.addTest(new SyntaxHighlightingTest("testEvents"));
+        suite.addTest(new SyntaxHighlightingTest("testRanges"));
+        suite.addTest(new SyntaxHighlightingTest("testEmbeddedRanges"));
+        
+        return suite;
+    }
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -174,8 +190,7 @@
         assertFalse("There should only be one highlight", hs.moveNext());
 
         hs = layer.getHighlights(5, 11);
-        // Embeddings in "bbb" -> split to single chars by 
SimpleLanguageProvider.findLanguageEmbedding()
-        checkHighlights("Wrong highlights", hs, new Integer [] { 5, 6, 6, 7, 
7, 8, 8, 9, 9, 11 });
+        checkHighlights("Wrong highlights", hs, new Integer [] { 5, 6, 6, 9, 
9, 11 });
     }
 
     public void testEmbeddedRanges() {

[hg] main-silver: Enforcing order to tests to get predictable re...

Jan Lahoda 03/29/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 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close