harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r397071 [2/2] - in /incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common: java/security/ java/security/cert/ java/security/spec/ org/apache/harmony/security/asn1/der/ org/apache/harmony/security/provider/cert/ tes...
Date Wed, 26 Apr 2006 03:45:32 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/SecurityTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/SecurityTest.java?rev=397071&r1=397070&r2=397071&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/SecurityTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/SecurityTest.java
Tue Apr 25 20:45:27 2006
@@ -37,10 +37,9 @@
 		// Test for method java.lang.String
 		// java.security.Security.getProperty(java.lang.String)
 		Security.setProperty("keyTestAlternate", "testing a property set");
-		assertTrue(
-				"the property value returned for keyTestAlternate was incorrect",
-				Security.getProperty("keyTestAlternate").equals(
-						"testing a property set"));
+		assertEquals("the property value returned for keyTestAlternate was incorrect",
+				
+						"testing a property set", Security.getProperty("keyTestAlternate"));
 	}
 
 	/**
@@ -53,9 +52,9 @@
 		// java.lang.String)
 
 		Security.setProperty("keyTest", "permission to set property");
-		assertTrue("the property value returned for keyTest was not correct",
-				Security.getProperty("keyTest").equals(
-						"permission to set property"));
+		assertEquals("the property value returned for keyTest was not correct",
+				
+						"permission to set property", Security.getProperty("keyTest"));
 
 	}
 
@@ -172,10 +171,10 @@
 		Provider provTest[] = Security.getProviders();
 		assertEquals("the number of providers is not 2 it was: "
 				+ provTest.length, 2, provTest.length);
-		assertTrue("the first provider should be DRLCertFactory", provTest[0]
-				.getName().equals("DRLCertFactory"));
-		assertTrue("the second provider should be BC", provTest[1].getName()
-				.equals("BC"));
+		assertEquals("the first provider should be DRLCertFactory", "DRLCertFactory", provTest[0]
+				.getName());
+		assertEquals("the second provider should be BC", "BC", provTest[1].getName()
+				);
 	}
 
 	/**
@@ -368,8 +367,8 @@
 		filter.put("Signature.SHA1withDSA", "");
 		Provider provTest[] = Security.getProviders(filter);
 		if (provTest == null) {
-			assertTrue("Filter : <KeyStore.BKS>,<Signature.SHA1withDSA>",
-					getProvidersCount(filter) == 0);
+			assertEquals("Filter : <KeyStore.BKS>,<Signature.SHA1withDSA>",
+					0, getProvidersCount(filter));
 		} else {
 			assertEquals("Filter : <KeyStore.BKS>,<Signature.SHA1withDSA>",
 					getProvidersCount(filter), provTest.length);
@@ -381,9 +380,8 @@
 		filter.put("KeyFactory.RSA", "");
 		provTest = Security.getProviders(filter);
 		if (provTest == null) {
-			assertTrue(
-					"Filter : <MessageDigest.MD2>,<CertificateFactory.X.509>,<KeyFactory.RSA>",
-					getProvidersCount(filter) == 0);
+			assertEquals("Filter : <MessageDigest.MD2>,<CertificateFactory.X.509>,<KeyFactory.RSA>",
+					0, getProvidersCount(filter));
 		} else {
 			assertEquals(
 					"Filter : <MessageDigest.MD2>,<CertificateFactory.X.509>,<KeyFactory.RSA>",
@@ -395,9 +393,8 @@
 		filter.put("CertificateFactory.X.509", "");
 		provTest = Security.getProviders(filter);
 		if (provTest == null) {
-			assertTrue(
-					"Filter : <MessageDigest.SHA><CertificateFactory.X.509>",
-					getProvidersCount(filter) == 0);
+			assertEquals("Filter : <MessageDigest.SHA><CertificateFactory.X.509>",
+					0, getProvidersCount(filter));
 		} else {
 			assertEquals(
 					"Filter : <MessageDigest.SHA><CertificateFactory.X.509>",
@@ -408,8 +405,8 @@
 		filter.put("CertificateFactory.X509", "");
 		provTest = Security.getProviders(filter);
 		if (provTest == null) {
-			assertTrue("Filter : <CertificateFactory.X509>",
-					getProvidersCount(filter) == 0);
+			assertEquals("Filter : <CertificateFactory.X509>",
+					0, getProvidersCount(filter));
 		} else {
 			assertEquals("Filter : <CertificateFactory.X509>",
 					getProvidersCount(filter), provTest.length);
@@ -419,8 +416,8 @@
 		filter.put("Provider.id name", "DRLCertFactory");
 		provTest = Security.getProviders(filter);
 		if (provTest == null) {
-			assertTrue("Filter : <Provider.id name, DRLCertFactory >",
-					getProvidersCount(filter) == 0);
+			assertEquals("Filter : <Provider.id name, DRLCertFactory >",
+					0, getProvidersCount(filter));
 		} else {
 			assertEquals("Filter : <Provider.id name, DRLCertFactory>",
 					getProvidersCount(filter), provTest.length);
@@ -507,9 +504,9 @@
 			assertTrue("Failed to add provider", addResult != -1);
 
 			Security.removeProvider(test.getName());
-			assertTrue(
+			assertNull(
 					"the provider TestProvider is found after it was removed",
-					Security.getProvider(test.getName()) == null);
+					Security.getProvider(test.getName()));
 
 			// Make sure entrust provider not already loaded. Should do nothing
 			// if not already loaded.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/SignatureExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/SignatureExceptionTest.java?rev=397071&r1=397070&r2=397071&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/SignatureExceptionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/SignatureExceptionTest.java
Tue Apr 25 20:45:27 2006
@@ -25,8 +25,8 @@
 	public void test_Constructor() {
 		// Test for method java.security.SignatureException()
 		SignatureException e = new SignatureException();
-		assertTrue("Failed toString test for constructed instance", e
-				.toString().equals("java.security.SignatureException"));
+		assertEquals("Failed toString test for constructed instance", "java.security.SignatureException",
e
+				.toString());
 	}
 
 	/**
@@ -35,8 +35,8 @@
 	public void test_ConstructorLjava_lang_String() {
 		// Test for method java.security.SignatureException(java.lang.String)
 		SignatureException e = new SignatureException("test message");
-		assertTrue("Failed toString test for constructed instance", e
-				.toString().equals(
-						"java.security.SignatureException: test message"));
+		assertEquals("Failed toString test for constructed instance", 
+						"java.security.SignatureException: test message", e
+				.toString());
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/UnrecoverableKeyExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/UnrecoverableKeyExceptionTest.java?rev=397071&r1=397070&r2=397071&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/UnrecoverableKeyExceptionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/tests/api/java/security/UnrecoverableKeyExceptionTest.java
Tue Apr 25 20:45:27 2006
@@ -25,8 +25,8 @@
 	public void test_Constructor() {
 		// Test for method java.security.UnrecoverableKeyException()
 		UnrecoverableKeyException e = new UnrecoverableKeyException();
-		assertTrue("Failed toString test for constructed instance", e
-				.toString().equals("java.security.UnrecoverableKeyException"));
+		assertEquals("Failed toString test for constructed instance", "java.security.UnrecoverableKeyException",
e
+				.toString());
 	}
 
 	/**



Mime
View raw message