directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r754730 - in /directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv: LengthTest.java ValueTest.java
Date Sun, 15 Mar 2009 19:21:14 GMT
Author: elecharny
Date: Sun Mar 15 19:21:13 2009
New Revision: 754730

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

Modified:
    directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/LengthTest.java
    directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/ValueTest.java

Modified: directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/LengthTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/LengthTest.java?rev=754730&r1=754729&r2=754730&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/LengthTest.java
(original)
+++ directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/LengthTest.java
Sun Mar 15 19:21:13 2009
@@ -22,7 +22,9 @@
 
 import java.util.Arrays;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * This class is used to test the Length class
@@ -30,12 +32,13 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class LengthTest extends TestCase
+public class LengthTest
 {
 
     /**
      * Test the getNbBytes method
      */
+    @Test
     public void testLengthGetNbBytes()
     {
         assertEquals( "1 expected", 1, TLV.getNbBytes( 0 ) );
@@ -55,6 +58,7 @@
     /**
      * Test the getBytes method
      */
+    @Test
     public void testLengthGetBytes()
     {
         assertTrue( Arrays.equals( new byte[]

Modified: directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/ValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/ValueTest.java?rev=754730&r1=754729&r2=754730&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/ValueTest.java
(original)
+++ directory/shared/branches/shared-replication/asn1/src/test/java/org/apache/directory/shared/asn1/ber/tlv/ValueTest.java
Sun Mar 15 19:21:13 2009
@@ -24,9 +24,6 @@
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.asn1.primitives.BitString;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
@@ -34,6 +31,10 @@
 import org.apache.directory.shared.asn1.util.LongDecoder;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 
 
 /**
@@ -42,7 +43,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ValueTest extends TestCase
+public class ValueTest
 {
 
     /**
@@ -531,13 +532,13 @@
     {
         byte[] encoded = Value.getBytes( 128 );
 
-        Assert.assertEquals( 0x00, encoded[0] );
-        Assert.assertEquals( ( byte ) 0x80, encoded[1] );
+        assertEquals( 0x00, encoded[0] );
+        assertEquals( ( byte ) 0x80, encoded[1] );
 
         encoded = Value.getBytes( -27066 );
 
-        Assert.assertEquals( ( byte ) 0x96, encoded[0] );
-        Assert.assertEquals( 0x46, encoded[1] );
+        assertEquals( ( byte ) 0x96, encoded[0] );
+        assertEquals( 0x46, encoded[1] );
 
     }
 
@@ -548,9 +549,9 @@
 
         byte[] encoded = Value.getBytes( 32787 );
 
-        Assert.assertEquals( 0x00, encoded[0] );
-        Assert.assertEquals( ( byte ) 0x80, encoded[1] );
-        Assert.assertEquals( ( byte ) 0x13, encoded[2] );
+        assertEquals( 0x00, encoded[0] );
+        assertEquals( ( byte ) 0x80, encoded[1] );
+        assertEquals( ( byte ) 0x13, encoded[2] );
     }
 
 
@@ -597,7 +598,7 @@
 
             int value = new BigInteger( encoded ).intValue();
 
-            Assert.assertEquals( i, value );
+            assertEquals( i, value );
         }
     }
 
@@ -647,7 +648,7 @@
 
             int value = IntegerDecoder.parse( new Value( encoded ) );
 
-            Assert.assertEquals( i, value );
+            assertEquals( i, value );
         }
     }
     
@@ -739,7 +740,7 @@
 
             long value = LongDecoder.parse( new Value( encoded ) );
 
-            Assert.assertEquals( i, value );
+            assertEquals( i, value );
         }
     }
     



Mime
View raw message