[jboss-remoting-commits] JBoss Remoting SVN: r5767 - in remoting3/trunk/jboss-remoting: src/test/java/org/jboss/remoting3/test and 1 other directory.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Sat Feb 27 19:08:16 EST 2010


Author: david.lloyd at jboss.com
Date: 2010-02-27 19:08:16 -0500 (Sat, 27 Feb 2010)
New Revision: 5767

Modified:
   remoting3/trunk/jboss-remoting/pom.xml
   remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/CloseableTestCase.java
   remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/EndpointTestCase.java
   remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/InvocationTestBase.java
   remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/LocalTestCase.java
   remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/RemoteTestCase.java
   remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/StreamsTestCase.java
Log:
Switch to testNG

Modified: remoting3/trunk/jboss-remoting/pom.xml
===================================================================
--- remoting3/trunk/jboss-remoting/pom.xml	2010-02-27 23:26:07 UTC (rev 5766)
+++ remoting3/trunk/jboss-remoting/pom.xml	2010-02-28 00:08:16 UTC (rev 5767)
@@ -65,9 +65,10 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>3.8.2</version>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>5.8</version>
+            <classifier>jdk15</classifier>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/CloseableTestCase.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/CloseableTestCase.java	2010-02-27 23:26:07 UTC (rev 5766)
+++ remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/CloseableTestCase.java	2010-02-28 00:08:16 UTC (rev 5767)
@@ -27,16 +27,20 @@
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
-import junit.framework.TestCase;
 import org.jboss.remoting3.CloseHandler;
 import org.jboss.remoting3.spi.AbstractHandleableCloseable;
 import org.jboss.xnio.IoUtils;
 import org.jboss.xnio.log.Logger;
+import org.testng.annotations.Test;
 
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
 /**
  *
  */
-public final class CloseableTestCase extends TestCase {
+ at Test
+public final class CloseableTestCase {
 
     public static final Logger log = Logger.getLogger(CloseableTestCase.class);
 

Modified: remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/EndpointTestCase.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/EndpointTestCase.java	2010-02-27 23:26:07 UTC (rev 5766)
+++ remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/EndpointTestCase.java	2010-02-28 00:08:16 UTC (rev 5767)
@@ -26,7 +26,6 @@
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
-import junit.framework.TestCase;
 import org.jboss.remoting3.Client;
 import org.jboss.remoting3.Endpoint;
 import org.jboss.remoting3.RemoteExecutionException;
@@ -36,11 +35,16 @@
 import org.jboss.xnio.IoUtils;
 import org.jboss.xnio.OptionMap;
 import org.jboss.xnio.log.Logger;
+import org.testng.annotations.Test;
 
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
 /**
  *
  */
-public final class EndpointTestCase extends TestCase {
+ at Test
+public final class EndpointTestCase {
 
     private static final Logger log = Logger.getLogger(EndpointTestCase.class);
 

Modified: remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/InvocationTestBase.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/InvocationTestBase.java	2010-02-27 23:26:07 UTC (rev 5766)
+++ remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/InvocationTestBase.java	2010-02-28 00:08:16 UTC (rev 5767)
@@ -23,7 +23,6 @@
 package org.jboss.remoting3.test;
 
 import java.io.IOException;
-import junit.framework.TestCase;
 import org.jboss.remoting3.Client;
 import org.jboss.remoting3.ClientConnector;
 import org.jboss.remoting3.ClientContext;
@@ -39,12 +38,20 @@
 import org.jboss.xnio.IoUtils;
 import org.jboss.xnio.Xnio;
 import org.jboss.xnio.log.Logger;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
 
-public abstract class InvocationTestBase extends TestCase {
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.fail;
+
+ at Test
+public abstract class InvocationTestBase {
     private static final Logger log = Logger.getLogger(InvocationTestBase.class);
 
     protected Endpoint endpoint;
 
+    @BeforeTest
     public void setUp() throws IOException {
         enter();
         try {
@@ -60,6 +67,7 @@
 
     private static void exit() {
         log.info("Exiting: %s", new Throwable().getStackTrace()[1].getMethodName());
+        log.info("-----------------------------------------");
     }
 
     protected abstract Connection getConnection() throws IOException;
@@ -226,6 +234,7 @@
         }
     }
 
+    @AfterTest
     public void tearDown() throws IOException {
         enter();
         try {

Modified: remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/LocalTestCase.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/LocalTestCase.java	2010-02-27 23:26:07 UTC (rev 5766)
+++ remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/LocalTestCase.java	2010-02-28 00:08:16 UTC (rev 5767)
@@ -26,7 +26,9 @@
 import java.net.URI;
 import org.jboss.remoting3.Connection;
 import org.jboss.xnio.OptionMap;
+import org.testng.annotations.Test;
 
+ at Test
 public final class LocalTestCase extends InvocationTestBase {
 
     protected Connection getConnection() throws IOException {

Modified: remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/RemoteTestCase.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/RemoteTestCase.java	2010-02-27 23:26:07 UTC (rev 5766)
+++ remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/RemoteTestCase.java	2010-02-28 00:08:16 UTC (rev 5767)
@@ -37,7 +37,9 @@
 import org.jboss.xnio.Xnio;
 import org.jboss.xnio.channels.BoundChannel;
 import org.jboss.xnio.channels.ConnectedStreamChannel;
+import org.testng.annotations.Test;
 
+ at Test
 public final class RemoteTestCase extends InvocationTestBase {
 
     protected Connection getConnection() throws IOException {

Modified: remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/StreamsTestCase.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/StreamsTestCase.java	2010-02-27 23:26:07 UTC (rev 5766)
+++ remoting3/trunk/jboss-remoting/src/test/java/org/jboss/remoting3/test/StreamsTestCase.java	2010-02-28 00:08:16 UTC (rev 5767)
@@ -27,15 +27,21 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.Vector;
-import junit.framework.TestCase;
 import org.jboss.remoting3.stream.ObjectSink;
 import org.jboss.remoting3.stream.ObjectSource;
 import org.jboss.remoting3.stream.Streams;
+import org.testng.annotations.Test;
 
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
 /**
  *
  */
-public final class StreamsTestCase extends TestCase {
+ at Test
+public final class StreamsTestCase {
 
     public void testCollectionObjectSink() throws Throwable {
         final ArrayList<String> strings = new ArrayList<String>();



More information about the jboss-remoting-commits mailing list