harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r392202 [3/5] - in /incubator/harmony/enhanced/classlib/trunk/modules: crypto/src/main/java/javax/crypto/spec/ security/src/main/java/common/java/security/ security/src/main/java/common/java/security/cert/ security/src/main/java/common/java...
Date Fri, 07 Apr 2006 06:53:12 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator2Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator2Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator2Test.java Thu Apr  6 23:52:51 2006
@@ -130,8 +130,6 @@
         CertPathValidator cerPV;
         for (int i = 0; i < validValues.length; i++) {
             cerPV = CertPathValidator.getInstance(validValues[i]);
-            assertTrue("Not instanceof CertPathValidator object",
-                    cerPV instanceof CertPathValidator);
             assertEquals("Incorrect type", cerPV.getAlgorithm(), validValues[i]);
             assertEquals("Incorrect provider", cerPV.getProvider(), mProv);
             checkResult(cerPV);
@@ -196,8 +194,6 @@
         for (int i = 0; i < validValues.length; i++) {
             cerPV = CertPathValidator.getInstance(validValues[i], mProv
                     .getName());
-            assertTrue("Not instanceof CertPathValidator object",
-                    cerPV instanceof CertPathValidator);
             assertEquals("Incorrect type", cerPV.getAlgorithm(), validValues[i]);
             assertEquals("Incorrect provider", cerPV.getProvider().getName(),
                     mProv.getName());
@@ -243,8 +239,6 @@
         CertPathValidator cerPV;
         for (int i = 0; i < validValues.length; i++) {
             cerPV = CertPathValidator.getInstance(validValues[i], mProv);
-            assertTrue("Not instanceof CertPathValidator object",
-                    cerPV instanceof CertPathValidator);
             assertEquals("Incorrect type", cerPV.getAlgorithm(), validValues[i]);
             assertEquals("Incorrect provider", cerPV.getProvider(), mProv);
             checkResult(cerPV);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator3Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator3Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator3Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidator3Test.java Thu Apr  6 23:52:51 2006
@@ -47,9 +47,6 @@
         super(name);
     }
     private static final String defaultType = CertPathBuilder1Test.defaultType;    
-    private static final String [] validValues = CertPathBuilder1Test.validValues;
-     
-    private static String [] invalidValues = SpiEngUtils.invalidValues;
     
     private static boolean PKIXSupport = false;
 
@@ -99,7 +96,7 @@
             return;
         }
         MyCertPath mCP = new MyCertPath(new byte[0]);
-        CertPathParameters params = (CertPathParameters)new PKIXParameters(TestUtils.getTrustAnchorSet()); 
+        CertPathParameters params = new PKIXParameters(TestUtils.getTrustAnchorSet()); 
         CertPathValidator [] certPV = createCPVs();
         assertNotNull("CertPathValidator objects were not created", certPV);
         for (int i = 0; i < certPV.length; i++) {            

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidatorExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidatorExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidatorExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidatorExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -67,8 +67,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CertPathValidatorException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CertPathValidatorException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidatorSpiTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidatorSpiTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidatorSpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertPathValidatorSpiTest.java Thu Apr  6 23:52:51 2006
@@ -46,9 +46,7 @@
      */
     public void testCertPathValidatorSpi01() throws CertPathValidatorException,
             InvalidAlgorithmParameterException {
-        CertPathValidatorSpi certPathValid = 
-            (CertPathValidatorSpi) new MyCertPathValidatorSpi();
-        assertTrue(certPathValid instanceof CertPathValidatorSpi);
+        CertPathValidatorSpi certPathValid = new MyCertPathValidatorSpi();
         CertPathParameters params = null;
         CertPath certPath = null;
         CertPathValidatorResult cpvResult = certPathValid.engineValidate(

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStore1Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStore1Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStore1Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStore1Test.java Thu Apr  6 23:52:51 2006
@@ -52,7 +52,7 @@
 
     private static final String defaultType = "LDAP";  
     public static final String [] validValues =  {
-            "LDAP", "ldap", "Ldap", "lDAP", "lDaP" };;
+            "LDAP", "ldap", "Ldap", "lDAP", "lDaP" };
     public static  String [] validValuesC = null;
      
     private static String [] invalidValues = SpiEngUtils.invalidValues;
@@ -67,16 +67,13 @@
     private static String defaultProviderColName;
     
     private static String NotSupportMsg = "";
-    private static String NotSLDAP = "";
-    private static String NotSColl = "";
+
     static {
         defaultProvider = SpiEngUtils.isSupport(defaultType,
                 srvCertStore);
         LDAPSupport = (defaultProvider != null);
         defaultProviderName = (LDAPSupport ? defaultProvider.getName() : null);
         NotSupportMsg = "LDAP and Collection algorithm are not supported";
-        NotSLDAP = "LDAP is not supported";
-        NotSColl = "Collection is not supported";
         
         defaultProviderCol = SpiEngUtils.isSupport(CollectionType,
                 srvCertStore);
@@ -163,7 +160,6 @@
         MyCertStoreParameters pp = new MyCertStoreParameters();
         CertStoreSpi spi = new MyCertStoreSpi(pp);
         CertStore certS = new myCertStore(spi, dProv, dType, pp);
-        assertTrue("Not CertStore object", certS instanceof CertStore);
         assertEquals("Incorrect algorithm", certS.getType(), dType);
         assertEquals("Incorrect provider", certS.getProvider(), dProv); 
         assertTrue("Incorrect parameters", certS.getCertStoreParameters()
@@ -174,7 +170,6 @@
         } catch (CertStoreException e) {
         }
         certS = new myCertStore(null, null, null, null);
-        assertTrue("Not CertStore object", certS instanceof CertStore);
         assertNull("Incorrect algorithm", certS.getType());
         assertNull("Incorrect provider", certS.getProvider()); 
         assertNull("Incorrect parameters", certS.getCertStoreParameters());         
@@ -222,7 +217,7 @@
         CertStoreParameters paramsContr = null; 
         if (CollectionSupport) {
             if (LDAPSupport) {
-                paramsContr = (CertStoreParameters)new LDAPCertStoreParameters();
+                paramsContr = new LDAPCertStoreParameters();
             }
         }
         for (int i = 0; i < dValid.length; i++ ) { 
@@ -253,10 +248,8 @@
         CertStore certS;
         for (int i = 0; i < dValid.length; i++) {
             certS = CertStore.getInstance(dValid[i], dParams);
-            assertTrue("Not CertStore object", certS instanceof CertStore);
             assertEquals("Incorrect type", certS.getType(), dValid[i]);
-            assertTrue("Incorrect parameters", certS.getCertStoreParameters()
-                    instanceof CertStoreParameters); 
+            certS.getCertStoreParameters();
         }
     }
     /**
@@ -349,7 +342,7 @@
         CertStoreParameters paramsContr = null; 
         if (CollectionSupport) {
             if (LDAPSupport) {
-                paramsContr = (CertStoreParameters)new LDAPCertStoreParameters();
+                paramsContr = new LDAPCertStoreParameters();
             }
         }
         for (int i = 0; i < dValid.length; i++ ) { 
@@ -380,10 +373,8 @@
         CertStore certS;
         for (int i = 0; i < dValid.length; i++) {
             certS = CertStore.getInstance(dValid[i], dParams, dName);
-            assertTrue("Not CertStore object", certS instanceof CertStore);
             assertEquals("Incorrect type", certS.getType(), dValid[i]);
-            assertTrue("Incorrect parameters", certS.getCertStoreParameters()
-                    instanceof CertStoreParameters); 
+            certS.getCertStoreParameters();
         }
     }
 
@@ -448,7 +439,7 @@
         CertStoreParameters paramsContr = null; 
         if (CollectionSupport) {
             if (LDAPSupport) {
-                paramsContr = (CertStoreParameters)new LDAPCertStoreParameters();
+                paramsContr = new LDAPCertStoreParameters();
             }
         }     
         for (int i = 0; i < dValid.length; i++ ) {
@@ -479,10 +470,8 @@
         CertStore certS;
         for (int i = 0; i < dValid.length; i++) {
             certS = CertStore.getInstance(dValid[i], dParams, dProv);
-            assertTrue("Not CertStore object", certS instanceof CertStore);
             assertEquals("Incorrect type", certS.getType(), dValid[i]);
-            assertTrue("Incorrect parameters", certS.getCertStoreParameters()
-                    instanceof CertStoreParameters); 
+            certS.getCertStoreParameters();
         }
     }
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStore2Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStore2Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStore2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStore2Test.java Thu Apr  6 23:52:51 2006
@@ -135,8 +135,6 @@
         CertStore certS;
         for (int i = 0; i < validValues.length; i++) {
             certS = CertStore.getInstance(validValues[i], p);      
-            assertTrue("Not instanceof CertStore object",
-                    certS instanceof CertStore);
             assertEquals("Incorrect type", certS.getType(), validValues[i]);
             assertEquals("Incorrect provider", certS.getProvider(), mProv);
             assertTrue("Invalid parameters",certS.getCertStoreParameters() instanceof MyCertStoreParameters);
@@ -218,8 +216,6 @@
         for (int i = 0; i < validValues.length; i++) {
             certS = CertStore.getInstance(validValues[i], p, mProv
                     .getName());
-            assertTrue("Not instanceof CertStore object",
-                    certS instanceof CertStore);
             assertEquals("Incorrect type", certS.getType(), validValues[i]);
             assertEquals("Incorrect provider", certS.getProvider().getName(),
                     mProv.getName());
@@ -281,8 +277,6 @@
         CertStore certS;
         for (int i = 0; i < validValues.length; i++) {
             certS = CertStore.getInstance(validValues[i], p, mProv);
-            assertTrue("Not instanceof CertStore object",
-                    certS instanceof CertStore);
             assertEquals("Incorrect type", certS.getType(), validValues[i]);
             assertEquals("Incorrect provider", certS.getProvider(), mProv);
             assertTrue("Invalid parameters",certS.getCertStoreParameters() instanceof MyCertStoreParameters);
@@ -305,7 +299,7 @@
             return null;
         }
         try {
-            return (Object)super.clone();
+            return super.clone();
         } catch (CloneNotSupportedException e) {
             return null;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStoreExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStoreExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStoreExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStoreExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CertStoreException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CertStoreException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStoreSpiTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStoreSpiTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStoreSpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertStoreSpiTest.java Thu Apr  6 23:52:51 2006
@@ -56,14 +56,11 @@
                                                           // X509CertSelector();
         CRLSelector crlSelector = new tmpCRLSelector();//new X509CRLSelector();
         try {
-            certStoreSpi = (CertStoreSpi) new MyCertStoreSpi(null);
+            certStoreSpi = new MyCertStoreSpi(null);
             fail("InvalidAlgorithmParameterException must be thrown");
         } catch (InvalidAlgorithmParameterException e) {
         }
-        certStoreSpi = (CertStoreSpi) new MyCertStoreSpi(
-                (CertStoreParameters) new MyCertStoreParameters());
-        assertTrue("Not CertStoreSpi object",
-                certStoreSpi instanceof CertStoreSpi);
+        certStoreSpi = new MyCertStoreSpi(new MyCertStoreParameters());
         assertNull("Not null collection", certStoreSpi
                 .engineGetCertificates(certSelector));
         assertNull("Not null collection", certStoreSpi

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateEncodingExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateEncodingExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateEncodingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateEncodingExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CertificateEncodingException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CertificateEncodingException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CertificateException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CertificateException ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateExpiredExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateExpiredExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateExpiredExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateExpiredExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CertificateExpiredException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CertificateExpiredException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateFactory2Test.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateFactory2Test.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateFactory2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateFactory2Test.java Thu Apr  6 23:52:51 2006
@@ -23,7 +23,6 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
-import java.io.InputStream;
 import java.security.NoSuchProviderException;
 import java.security.Provider;
 import java.security.Security;
@@ -91,12 +90,12 @@
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
         DataInputStream dis = new DataInputStream(bais);
         try {
-            certFactory.generateCertPath((InputStream) bais);
+            certFactory.generateCertPath(bais);
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
         try {
-            certFactory.generateCertPath((InputStream) dis);
+            certFactory.generateCertPath(dis);
             if (!mode) {
                 fail("CertificateException must be thrown because encodings list is empty");
             }
@@ -106,12 +105,12 @@
             }
         }
         try {
-            certFactory.generateCertPath((InputStream) bais, "aa");
+            certFactory.generateCertPath(bais, "aa");
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
         try {
-            certFactory.generateCertPath((InputStream) dis, "");
+            certFactory.generateCertPath(dis, "");
             if (mode) {
                 fail("IllegalArgumentException must be thrown");
             }
@@ -120,10 +119,10 @@
                 fail("Unexpected IllegalArgumentException was thrown");
             }
         }
-        certFactory.generateCertPath((InputStream) dis, "ss");
+        certFactory.generateCertPath(dis, "ss");
 
         try {
-            certFactory.generateCertificate((InputStream) bais);
+            certFactory.generateCertificate(bais);
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
@@ -132,13 +131,13 @@
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
-        Certificate cert = certFactory.generateCertificate((InputStream) dis);
+        Certificate cert = certFactory.generateCertificate(dis);
         assertNull("Result must be null", cert);
-        Collection col = certFactory.generateCertificates((InputStream) dis);
+        Collection col = certFactory.generateCertificates(dis);
         assertNull("Result must be null", col);
 
         try {
-            certFactory.generateCRL((InputStream) bais);
+            certFactory.generateCRL(bais);
             fail("CRLException must be thrown");
         } catch (CRLException e) {
         }
@@ -147,9 +146,9 @@
             fail("CRLException must be thrown");
         } catch (CRLException e) {
         }
-        CRL crl = certFactory.generateCRL((InputStream) dis);
+        CRL crl = certFactory.generateCRL(dis);
         assertNull("Result must be null", crl);
-        col = certFactory.generateCRLs((InputStream) dis);
+        col = certFactory.generateCRLs(dis);
         assertNull("Result must be null", col);
 
         List list = null;
@@ -167,7 +166,6 @@
             }
         }
         Iterator it = certFactory.getCertPathEncodings();
-        assertTrue("Not Iterator object", it instanceof Iterator);
         if (mode) {
             assertTrue(it.hasNext());
         } else {
@@ -200,8 +198,6 @@
         CertificateFactory cerF;
         for (int i = 0; i < validValues.length; i++) {
             cerF = CertificateFactory.getInstance(validValues[i]);
-            assertTrue("Not instanceof CertificateFactory object",
-                    cerF instanceof CertificateFactory);
             assertEquals("Incorrect type", cerF.getType(), validValues[i]);
             assertEquals("Incorrect provider", cerF.getProvider(), mProv);
             checkResult(cerF, mode);
@@ -265,8 +261,6 @@
         for (int i = 0; i < validValues.length; i++) {
             cerF = CertificateFactory.getInstance(validValues[i], mProv
                     .getName());
-            assertTrue("Not instanceof CertificateFactory object",
-                    cerF instanceof CertificateFactory);
             assertEquals("Incorrect type", cerF.getType(), validValues[i]);
             assertEquals("Incorrect provider", cerF.getProvider().getName(),
                     mProv.getName());
@@ -311,8 +305,6 @@
         CertificateFactory cerF;
         for (int i = 0; i < validValues.length; i++) {
             cerF = CertificateFactory.getInstance(validValues[i], mProv);
-            assertTrue("Not instanceof CertificateFactory object",
-                    cerF instanceof CertificateFactory);
             assertEquals("Incorrect type", cerF.getType(), validValues[i]);
             assertEquals("Incorrect provider", cerF.getProvider(), mProv);            
             checkResult(cerF,  mode);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateFactorySpiTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateFactorySpiTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateFactorySpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateFactorySpiTest.java Thu Apr  6 23:52:51 2006
@@ -52,16 +52,15 @@
      */
     public void testCertificateFactorySpi01() throws CertificateException,
             CRLException {
-        CertificateFactorySpi certFactorySpi = (CertificateFactorySpi) new extCertificateFactorySpi();
-        assertTrue(certFactorySpi instanceof CertificateFactorySpi);
+        CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
         try {
-            certFactorySpi.engineGenerateCertPath((InputStream) bais);
+            certFactorySpi.engineGenerateCertPath(bais);
             fail("UnsupportedOperationException must be thrown");
         } catch (UnsupportedOperationException e) {
         }
         try {
-            certFactorySpi.engineGenerateCertPath((InputStream) bais, "");
+            certFactorySpi.engineGenerateCertPath(bais, "");
             fail("UnsupportedOperationException must be thrown");
         } catch (UnsupportedOperationException e) {
         }
@@ -77,7 +76,7 @@
         } catch (UnsupportedOperationException e) {
         }
         Certificate cc = certFactorySpi
-                .engineGenerateCertificate((InputStream) bais);
+                .engineGenerateCertificate(bais);
         assertNull("Not null Cerificate", cc);
         try {
             certFactorySpi.engineGenerateCertificate(null);
@@ -85,7 +84,7 @@
         } catch (CertificateException e) {
         }
         Collection col = certFactorySpi
-                .engineGenerateCertificates((InputStream) bais);
+                .engineGenerateCertificates(bais);
         assertNull("Not null Collection", col);
         try {
             certFactorySpi.engineGenerateCertificates(null);
@@ -93,7 +92,7 @@
         } catch (CertificateException e) {
         }
 
-        CRL ccCRL = certFactorySpi.engineGenerateCRL((InputStream) bais);
+        CRL ccCRL = certFactorySpi.engineGenerateCRL(bais);
         assertNull("Not null CRL", ccCRL);
         try {
             certFactorySpi.engineGenerateCRL(null);
@@ -102,7 +101,7 @@
         }
 
         Collection colCRL = certFactorySpi
-                .engineGenerateCRLs((InputStream) bais);
+                .engineGenerateCRLs(bais);
         assertNull("Not null CRL", colCRL);
         try {
             certFactorySpi.engineGenerateCRLs(null);
@@ -117,31 +116,30 @@
      */
     public void testCertificateFactorySpi02() throws CertificateException,
             CRLException {
-        CertificateFactorySpi certFactorySpi = (CertificateFactorySpi) new MyCertificateFactorySpi();
+        CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
         MyCertificateFactorySpi.putMode(true);
-        assertTrue(certFactorySpi instanceof CertificateFactorySpi);
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
         DataInputStream dis = new DataInputStream(bais);
         try {
-            certFactorySpi.engineGenerateCertPath((InputStream) bais);
+            certFactorySpi.engineGenerateCertPath(bais);
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
-        certFactorySpi.engineGenerateCertPath((InputStream) dis);
+        certFactorySpi.engineGenerateCertPath(dis);
         try {
-            certFactorySpi.engineGenerateCertPath((InputStream) bais, "aa");
+            certFactorySpi.engineGenerateCertPath(bais, "aa");
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
         try {
-            certFactorySpi.engineGenerateCertPath((InputStream) dis, "");
+            certFactorySpi.engineGenerateCertPath(dis, "");
             fail("IllegalArgumentException must be thrown");
         } catch (IllegalArgumentException e) {
         }
-        certFactorySpi.engineGenerateCertPath((InputStream) dis, "ss");
+        certFactorySpi.engineGenerateCertPath(dis, "ss");
 
         try {
-            certFactorySpi.engineGenerateCertificate((InputStream) bais);
+            certFactorySpi.engineGenerateCertificate(bais);
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
@@ -151,14 +149,14 @@
         } catch (CertificateException e) {
         }
         Certificate cert = certFactorySpi
-                .engineGenerateCertificate((InputStream) dis);
+                .engineGenerateCertificate(dis);
         assertNull("Result must be null", cert);
         Collection col = certFactorySpi
-                .engineGenerateCertificates((InputStream) dis);
+                .engineGenerateCertificates(dis);
         assertNull("Result must be null", col);
 
         try {
-            certFactorySpi.engineGenerateCRL((InputStream) bais);
+            certFactorySpi.engineGenerateCRL(bais);
             fail("CRLException must be thrown");
         } catch (CRLException e) {
         }
@@ -167,9 +165,9 @@
             fail("CRLException must be thrown");
         } catch (CRLException e) {
         }
-        CRL crl = certFactorySpi.engineGenerateCRL((InputStream) dis);
+        CRL crl = certFactorySpi.engineGenerateCRL(dis);
         assertNull("Result must be null", crl);
-        col = certFactorySpi.engineGenerateCRLs((InputStream) dis);
+        col = certFactorySpi.engineGenerateCRLs(dis);
         assertNull("Result must be null", col);
 
         List list = null;
@@ -179,7 +177,6 @@
         } catch (NullPointerException e) {            
         }
         Iterator enc = certFactorySpi.engineGetCertPathEncodings();
-        assertTrue("Not Iterator object", enc instanceof Iterator);
         assertTrue("Incorrect Iterator", enc.hasNext());
     }
     
@@ -189,31 +186,30 @@
      */
     public void testCertificateFactorySpi03() throws CertificateException,
             CRLException {
-        CertificateFactorySpi certFactorySpi = (CertificateFactorySpi) new MyCertificateFactorySpi();
+        CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
         MyCertificateFactorySpi.putMode(false);
-        assertTrue(certFactorySpi instanceof CertificateFactorySpi);
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
         DataInputStream dis = new DataInputStream(bais);
         try {
-            certFactorySpi.engineGenerateCertPath((InputStream) bais);
+            certFactorySpi.engineGenerateCertPath(bais);
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
         try {
-            certFactorySpi.engineGenerateCertPath((InputStream) dis);
+            certFactorySpi.engineGenerateCertPath(dis);
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
         try {
-            certFactorySpi.engineGenerateCertPath((InputStream) bais, "aa");
+            certFactorySpi.engineGenerateCertPath(bais, "aa");
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
-        certFactorySpi.engineGenerateCertPath((InputStream) dis, "");
-        certFactorySpi.engineGenerateCertPath((InputStream) dis, "ss");
+        certFactorySpi.engineGenerateCertPath(dis, "");
+        certFactorySpi.engineGenerateCertPath(dis, "ss");
 
         try {
-            certFactorySpi.engineGenerateCertificate((InputStream) bais);
+            certFactorySpi.engineGenerateCertificate(bais);
             fail("CertificateException must be thrown");
         } catch (CertificateException e) {
         }
@@ -223,14 +219,14 @@
         } catch (CertificateException e) {
         }
         Certificate cert = certFactorySpi
-                .engineGenerateCertificate((InputStream) dis);
+                .engineGenerateCertificate(dis);
         assertNull("Result must be null", cert);
         Collection col = certFactorySpi
-                .engineGenerateCertificates((InputStream) dis);
+                .engineGenerateCertificates(dis);
         assertNull("Result must be null", col);
 
         try {
-            certFactorySpi.engineGenerateCRL((InputStream) bais);
+            certFactorySpi.engineGenerateCRL(bais);
             fail("CRLException must be thrown");
         } catch (CRLException e) {
         }
@@ -239,15 +235,14 @@
             fail("CRLException must be thrown");
         } catch (CRLException e) {
         }
-        CRL crl = certFactorySpi.engineGenerateCRL((InputStream) dis);
+        CRL crl = certFactorySpi.engineGenerateCRL(dis);
         assertNull("Result must be null", crl);
-        col = certFactorySpi.engineGenerateCRLs((InputStream) dis);
+        col = certFactorySpi.engineGenerateCRLs(dis);
         assertNull("Result must be null", col);
 
         List list = null;
         certFactorySpi.engineGenerateCertPath(list);
         Iterator enc = certFactorySpi.engineGetCertPathEncodings();
-        assertTrue("Not Iterator object", enc instanceof Iterator);
         assertFalse("Incorrect Iterator", enc.hasNext());
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateNotYetValidExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateNotYetValidExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateNotYetValidExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateNotYetValidExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -65,8 +65,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CertificateNotYetValidException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CertificateNotYetValidException: ".concat(tE.toString())
                 .concat(" is not equal to caught exception: ").concat(

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateParsingExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateParsingExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateParsingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/CertificateParsingExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not CertificateParsingException";
-
     static String createErr(Exception tE, Exception eE) {
         return "CertificateParsingException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/MyCertStoreParameters.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/MyCertStoreParameters.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/MyCertStoreParameters.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/MyCertStoreParameters.java Thu Apr  6 23:52:51 2006
@@ -32,7 +32,7 @@
     }
     public Object clone() {
         try {
-            return (Object)super.clone();
+            return super.clone();
         } catch (CloneNotSupportedException e) {
             return null;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java Thu Apr  6 23:52:51 2006
@@ -40,8 +40,6 @@
 import org.apache.harmony.security.asn1.ASN1Integer;
 import org.apache.harmony.security.asn1.ASN1OctetString;
 
-import org.apache.harmony.security.asn1.*;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -568,7 +566,6 @@
         X509CRLSelector selector = new X509CRLSelector();
         X500Principal iss1 = new X500Principal("O=First Org.");
         X500Principal iss2 = new X500Principal("O=Second Org.");
-        X500Principal iss3 = new X500Principal("O=Third Org.");
         BigInteger minCRL = new BigInteger("10000");
         BigInteger maxCRL = new BigInteger("10000");
         Date date = new Date(200);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CertSelectorTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CertSelectorTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CertSelectorTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CertSelectorTest.java Thu Apr  6 23:52:51 2006
@@ -52,9 +52,25 @@
 import org.apache.harmony.security.asn1.ASN1Sequence;
 import org.apache.harmony.security.asn1.ASN1Type;
 
-import org.apache.harmony.security.asn1.*;
 import org.apache.harmony.security.x501.Name;
-import org.apache.harmony.security.x509.*;
+import org.apache.harmony.security.x509.AlgorithmIdentifier;
+import org.apache.harmony.security.x509.CertificatePolicies;
+import org.apache.harmony.security.x509.EDIPartyName;
+import org.apache.harmony.security.x509.Extension;
+import org.apache.harmony.security.x509.Extensions;
+import org.apache.harmony.security.x509.GeneralName;
+import org.apache.harmony.security.x509.GeneralNames;
+import org.apache.harmony.security.x509.GeneralSubtree;
+import org.apache.harmony.security.x509.GeneralSubtrees;
+import org.apache.harmony.security.x509.NameConstraints;
+import org.apache.harmony.security.x509.ORAddress;
+import org.apache.harmony.security.x509.OtherName;
+import org.apache.harmony.security.x509.PolicyInformation;
+import org.apache.harmony.security.x509.PrivateKeyUsagePeriod;
+import org.apache.harmony.security.x509.SubjectPublicKeyInfo;
+import org.apache.harmony.security.x509.TBSCertificate;
+import org.apache.harmony.security.x509.Validity;
+
 
 
 import junit.framework.Test;
@@ -90,79 +106,79 @@
         protected NameConstraints nameConstraints = null;
         
         /* Stuff methods */
-        public TestCert() {};
+        public TestCert() {}
         
         public TestCert(GeneralNames sans) {
             setSubjectAlternativeNames(sans);
-        };
+        }
 
         public TestCert(NameConstraints nameConstraints) {
             this.nameConstraints = nameConstraints;
-        };
+        }
 
         public TestCert(String equalCriteria) {
             setEqualCriteria(equalCriteria);
-        };
+        }
         
         public TestCert(String[] policies) {
             setPolicies(policies);
-        };
+        }
         
         public TestCert(BigInteger serial) {
             setSerialNumber(serial);
-        };
+        }
         
         public TestCert(X500Principal principal) {
             setIssuer(principal);
             setSubject(principal);
-        };
+        }
         
         public TestCert(byte[] array) {
             setKeyIdentifier(array);
-        };
+        }
         
         public TestCert(Date date) {
             setDate(date);
-        };
+        }
         
         public TestCert(Date notBefore, Date notAfter) {
             setPeriod(notBefore, notAfter);
-        };
+        }
         
         public TestCert(PublicKey key) {
             setPublicKey(key);
-        };
+        }
         
         public TestCert(boolean[] keyUsage) {
             setKeyUsage(keyUsage);
-        };
+        }
         
         public TestCert(Set extKeyUsage) {
             setExtendedKeyUsage(extKeyUsage);
-        };
+        }
         
         public TestCert(int pathLen) {
             this.pathLen = pathLen;
-        };
+        }
         
         public void setPolicies(String[] policies) {
             this.policies = policies;
-        };
+        }
         
         public void setSubjectAlternativeNames(GeneralNames sans) {
             this.sans = sans;
-        };
+        }
 
         public void setExtendedKeyUsage(Set extKeyUsage) {
             this.extKeyUsage = (extKeyUsage == null) 
                                 ? null 
                                 : new ArrayList(extKeyUsage);
-        };
+        }
         
         public void setKeyUsage(boolean[] keyUsage) {
             this.keyUsage = (keyUsage == null) ? null
                                                : (boolean[]) keyUsage.clone();
-        };
+        }
         
         public void setPublicKey(PublicKey key) {
             this.key = key;
@@ -175,7 +191,7 @@
             
         public void setSerialNumber(BigInteger serial) {
             this.serialNumber = serial;
-        };
+        }
 
         public void setEqualCriteria(String equalCriteria) {
             this.equalCriteria = equalCriteria; 
@@ -222,7 +238,7 @@
         }
         
         public void checkValidity() throws CertificateExpiredException,
