harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r499289 - /harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java
Date Wed, 24 Jan 2007 07:11:37 GMT
Author: smishura
Date: Tue Jan 23 23:11:36 2007
New Revision: 499289

URL: http://svn.apache.org/viewvc?view=rev&rev=499289
Log:
Fix JUnit style

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java?view=diff&rev=499289&r1=499288&r2=499289
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java
Tue Jan 23 23:11:36 2007
@@ -69,36 +69,35 @@
                 .engineDigest(b, 1, 3));
     }
 
-	public void testEngineGetDigestLength() {
+    /**
+     * java.security.MessageDigestSpi#engineGetDigestLength()
+     */
+	public void test_engineGetDigestLength() {
 		MyMessageDigest md = new MyMessageDigest();
-		if (md.engineGetDigestLength() != 0) {
-			fail("engineGetDigestLength failed");
-		}
+        assertEquals(0, md.engineGetDigestLength());
 	}
 
-	/*
-	 * Class under test for void engineUpdate(ByteBuffer)
-	 */
-	public void testEngineUpdateByteBuffer() {
+    /**
+     * java.security.MessageDigestSpi#engineUpdate(ByteBuffer)
+     */
+    public void test_engineUpdateLjava_nio_ByteBuffer() {
 		MyMessageDigest md = new MyMessageDigest();
 		byte[] b = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
 
 		ByteBuffer buf = ByteBuffer.wrap(b,0,b.length);
 		buf.get(b);
-		int l = buf.limit();
+        int limit = buf.limit();
 		md.engineUpdate(buf);
-		if (buf.limit() !=l || buf.position() != l) {
-			fail("Case 1. Incorrect position");
-		}
+        assertEquals(limit,buf.limit());
+        assertEquals(limit,buf.position());
 		
 		buf = ByteBuffer.wrap(b,0,b.length);
 		buf.get();
 		buf.get();
 		buf.get();
 		md.engineUpdate(buf);
-		if (buf.limit() !=l || buf.position() != l) {
-			fail("Case 2. Incorrect position");
-		}
+        assertEquals(limit,buf.limit());
+        assertEquals(limit,buf.position());
 	}
 
     /**



Mime
View raw message