harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r463623 - in /incubator/harmony/enhanced/classlib/trunk/modules/security/src/test: api/java/org/apache/harmony/security/tests/java/security/ api/java/org/apache/harmony/security/tests/java/security/cert/ impl/java/org/apache/harmony/securit...
Date Fri, 13 Oct 2006 10:06:23 GMT
Author: hindessm
Date: Fri Oct 13 03:06:21 2006
New Revision: 463623

URL: http://svn.apache.org/viewvc?view=rev&rev=463623
Log:
Converting things like:

  assertTrue(blah == [true|false|null]) to assert[True|False|Null]
  assertEquals(blah, [true,false,null]) to assert[True|False|Null]
  assertEquals([true,false,null], blah) to assert[True|False|Null]

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Security2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertPathValidator1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertFactoryPerfTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertImplTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore2Test.java?view=diff&rev=463623&r1=463622&r2=463623
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore2Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore2Test.java
Fri Oct 13 03:06:21 2006
@@ -422,9 +422,9 @@
         keyTest.setKeyEntry("alias2", privateKey, pssWord, cert);
 
 		assertTrue("isCertificateEntry method returns false for a certificate",
-				keyTest.isCertificateEntry("alias1") == true);
-		assertTrue("isCertificateEntry method returns true for noncertificate",
-				keyTest.isCertificateEntry("alias2") == false);
+				keyTest.isCertificateEntry("alias1"));
+		assertFalse("isCertificateEntry method returns true for noncertificate",
+				keyTest.isCertificateEntry("alias2"));
 	}
 
 	/**
@@ -446,9 +446,9 @@
         keyTest.setKeyEntry("alias2", privateKey, pssWord, cert);
 
 		assertTrue("isKeyEntry method returns false for a certificate", keyTest
-				.isKeyEntry("alias2") == true);
-		assertTrue("isKeyEntry method returns true for noncertificate", keyTest
-				.isKeyEntry("alias1") == false);
+				.isKeyEntry("alias2"));
+		assertFalse("isKeyEntry method returns true for noncertificate", keyTest
+				.isKeyEntry("alias1"));
 	}
 
 	/**
@@ -463,11 +463,11 @@
 		keyTest.load(in, pssWord);
 		in.close();
 		assertTrue("alias1 is not a certificate", keyTest
-				.isCertificateEntry("alias1") == true);
+				.isCertificateEntry("alias1"));
 		assertTrue("alias2 is not a keyEntry",
-				keyTest.isKeyEntry("alias2") == true);
+				keyTest.isKeyEntry("alias2"));
 		assertTrue("alias3 is not a certificate", keyTest
-				.isCertificateEntry("alias3") == true);
+				.isCertificateEntry("alias3"));
 
 		// test with null password
 		keyTest = KeyStore.getInstance(KeyStore.getDefaultType());
@@ -475,11 +475,11 @@
 		keyTest.load(in, null);
 		in.close();
 		assertTrue("alias1 is not a certificate", keyTest
-				.isCertificateEntry("alias1") == true);
+				.isCertificateEntry("alias1"));
 		assertTrue("alias2 is not a keyEntry",
-				keyTest.isKeyEntry("alias2") == true);
+				keyTest.isKeyEntry("alias2"));
 		assertTrue("alias3 is not a certificate", keyTest
-				.isCertificateEntry("alias3") == true);
+				.isCertificateEntry("alias3"));
 
 		keyTest = KeyStore.getInstance(KeyStore.getDefaultType());
 		InputStream v1in = Support_Resources.getStream("hyts_ks.bks");
@@ -508,7 +508,7 @@
 		keyTest.setCertificateEntry("alias1", cert);
 		assertTrue(
 				"the entry specified by the alias alias1 is not a certificate",
-				keyTest.isCertificateEntry("alias1") == true);
+				keyTest.isCertificateEntry("alias1"));
 		java.security.cert.Certificate resultCert = keyTest
 				.getCertificate("alias1");
 		assertTrue(

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Security2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Security2Test.java?view=diff&rev=463623&r1=463622&r2=463623
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Security2Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Security2Test.java
Fri Oct 13 03:06:21 2006
@@ -385,8 +385,8 @@
 		filter = new Hashtable();
 		filter.put("Provider.id name", "DRLCertFactory");
 		provTest = Security.getProviders(filter);
-        assertEquals("Filter : <Provider.id name, DRLCertFactory >",
-                null, provTest);
+        assertNull("Filter : <Provider.id name, DRLCertFactory >",
+                provTest);
 
 		// exception - no attribute name after the service.algorithm yet we
 		// still supply an expected value. This is not valid.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertPathValidator1Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertPathValidator1Test.java?view=diff&rev=463623&r1=463622&r2=463623
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertPathValidator1Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertPathValidator1Test.java
Fri Oct 13 03:06:21 2006
@@ -379,8 +379,8 @@
         } catch (CertPathValidatorException e) {
         }        
         certPV = new myCertPathValidator(null, null, null);
-        assertEquals("Incorrect algorithm", certPV.getAlgorithm(), null);
-        assertEquals("Incorrect provider", certPV.getProvider(), null);
+        assertNull("Incorrect algorithm", certPV.getAlgorithm());
+        assertNull("Incorrect provider", certPV.getProvider());
         try {
             certPV.validate(null, null);
             fail("NullPointerException must be thrown");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl1Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl1Test.java?view=diff&rev=463623&r1=463622&r2=463623
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl1Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl1Test.java
Fri Oct 13 03:06:21 2006
@@ -809,7 +809,7 @@
                     assertEquals("Incorrect certificate", cc[t], certs[t]);             
      
                 }
             }
-            assertEquals(kss[i].getCertificateAlias(cert), null);
+            assertNull(kss[i].getCertificateAlias(cert));
             String ss = kss[i].getCertificateAlias(certs[0]);
             boolean ans = false;
             for (int j = 1; j < aliases.length; j++)  {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertFactoryPerfTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertFactoryPerfTest.java?view=diff&rev=463623&r1=463622&r2=463623
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertFactoryPerfTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertFactoryPerfTest.java
Fri Oct 13 03:06:21 2006
@@ -795,8 +795,8 @@
      * hasUnsupportedCriticalExtension() method testing.
      */
     public void testHasUnsupportedCriticalExtension() {
-        assertEquals("Incorrect value of hasUnsupportedCriticalExtension", 
-                true, certificate.hasUnsupportedCriticalExtension());
+        assertTrue("Incorrect value of hasUnsupportedCriticalExtension", 
+                certificate.hasUnsupportedCriticalExtension());
 
         if (!certificate.hasUnsupportedCriticalExtension()) {
             fail("Incorrect value of hasUnsupportedCriticalExtension");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertImplTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertImplTest.java?view=diff&rev=463623&r1=463622&r2=463623
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertImplTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CertImplTest.java
Fri Oct 13 03:06:21 2006
@@ -697,8 +697,8 @@
      * hasUnsupportedCriticalExtension() method testing.
      */
     public void testHasUnsupportedCriticalExtension() {
-        assertEquals("Incorrect value of hasUnsupportedCriticalExtension", 
-                true, certificate.hasUnsupportedCriticalExtension());
+        assertTrue("Incorrect value of hasUnsupportedCriticalExtension", 
+                certificate.hasUnsupportedCriticalExtension());
 
         if (!certificate.hasUnsupportedCriticalExtension()) {
             fail("Incorrect value of hasUnsupportedCriticalExtension");



Mime
View raw message