-                                           CertificateNotYetValidException {};
+                                           CertificateNotYetValidException {}
 
         public void checkValidity(Date date) 
                                     throws CertificateExpiredException, 
@@ -237,21 +253,21 @@
             if (result < 0) {
                 throw new CertificateNotYetValidException();
             }
-        };
+        }
 
         public int getVersion() {
             return 3;
-        };
+        }
 
         public BigInteger getSerialNumber() {
             return (serialNumber == null) 
                     ? new BigInteger("1111") 
                     : serialNumber;
-        };
+        }
 
         public Principal getIssuerDN() {
             return issuer;
-        };
+        }
         
         public X500Principal getIssuerX500Principal() {
             return issuer;
@@ -259,7 +275,7 @@
             
         public Principal getSubjectDN() {
             return subject;
-        };
+        }
 
         public X500Principal getSubjectX500Principal() {
             return subject;
@@ -267,45 +283,45 @@
 
         public Date getNotBefore() {
             return null;
-        };
+        }
 
         public Date getNotAfter() {
             return null;
-        };
+        }
 
         public byte[] getTBSCertificate()
                             throws CertificateEncodingException
         {
             return null;
-        };
+        }
 
         public byte[] getSignature() {
             return null;
-        };
+        }
 
         public String getSigAlgName() {
             return null;
-        };
+        }
 
         public String getSigAlgOID() {
             return null;
-        };
+        }
 
         public byte[] getSigAlgParams() {
             return null;
-        };
+        }
 
         public boolean[] getIssuerUniqueID() {
             return null;
-        };
+        }
 
         public boolean[] getSubjectUniqueID() {
             return null;
-        };
+        }
 
         public boolean[] getKeyUsage() {
             return keyUsage;
-        };
+        }
 
         public List/*<String>*/ getExtendedKeyUsage()
                                     throws CertificateParsingException {
@@ -314,7 +330,7 @@
 
         public int getBasicConstraints() {
             return pathLen;
-        };
+        }
 
         public Collection/*<List<?>>*/ getSubjectAlternativeNames()
                                     throws CertificateParsingException {
@@ -357,15 +373,13 @@
         public byte[] getExtensionValue(String oid) {
             if (("2.5.29.14".equals(oid)) || ("2.5.29.35".equals(oid))) {
                 // Extension value is represented as an OctetString
-                return (byte[]) 
-                    ASN1OctetString.getInstance().encode(keyIdentifier);
+                return ASN1OctetString.getInstance().encode(keyIdentifier);
             }
             if ("2.5.29.16".equals(oid)) {
                 PrivateKeyUsagePeriod pkup = 
                                 new PrivateKeyUsagePeriod(notBefore, notAfter);
                 byte[] encoded = pkup.getEncoded();
-                return (byte[]) 
-                    ASN1OctetString.getInstance().encode(encoded);
+                return ASN1OctetString.getInstance().encode(encoded);
             }
             if (("2.5.29.37".equals(oid)) && (extKeyUsage != null)) {
                 ASN1Oid[] oa = new ASN1Oid[extKeyUsage.size()];
@@ -376,13 +390,11 @@
                     oa[id] = ASN1Oid.getInstanceForString();
                     val[id++] = (String) it.next();
                 }
-                return (byte[]) 
-                    ASN1OctetString.getInstance().encode(
+                return ASN1OctetString.getInstance().encode(
                     new ASN1Sequence(oa).encode(val));
             }
             if ("2.5.29.19".equals(oid)) {
-                return (byte[]) 
-                    ASN1OctetString.getInstance().encode(
+                return ASN1OctetString.getInstance().encode(
                             new ASN1Sequence(
                                     new ASN1Type[] {
                                             ASN1Boolean.getInstance(),
@@ -399,8 +411,7 @@
                 if (sans.getNames() == null) {
                     return null;
                 }
-                return (byte[]) 
-                    ASN1OctetString.getInstance().encode(
+                return ASN1OctetString.getInstance().encode(
                             GeneralNames.ASN1.encode(sans));
             }
             if ("2.5.29.32".equals(oid) && (policies != null) 
@@ -413,14 +424,12 @@
                                             new PolicyInformation(policies[i]);
                     certificatePolicies.addPolicyInformation(policyInformation);
                 }
-                return (byte[]) 
-                    ASN1OctetString.getInstance().encode(
+                return ASN1OctetString.getInstance().encode(
                             certificatePolicies.getEncoded());
             }
             if ("2.5.29.30".equals(oid) && (nameConstraints != null)) {
                 // Name Constraints Extension (as specified in rfc 3280)
-                return (byte[]) 
-                    ASN1OctetString.getInstance().encode(
+                return ASN1OctetString.getInstance().encode(
                             nameConstraints.getEncoded());
             }
             return null;
@@ -429,7 +438,7 @@
         public boolean hasUnsupportedCriticalExtension() {
             return false;
         }
-    };
+    }
 
     /* ********************************************************************** */
     /* ************************* Test implementation ************************ */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CertificateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CertificateTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CertificateTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/X509CertificateTest.java Thu Apr  6 23:52:51 2006
@@ -54,73 +54,73 @@
 
             public void checkValidity()
                     throws CertificateExpiredException,
-                           CertificateNotYetValidException {};
+                           CertificateNotYetValidException {}
 
             public void checkValidity(Date date)
                     throws CertificateExpiredException,
-                           CertificateNotYetValidException {};
+                           CertificateNotYetValidException {}
 
             public int getVersion() {
                 return 3;
-            };
+            }
 
             public BigInteger getSerialNumber() {
                 return null;
-            };
+            }
 
             public Principal getIssuerDN() {
                 return null;
-            };
+            }
 
             public Principal getSubjectDN() {
                 return null;
-            };
+            }
 
             public Date getNotBefore() {
                 return null;
-            };
+            }
 
             public Date getNotAfter() {
                 return null;
-            };
+            }
 
             public byte[] getTBSCertificate()
                                 throws CertificateEncodingException
             {
                 return null;
-            };
+            }
 
             public byte[] getSignature() {
                 return null;
-            };
+            }
 
             public String getSigAlgName() {
                 return null;
-            };
+            }
 
             public String getSigAlgOID() {
                 return null;
-            };
+            }
 
             public byte[] getSigAlgParams() {
                 return null;
-            };
+            }
 
             public boolean[] getIssuerUniqueID() {
                 return null;
-            };
+            }
 
             public boolean[] getSubjectUniqueID() {
                 return null;
-            };
+            }
 
             public boolean[] getKeyUsage() {
                 return null;
-            };
+            }
 
             public int getBasicConstraints() {
                 return 0;
-            };
+            }
 
             public void verify(PublicKey key)
                          throws CertificateException, NoSuchAlgorithmException,

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/myCertPath.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/myCertPath.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/myCertPath.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/myCertPath.java Thu Apr  6 23:52:51 2006
@@ -32,7 +32,7 @@
 public class myCertPath extends CertPath {
 
     public List getCertificates() {
-        return (List) (new Vector());
+        return new Vector();
     }
 
     public byte[] getEncoded() {
@@ -52,7 +52,7 @@
     }
 
     public CertPath get(String s) {
-        return (CertPath) (new myCertPath(s));
+        return new myCertPath(s);
     }
 
     public myCertPath(String s, String s1) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertPathTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertPathTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertPathTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertPathTest.java Thu Apr  6 23:52:51 2006
@@ -178,7 +178,7 @@
         serialize(cp1, bos);
         // try to deserialize it
         try {
-            CertPath cp2 = deserialize(new ByteArrayInputStream(bos.toByteArray()));
+            deserialize(new ByteArrayInputStream(bos.toByteArray()));
         } catch (Exception e) {
         	System.out.println(getName() + ": " + e);
             if (e instanceof ObjectStreamException) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertPathValidatorExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertPathValidatorExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertPathValidatorExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertPathValidatorExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -23,7 +23,6 @@
 
 import java.security.cert.CertPath;
 import java.security.cert.CertPathValidatorException;
-import java.security.cert.myCertPath;
 
 import org.apache.harmony.security.test.SerializationTest;
 
@@ -45,9 +44,6 @@
                 msgs[0], cause);
         String msg = null;
         Throwable th = null;
-        byte[] enc = { (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4 };
-        //        MyCertPath mcp = new MyCertPath(enc);
-        myCertPath mcp = new myCertPath("X.509", "");
         return new Object[] { new CertPathValidatorException(),
                 new CertPathValidatorException(msg),
                 new CertPathValidatorException(msgs[1]),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertificateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertificateTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertificateTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/cert/serialization/CertificateTest.java Thu Apr  6 23:52:51 2006
@@ -176,7 +176,7 @@
         serialize(c1, bos);
         // try to deserialize it
         try {
-            Certificate c2 = deserialize(new ByteArrayInputStream(bos.toByteArray()));
+            deserialize(new ByteArrayInputStream(bos.toByteArray()));
         } catch (Exception e) {
         	System.out.println(getName() + ": " + e);
             if (e instanceof ObjectStreamException) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/AccessControlExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/AccessControlExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/AccessControlExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/AccessControlExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -56,7 +56,7 @@
         } else {
             assertTrue(s.equals(test.getMessage()));
         }
-        ;
+
         Permission p = ref.getPermission();
         if (p == null) {
             assertNull(test.getPermission());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/CodeSourceTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/CodeSourceTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/CodeSourceTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/CodeSourceTest.java Thu Apr  6 23:52:51 2006
@@ -98,7 +98,7 @@
         ObjectInputStream ois = new ObjectInputStream(bais);
         
         try {
-            CodeSource got = (CodeSource)ois.readObject();
+            ois.readObject();
             fail("must not pass here");
         }
         catch(ClassNotFoundException ex) {
@@ -121,7 +121,7 @@
             ObjectInputStream ois = new ObjectInputStream(bais);
             
             try {
-                CodeSource got = (CodeSource)ois.readObject();
+                ois.readObject();
                 fail("must not pass here");
             }
             catch(IOException ex) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/KeyPairTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/KeyPairTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/KeyPairTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/KeyPairTest.java Thu Apr  6 23:52:51 2006
@@ -21,14 +21,10 @@
 
 package java.security.serialization;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
 import java.security.Key;
 import java.security.KeyPair;
 import java.security.NoSuchAlgorithmException;
@@ -130,25 +126,6 @@
         deserializeAndCheck(kp, new FileInputStream(fileName));
     }
 
-    /**
-     * Test case start template - serialization
-     *
-     * @param kp
-     * <code>KeyPair</code> object to be serialized
-     * @param os
-     * Serialization <code>OutputStream</code> for <code>kp</code>
-     */
-    private void serialize(KeyPair kp, OutputStream os)
-            throws IOException {
-        ObjectOutputStream oos = new ObjectOutputStream(os);
-        try {
-            // Serialize it to the os
-            oos.writeObject(kp);
-            oos.flush();
-        } finally {
-            oos.close();
-        }
-    }
     /**
      * Test case end template - deserialization and checks
      *

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/SignedObjectTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/SignedObjectTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/SignedObjectTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/serialization/SignedObjectTest.java Thu Apr  6 23:52:51 2006
@@ -79,7 +79,7 @@
     	assertEquals(test.getAlgorithm(), ref.getAlgorithm());
  
         try {
-            assertEquals((Properties)test.getObject(), prop);      	
+            assertEquals(test.getObject(), prop);      	
         } catch (ClassNotFoundException e) {
            	fail(e.toString());  
         } catch (IOException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/ECGenParameterSpecTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/ECGenParameterSpecTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/ECGenParameterSpecTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/ECGenParameterSpecTest.java Thu Apr  6 23:52:51 2006
@@ -62,7 +62,7 @@
      * using valid <code>name</code> 
      */
     public final void testECGenParameterSpec01() {
-        AlgorithmParameterSpec ps = new ECGenParameterSpec("someName");
+        new ECGenParameterSpec("someName");
     }
 
     /**
@@ -73,7 +73,8 @@
      */
     public final void testECGenParameterSpec02() {
         try {
-            AlgorithmParameterSpec ps = new ECGenParameterSpec(null);
+            new ECGenParameterSpec(null);
+            fail("NPE expected");
         } catch (NullPointerException ok) {}
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/InvalidKeySpecExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/InvalidKeySpecExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/InvalidKeySpecExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/InvalidKeySpecExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     private static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not InvalidKeySpecException";
-
     static String createErr(Exception tE, Exception eE) {
         return "InvalidKeySpecException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/InvalidParameterSpecExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/InvalidParameterSpecExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/InvalidParameterSpecExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/InvalidParameterSpecExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -66,8 +66,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not InvalidParameterSpecException";
-
     static String createErr(Exception tE, Exception eE) {
         return "InvalidParameterSpecException:  ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/RSAPrivateCrtKeySpecTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/RSAPrivateCrtKeySpecTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/RSAPrivateCrtKeySpecTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/java/security/spec/RSAPrivateCrtKeySpecTest.java Thu Apr  6 23:52:51 2006
@@ -96,7 +96,7 @@
      * object using valid parameters
      */
     public final void testRSAPrivateCrtKeySpec03() {
-        RSAPrivateKeySpec ks = new RSAPrivateCrtKeySpec(
+        new RSAPrivateCrtKeySpec(
                 null,
                 null,
                 null,
@@ -105,7 +105,6 @@
                 null,
                 null,
                 null);
-        assertTrue(ks instanceof KeySpec);
     }
     
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/PolicyTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/PolicyTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/PolicyTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/PolicyTest.java Thu Apr  6 23:52:51 2006
@@ -329,7 +329,6 @@
 
     public void test_Refresh() {
 
-        PermissionCollection c;
         Permission per;
         Subject subject;
         Enumeration e;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/PrivateCredentialPermissionTest.java Thu Apr  6 23:52:51 2006
@@ -64,7 +64,6 @@
         s_this = "a.b.Credential a.b.Principal \"duke\"";
         p_that = new PrivateCredentialPermission(s_that, "read");
         p_this = new PrivateCredentialPermission(s_this, "read");
-        assertTrue(p_this instanceof PrivateCredentialPermission);
         assertTrue(p_this.implies(p_that));
         assertTrue(p_this.implies(p_this));
     }
@@ -740,8 +739,7 @@
 
     public final void testSerialization_Golden() throws Exception {
 
-        PrivateCredentialPermission z = new PrivateCredentialPermission(
-                "a b \"c\" d \"e\"", "read");
+        new PrivateCredentialPermission("a b \"c\" d \"e\"", "read");
 
         ByteArrayInputStream in = new ByteArrayInputStream(gForm);
         ObjectInputStream sIn = new ObjectInputStream(in);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/SubjectTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/SubjectTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/SubjectTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/SubjectTest.java Thu Apr  6 23:52:51 2006
@@ -192,7 +192,7 @@
         // all sets modifications are denied
         denyPermission(new AuthPermission("*"));
 
-        Subject subject = new Subject(true, h1, h2, h3);
+        new Subject(true, h1, h2, h3);
     }
 
     /**
@@ -202,22 +202,19 @@
     public final void testSubject_3Set_NPE() {
 
         try {
-            Subject subject = new Subject(false, null, new HashSet(),
-                    new HashSet());
+            new Subject(false, null, new HashSet(), new HashSet());
             fail("No expected NullPointerException");
         } catch (NullPointerException e) {
         }
 
         try {
-            Subject subject = new Subject(false, new HashSet(), null,
-                    new HashSet());
+            new Subject(false, new HashSet(), null, new HashSet());
             fail("No expected NullPointerException");
         } catch (NullPointerException e) {
         }
 
         try {
-            Subject subject = new Subject(false, new HashSet(), new HashSet(),
-                    null);
+            new Subject(false, new HashSet(), new HashSet(), null);
             fail("No expected NullPointerException");
         } catch (NullPointerException e) {
         }
@@ -233,8 +230,7 @@
         hash.add(null);
 
         try {
-            Subject subject = new Subject(false, hash, new HashSet(),
-                    new HashSet());
+            new Subject(false, hash, new HashSet(), new HashSet());
 
             if (!testing) {
                 // possible to add 'null' principal via constructor
@@ -244,8 +240,7 @@
         }
 
         try {
-            Subject subject = new Subject(false, new HashSet(), hash,
-                    new HashSet());
+            new Subject(false, new HashSet(), hash, new HashSet());
 
             if (!testing) {
                 fail("No expected NullPointerException");
@@ -254,8 +249,7 @@
         }
 
         try {
-            Subject subject = new Subject(false, new HashSet(), new HashSet(),
-                    hash);
+            new Subject(false, new HashSet(), new HashSet(), hash);
 
             if (!testing) {
                 fail("No expected NullPointerException");
@@ -266,8 +260,7 @@
         hash.clear();
         hash.add(new Object());
         try {
-            Subject subject = new Subject(false, hash, new HashSet(),
-                    new HashSet());
+            new Subject(false, hash, new HashSet(), new HashSet());
 
             if (!testing) {
                 // possible to add 'null' principal via constructor

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/UnsupportedCallbackExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/UnsupportedCallbackExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/UnsupportedCallbackExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/UnsupportedCallbackExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -41,7 +41,7 @@
      */
     public final void testUnsupportedCallbackException_01() {
         UnsupportedCallbackException ce = new UnsupportedCallbackException(nc);
-        assertEquals((Callback)nc, ce.getCallback());
+        assertEquals(nc, ce.getCallback());
         try {
             throw ce;
         }catch (Exception e){
@@ -55,14 +55,14 @@
      * Test for UnsupportedCallbackException(Callback c, String msg) ctor 
      */
     public final void testUnsupportedCallbackException_02() {
-        UnsupportedCallbackException ce = new UnsupportedCallbackException((Callback)nc, "message");
+        UnsupportedCallbackException ce = new UnsupportedCallbackException(nc, "message");
         assertEquals ("message", ce.getMessage());
-        assertEquals((Callback)nc, ce.getCallback());
+        assertEquals(nc, ce.getCallback());
         try {
             throw ce;
         }catch (Exception e){
             assertTrue(ce.equals(e));
-            assertEquals((Callback)nc, ce.getCallback());
+            assertEquals(nc, ce.getCallback());
         }
 
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerChoiceCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerChoiceCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerChoiceCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerChoiceCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -42,13 +42,12 @@
         String prompt = "prompt";
         int defaultChoice = 1;
         String[] choices = {"AAA", "BBB"};
-        int index[] = {1, 2, 3};
         
         return new Object[] {new ChoiceCallback(prompt, choices, defaultChoice, true)};
     }
 
     protected void assertDeserialized(Object golden, Object test) {
-        assertTrue(((ChoiceCallback) golden) instanceof ChoiceCallback);
+        assertTrue(golden instanceof ChoiceCallback);
         assertEquals(((ChoiceCallback) golden).getPrompt(),
                 ((ChoiceCallback) test).getPrompt());
         assertEquals(((ChoiceCallback) golden).getDefaultChoice(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerLanguageCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerLanguageCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerLanguageCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerLanguageCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -44,7 +44,7 @@
     }
 
     protected void assertDeserialized(Object golden, Object test) {
-        assertTrue(((LanguageCallback) test) instanceof LanguageCallback);
+        assertTrue(test instanceof LanguageCallback);
         assertEquals(((LanguageCallback) golden).getLocale(),
                 ((LanguageCallback) test).getLocale());
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerNameCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerNameCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerNameCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerNameCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -43,7 +43,7 @@
     }
 
     protected void assertDeserialized(Object golden, Object test) {
-        assertTrue(((NameCallback) test) instanceof NameCallback);
+        assertTrue(test instanceof NameCallback);
         assertEquals(((NameCallback) golden).getDefaultName(),
                 ((NameCallback) test).getDefaultName());
         assertEquals(((NameCallback) golden).getName(), ((NameCallback) test)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerPasswordCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerPasswordCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerPasswordCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerPasswordCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -45,13 +45,13 @@
 
   
     protected void assertDeserialized(Object golden, Object test) {
-        assertTrue(((PasswordCallback) test) instanceof PasswordCallback);
+        assertTrue(test instanceof PasswordCallback);
         assertEquals(((PasswordCallback) golden).getPrompt(),
                 ((PasswordCallback) test).getPrompt());
         if (((PasswordCallback) test).getPassword() != null) {
-            assertEquals(new String((char[]) ((PasswordCallback) golden)
+            assertEquals(new String(((PasswordCallback) golden)
                     .getPassword()), new String(
-                    (char[]) ((PasswordCallback) test).getPassword()));
+                    ((PasswordCallback) test).getPassword()));
         }
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerTextInputCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerTextInputCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerTextInputCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerTextInputCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -43,7 +43,7 @@
     }
 
     protected void assertDeserialized(Object golden, Object test) {
-        assertTrue(((TextInputCallback) test) instanceof TextInputCallback);
+        assertTrue(test instanceof TextInputCallback);
         assertEquals(((TextInputCallback) golden).getDefaultText(),
                 ((TextInputCallback) test).getDefaultText());
         assertEquals(((TextInputCallback) golden).getPrompt(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerTextOutputCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerTextOutputCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerTextOutputCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerTextOutputCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -42,7 +42,7 @@
     }
 
     protected void assertDeserialized(Object golden, Object test) {
-        assertTrue(((TextOutputCallback) test) instanceof TextOutputCallback);
+        assertTrue(test instanceof TextOutputCallback);
         assertEquals(((TextOutputCallback) golden).getMessage(),
                 ((TextOutputCallback) test).getMessage());
         assertEquals(((TextOutputCallback) golden).getMessageType(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerUnsupportedCallbackExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerUnsupportedCallbackExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerUnsupportedCallbackExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/callback/serialization/SerUnsupportedCallbackExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -21,7 +21,6 @@
 
 package javax.security.auth.callback.serialization;
 
-import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.LanguageCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
 
@@ -41,7 +40,7 @@
     }
 
     protected Object[] getData() {
-        return new Object[] {new UnsupportedCallbackException((Callback) nc)};
+        return new Object[] {new UnsupportedCallbackException(nc)};
     }
     
     protected void assertDeserialized(Object golden, Object test) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java Thu Apr  6 23:52:51 2006
@@ -64,49 +64,48 @@
      * testing of a incorrect ctor
      */
     public void testFailCtor() {
-        DelegationPermission dp;
         try {
-            dp = new DelegationPermission(null);
+            new DelegationPermission(null);
             fail("no expected NPE");
         } catch(NullPointerException e){
         }
         try {
-            dp = new DelegationPermission("");
+            new DelegationPermission("");
             fail("no expected IAE");
         } catch(IllegalArgumentException e){
         }
         try {
-            dp = new DelegationPermission("\"aaa.bbb.com\" ccc.ddd.com");
+            new DelegationPermission("\"aaa.bbb.com\" ccc.ddd.com");
             fail("Target name must be enveloped by quotes");
         } catch(IllegalArgumentException e){
         }
         try {
-            dp = new DelegationPermission("\"aaa.bbb.com\" ccc.ddd.com\"");
+            new DelegationPermission("\"aaa.bbb.com\" ccc.ddd.com\"");
             fail("Target name must be enveloped by quotes");
         } catch(IllegalArgumentException e){
         }
         try {
-            dp = new DelegationPermission("\"aaa.bbb.com\" \"ccc.ddd.com");
+            new DelegationPermission("\"aaa.bbb.com\" \"ccc.ddd.com");
             fail("Target name must be enveloped by quotes");
         } catch(IllegalArgumentException e){
         }
         try {
-            dp = new DelegationPermission("\" \" \" \"");
-            //XXX fail("Target name is empty");
+            new DelegationPermission("\" \" \" \"");
+            //TODO: fail("Target name is empty");
         }catch(IllegalArgumentException e){
         }
         try {
-            dp = new DelegationPermission("\"\"");
+            new DelegationPermission("\"\"");
             fail("Target name is incorrect");
         } catch(IllegalArgumentException e){
         } 
         try {
-            dp = new DelegationPermission("\"aaa.bbb.com\" \"\"");
+            new DelegationPermission("\"aaa.bbb.com\" \"\"");
             fail("service principal is empty");
         } catch(IllegalArgumentException e){
         }
         try {
-            dp = new DelegationPermission("\"\" \"aaa.bbb.com\"");
+            new DelegationPermission("\"\" \"aaa.bbb.com\"");
             fail("subordinate service principal is empty");
         } catch(IllegalArgumentException e){
         }
@@ -114,14 +113,11 @@
     }
 
     public void testFailCtor_2() {
-        DelegationPermission dp = null;
         try {
-            dp = new DelegationPermission("\"AAA\"");
+            new DelegationPermission("\"AAA\"");
             fail("target name should be specifies a pair of kerberos service principals");
         } catch (IllegalArgumentException e) {
         }
-        //dp.equals(dp);
-        //dp.implies(dp);
     } 
     
     // testing of the equals method



Mime
View raw message