ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1143459 - in /webservices/commons/trunk/modules/neethi: ./ src/test/java/org/apache/neethi/
Date Wed, 06 Jul 2011 15:16:35 GMT
Author: dkulp
Date: Wed Jul  6 15:16:33 2011
New Revision: 1143459

URL: http://svn.apache.org/viewvc?rev=1143459&view=rev
Log:
Change  to using JUnit 4

Modified:
    webservices/commons/trunk/modules/neethi/pom.xml
    webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/BasicTestCases.java
    webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/IntersectTest.java
    webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/MergeTest.java
    webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/Normalize2Test.java
    webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/NormalizeTest.java
    webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/PolicyTestCase.java

Modified: webservices/commons/trunk/modules/neethi/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/pom.xml?rev=1143459&r1=1143458&r2=1143459&view=diff
==============================================================================
--- webservices/commons/trunk/modules/neethi/pom.xml (original)
+++ webservices/commons/trunk/modules/neethi/pom.xml Wed Jul  6 15:16:33 2011
@@ -272,7 +272,7 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>3.8.2</version>
+            <version>4.8.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/BasicTestCases.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/BasicTestCases.java?rev=1143459&r1=1143458&r2=1143459&view=diff
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/BasicTestCases.java
(original)
+++ webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/BasicTestCases.java
Wed Jul  6 15:16:33 2011
@@ -35,17 +35,19 @@ import org.w3c.dom.Element;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
-import junit.framework.TestCase;
-
 import org.apache.neethi.builders.PrimitiveAssertion;
 import org.apache.neethi.builders.xml.XMLPrimitiveAssertionBuilder;
 
+import org.junit.Assert;
+import org.junit.Test;
+
 /**
  * 
  */
