harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r497366 - /harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Signature_Impl1Test.java
Date Thu, 18 Jan 2007 09:20:24 GMT
Author: smishura
Date: Thu Jan 18 01:20:23 2007
New Revision: 497366

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

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Signature_Impl1Test.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Signature_Impl1Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Signature_Impl1Test.java?view=diff&rev=497366&r1=497365&r2=497366
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Signature_Impl1Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Signature_Impl1Test.java
Thu Jan 18 01:20:23 2007
@@ -35,7 +35,7 @@
 	/*
 	 * Class under test for int sign(byte[], int, int)
 	 */
-	public void testSignbyteArrayintint() {
+	public void testSignbyteArrayintint() throws Exception {
 		MySignature1 s = new MySignature1("ABC");
 		byte[] b = new byte[8];
 		try {
@@ -44,11 +44,7 @@
 		} catch (SignatureException e) {		
 		}
 		
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
+        s.initVerify(new MyPublicKey());
 		
 		try {
 			s.sign(b, 0, 5);
@@ -56,23 +52,10 @@
 		} catch (SignatureException e) {		
 		}
 		
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.sign(b, 0, 5);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.SIGN) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineSign) {
-			fail("sign() failed");
-		}
+        s.initSign(new MyPrivateKey());
+        s.sign(b, 0, 5);
+        assertEquals("state", Signature.SIGN, s.getState());
+        assertTrue("sign() failed", s.runEngineSign);
 	}
 
 	/*



Mime
View raw message