directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r754791 - in /directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful: DecoderStackTest.java examples/HexDecoderTest.java examples/HexEncoderTest.java
Date Sun, 15 Mar 2009 23:45:48 GMT
Author: elecharny
Date: Sun Mar 15 23:45:47 2009
New Revision: 754791

URL: http://svn.apache.org/viewvc?rev=754791&view=rev
Log:
Switched to JUNIT 4.4

Modified:
    directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/DecoderStackTest.java
    directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoderTest.java
    directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexEncoderTest.java

Modified: directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/DecoderStackTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/DecoderStackTest.java?rev=754791&r1=754790&r2=754791&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/DecoderStackTest.java
(original)
+++ directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/DecoderStackTest.java
Sun Mar 15 23:45:47 2009
@@ -20,10 +20,15 @@
 package org.apache.directory.shared.asn1.codec.stateful;
 
 
-import junit.framework.TestCase;
-
 import org.apache.directory.shared.asn1.codec.DecoderException;
-
+import org.junit.Test;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertNotSame;
 
 /**
  * Tests the DecoderStack.
@@ -31,22 +36,12 @@
  * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
  * @version $Rev$
  */
-public class DecoderStackTest extends TestCase
+public class DecoderStackTest
 {
     /**
-     * Constructor for DecoderStackTest.
-     * 
-     * @param arg0
-     */
-    public DecoderStackTest(String arg0)
-    {
-        super( arg0 );
-    }
-
-
-    /**
      * Tests the push method.
      */
+    @Test
     public void testPush()
     {
         DecoderStack stack = new DecoderStack();
@@ -61,6 +56,7 @@
     /**
      * Tests the pop method.
      */
+    @Test
     public void testPop()
     {
         DecoderStack stack = new DecoderStack();
@@ -81,6 +77,7 @@
     }
 
 
+    @Test
     public void testDecode() throws Exception
     {
         DecoderStack stack = new DecoderStack();
@@ -169,6 +166,7 @@
     }
 
 
+    @Test
     public void testFailure() throws Exception
     {
         DecoderStack stack = new DecoderStack();

Modified: directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoderTest.java?rev=754791&r1=754790&r2=754791&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoderTest.java
(original)
+++ directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoderTest.java
Sun Mar 15 23:45:47 2009
@@ -23,12 +23,14 @@
 import java.nio.ByteBuffer;
 import java.util.Random;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.binary.Hex;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.StatefulDecoder;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -37,7 +39,7 @@
  * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
  *         $Rev$
  */
-public class HexDecoderTest extends TestCase implements DecoderCallback
+public class HexDecoderTest implements DecoderCallback
 {
     private HexDecoder decoder = null;
 
@@ -48,17 +50,17 @@
     byte[] original = null;
 
 
-    protected void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
-        super.setUp();
         decoder = new HexDecoder();
         decoder.setCallback( this );
     }
 
 
-    protected void tearDown() throws Exception
+    @After
+    public void tearDown() throws Exception
     {
-        super.tearDown();
         decoder = null;
         encoded = null;
         decoded = null;
@@ -99,6 +101,7 @@
     }
 
 
+    @Test
     public void testDecode0() throws DecoderException
     {
         generateData( 0 );
@@ -113,6 +116,7 @@
     }
 
 
+    @Test
     public void testDecode2() throws DecoderException
     {
         generateData( 2 );
@@ -121,6 +125,7 @@
     }
 
 
+    @Test
     public void testDecode26() throws DecoderException
     {
         generateData( 26 );
@@ -129,6 +134,7 @@
     }
 
 
+    @Test
     public void testDecode254() throws DecoderException
     {
         generateData( 254 );
@@ -137,6 +143,7 @@
     }
 
 
+    @Test
     public void testDecode256() throws DecoderException
     {
         generateData( 256 );
@@ -145,6 +152,7 @@
     }
 
 
+    @Test
     public void testDecode258() throws DecoderException
     {
         generateData( 258 );
@@ -153,6 +161,7 @@
     }
 
 
+    @Test
     public void testDecode2048() throws DecoderException
     {
         generateData( 2048 );
@@ -161,6 +170,7 @@
     }
 
 
+    @Test
     public void testPartialDecode2() throws DecoderException
     {
         generateData( 2 );
@@ -182,6 +192,7 @@
     }
 
 
+    @Test
     public void testPartialDecode30() throws DecoderException
     {
         generateData( 30 );
@@ -195,6 +206,7 @@
     }
 
 
+    @Test
     public void testPartialDecode300() throws DecoderException
     {
         generateData( 300 );

Modified: directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexEncoderTest.java?rev=754791&r1=754790&r2=754791&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexEncoderTest.java
(original)
+++ directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexEncoderTest.java
Sun Mar 15 23:45:47 2009
@@ -23,12 +23,14 @@
 import java.nio.ByteBuffer;
 import java.util.Random;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.asn1.codec.binary.Hex;
 import org.apache.directory.shared.asn1.codec.stateful.EncoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -37,7 +39,7 @@
  * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
  *         $Rev$
  */
-public class HexEncoderTest extends TestCase implements EncoderCallback
+public class HexEncoderTest implements EncoderCallback
 {
     HexEncoder encoder = null;
 
@@ -46,17 +48,17 @@
     byte[] data = null;
 
 
-    protected void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
-        super.setUp();
         encoder = new HexEncoder();
         encoder.setCallback( this );
     }
 
 
-    protected void tearDown() throws Exception
+    @After
+    public void tearDown() throws Exception
     {
-        super.tearDown();
         data = null;
         encoder = null;
         encoded = null;
@@ -90,6 +92,7 @@
     }
 
 
+    @Test
     public void testEncode0() throws EncoderException
     {
         generateData( 0 );
@@ -102,6 +105,7 @@
     }
 
 
+    @Test
     public void testEncode1() throws EncoderException
     {
         generateData( 1 );
@@ -110,6 +114,7 @@
     }
 
 
+    @Test
     public void testEncode25() throws EncoderException
     {
         generateData( 25 );
@@ -118,6 +123,7 @@
     }
 
 
+    @Test
     public void testEncode63() throws EncoderException
     {
         generateData( 63 );
@@ -126,6 +132,7 @@
     }
 
 
+    @Test
     public void testEncode64() throws EncoderException
     {
         generateData( 64 );
@@ -134,6 +141,7 @@
     }
 
 
+    @Test
     public void testEncode65() throws EncoderException
     {
         generateData( 65 );
@@ -142,6 +150,7 @@
     }
 
 
+    @Test
     public void testEncode66() throws EncoderException
     {
         generateData( 66 );
@@ -150,6 +159,7 @@
     }
 
 
+    @Test
     public void testEncode512() throws EncoderException
     {
         generateData( 512 );



Mime
View raw message