-public class BasicTestCases extends TestCase {
+public class BasicTestCases extends Assert {
     PolicyBuilder pb = new PolicyBuilder();
     
+    @Test
     public void testPrimitiveBuilder() throws Exception {
         String text = "<ns1:MaximumRetransmissionCount FooAtt=\"blah\" xmlns:ns1=\"http://foo\">10"
             + "</ns1:MaximumRetransmissionCount>";
@@ -67,6 +69,7 @@ public class BasicTestCases extends Test
         assertEquals("blah", el.getAttribute("FooAtt"));
         assertEquals("10", el.getTextContent());
     }
+    @Test
     public void testPolicyChildren() throws Exception {
         String text = "<sp:Wss11 xmlns:sp=\"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy\">"
                       + "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">"
@@ -97,6 +100,7 @@ public class BasicTestCases extends Test
     }
 
     
+    @Test
     public void testMultiChildren() throws Exception {
         String text = "<sp:SignedParts xmlns:sp=\"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy\">"
             + "<sp:Body />"

Modified: webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/IntersectTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/IntersectTest.java?rev=1143459&r1=1143458&r2=1143459&view=diff
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/IntersectTest.java
(original)
+++ webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/IntersectTest.java
Wed Jul  6 15:16:33 2011
@@ -23,35 +23,41 @@ import java.io.File;
 
 import org.apache.neethi.util.PolicyComparator;
 
+import org.junit.Test;
+
 public class IntersectTest extends PolicyTestCase {
     int failCount;
     
     public IntersectTest() {
-        super("IntersectTest");
     }
+    
+    @Test
     public void testOM() throws Exception {
         doTest("samples2", "intersected", 3);
     }
+    @Test
     public void testDOM() throws Exception {
         doTest("samples2", "intersected", 1);
     }
+    @Test
     public void testStax() throws Exception {
         doTest("samples2", "intersected", 2);
     }
+    @Test
     public void testStream() throws Exception {
         doTest("samples2", "intersected", 3);
     }
     
+    @Test
     public void testW3CDOM() throws Exception {
         doTest("w3tests", "w3tests" + File.separator + "Intersected", 1);
     }
 
-    /*
+    @Test
     public void testMyTest() throws Exception {
         runTest("w3tests", "w3tests" + File.separator + "Intersected",
                 "23", "26", "Policy23-26-lax.xml", false, 1);
     }
-    */
 
     public void doTest(String base, String intersectedDir, int type) throws Exception {
 

Modified: webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/MergeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/MergeTest.java?rev=1143459&r1=1143458&r2=1143459&view=diff
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/MergeTest.java
(original)
+++ webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/MergeTest.java
Wed Jul  6 15:16:33 2011
@@ -23,25 +23,32 @@ import java.io.File;
 
 import org.apache.neethi.util.PolicyComparator;
 
+import org.junit.Test;
+
 public class MergeTest extends PolicyTestCase {
     public MergeTest() {
-        super("MergeTest");
     }
+    @Test
     public void testOM() throws Exception {
         doTest("samples2", "merged", 3);
     }
+    @Test
     public void testDOM() throws Exception {
         doTest("samples2", "merged", 1);
     }
+    @Test
     public void testStax() throws Exception {
         doTest("samples2", "merged", 2);
     }
+    @Test
     public void testStream() throws Exception {
         doTest("samples2", "merged", 3);
     }
+    @Test
     public void testW3CDOM() throws Exception {
         doTest("w3tests", "w3tests" + File.separator + "Merged", 1);
     }
+    @Test
     public void testW3COM() throws Exception {
         doTest("w3tests", "w3tests" + File.separator + "Merged", 3);
     }

Modified: webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/Normalize2Test.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/Normalize2Test.java?rev=1143459&r1=1143458&r2=1143459&view=diff
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/Normalize2Test.java
(original)
+++ webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/Normalize2Test.java
Wed Jul  6 15:16:33 2011
@@ -23,20 +23,25 @@ import java.io.File;
 
 import org.apache.neethi.util.PolicyComparator;
 
+import org.junit.Test;
+
 public class Normalize2Test extends PolicyTestCase {
 
     public Normalize2Test() {
-        super("Normalize2Test");
     }
+    @Test
     public void testOM() throws Exception {
         doTest(3);
     }
+    @Test
     public void testDOM() throws Exception {
         doTest(1);
     }
+    @Test
     public void testStax() throws Exception {
         doTest(2);
     }
+    @Test
     public void testStream() throws Exception {
         doTest(3);
     }

Modified: webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/NormalizeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/NormalizeTest.java?rev=1143459&r1=1143458&r2=1143459&view=diff
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/NormalizeTest.java
(original)
+++ webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/NormalizeTest.java
Wed Jul  6 15:16:33 2011
@@ -29,31 +29,38 @@ import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.neethi.util.PolicyComparator;
 
+import org.junit.Test;
+
 public class NormalizeTest extends PolicyTestCase {
     
     PolicyBuilder mgr;
 
     public NormalizeTest() {
-        super("NormalizeTest");
     }
 
+    @Test
     public void testOM() throws Exception {
         doTest("samples", "normalized", 3);
     }
+    @Test
     public void testDOM() throws Exception {
         doTest("samples", "normalized", 1);
     }
+    @Test
     public void testStax() throws Exception {
         doTest("samples", "normalized", 2);
     }
+    @Test
     public void testStream() throws Exception {
         doTest("samples", "normalized", 3);
     }
+    @Test
     public void testDOMW3C() throws Exception {
         registry.register("#Policy1",
                           getPolicy("w3tests" + File.separator + "Common/Protection.xml",
1));
         doTest("w3tests", "w3tests" + File.separator + "Normalized", 1);
     }
+    @Test
     public void testOMW3C() throws Exception {
         registry.register("#Policy1", getPolicy("w3tests" + File.separator + "Common/Protection.xml",
1));
         doTest("w3tests", "w3tests" + File.separator + "Normalized", 3);

Modified: webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/PolicyTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/PolicyTestCase.java?rev=1143459&r1=1143458&r2=1143459&view=diff
==============================================================================
--- webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/PolicyTestCase.java
(original)
+++ webservices/commons/trunk/modules/neethi/src/test/java/org/apache/neethi/PolicyTestCase.java
Wed Jul  6 15:16:33 2011
@@ -37,22 +37,20 @@ import org.w3c.dom.Element;
 
 import org.xml.sax.SAXException;
 
-import junit.framework.TestCase;
-
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMXMLBuilderFactory;
 
+import org.junit.Assert;
 
-public abstract class PolicyTestCase extends TestCase {
+public abstract class PolicyTestCase extends Assert {
     
     protected String baseDir = System.getProperty("basedir");
     protected String testResourceDir = "src" + File.separator + "test" + File.separator +
"test-resources";
     protected PolicyBuilder policyEngine = new PolicyBuilder();
     protected PolicyRegistry registry = new PolicyRegistryImpl();
     
-    public PolicyTestCase(String name) {
-        super(name);
+    public PolicyTestCase() {
         if (baseDir == null) {
             baseDir = (String) new File(".").getAbsolutePath();
         }



Mime
View raw message