harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r392202 [4/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/javax/security/auth/kerberos/ServicePermissionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java Thu Apr  6 23:52:51 2006
@@ -55,74 +55,74 @@
     
     public void testFailedCtor() {
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read");
         	fail("incorrect actions"); 
         } catch(IllegalArgumentException e){
         }
 
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "");
         	fail("actions is empty"); 
         } catch(IllegalArgumentException e){
         }
 
         try {
-            ServicePermission sp = new ServicePermission("krbtgt/AAA.COM@BBB.COM", null);
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", null);
         	fail("actions is null");
         } catch(NullPointerException e){
         } catch(IllegalArgumentException e){}
 
         try {
-            ServicePermission sp = new ServicePermission(null, "accept");
+            new ServicePermission(null, "accept");
         	fail("permission is null");
         } catch(NullPointerException e){
         }
         try {
-            ServicePermission sp = new ServicePermission("", "accept");
-        	//fail("No expected IAE");  // 
+            new ServicePermission("", "accept");
+        	//TODO: fail("No expected IAE");  // 
         } catch(IllegalArgumentException e){}
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "accept, read");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "accept, read");
         	fail("Incorrect actions"); 
         } catch(IllegalArgumentException e){
         }
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, read");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, read");
         	fail("Incorrect actions"); 
         } catch(IllegalArgumentException e){
         }
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read, initiate ");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read, initiate ");
         	fail("Incorrect actions"); 
         } catch(Exception e){
         }
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read, accept ");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "read, accept ");
         	fail("Incorrect actions"); 
         }catch(IllegalArgumentException e){
         }
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", ", accept ");
-        	//fail("No expected IAE"); 
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", ", accept ");
+        	//TODO: fail("No expected IAE"); 
         } catch(IllegalArgumentException e){
         }
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, accept, read");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, accept, read");
         	fail("Incorrect actions"); 
         } catch(IllegalArgumentException e){
         }
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, read, accept");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, read, accept");
         	fail("Incorrect actions"); 
         } catch(IllegalArgumentException e){
         }
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, accept, accept");
-        	//fail("Incorrect actions"); 
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate, accept, accept");
+        	//TODO: fail("Incorrect actions"); 
         } catch(IllegalArgumentException e){
         }
         try {
-            ServicePermission sp1 = new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate accept");
+            new ServicePermission("krbtgt/AAA.COM@BBB.COM", "initiate accept");
         	fail("Incorrect actions"); 
         } catch(IllegalArgumentException e){
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/serialization/DelegationPermissionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/serialization/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/serialization/DelegationPermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/kerberos/serialization/DelegationPermissionTest.java Thu Apr  6 23:52:51 2006
@@ -39,7 +39,7 @@
     }
 
     protected void assertDeserialized(Object golden, Object test) {
-        assertTrue(((DelegationPermission) golden) instanceof DelegationPermission);
+        assertTrue(golden instanceof DelegationPermission);
         assertEquals(((DelegationPermission) golden).getName(),
                 ((DelegationPermission) test).getName());
     }

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/login/LoginContextTest_1.java Thu Apr  6 23:52:51 2006
@@ -331,12 +331,6 @@
 
         public CallbackHandler cbHandler;
 
-        private Subject subject;
-
-        private Map sharedState;
-
-        private Map options;
-
         //
         private int mask;
 
@@ -475,10 +469,7 @@
         public void initialize(Subject subject,
                 CallbackHandler callbackHandler, Map sharedState, Map options) {
 
-            this.subject = subject;
             this.cbHandler = callbackHandler;
-            this.sharedState = sharedState;
-            this.options = options;
             initCalled = true;
 
             boolean doit = ((mask == -1) && (staticMask & FAIL_AT_INIT) != 0)
@@ -724,7 +715,7 @@
 
         Security.setProperty(DEFAULT_CBHANDLER_PROPERTY, klassName);
         // This also shows that the cbHandler is instantiated at the ctor
-        LoginContext lc = new LoginContext(CONFIG_NAME);
+        new LoginContext(CONFIG_NAME);
         assertTrue(TestCallbackHandler.size() == 1);
         // ugh... cant set 'null' here... 
         Security.setProperty(DEFAULT_CBHANDLER_PROPERTY, "");
@@ -1072,7 +1063,7 @@
         TestConfig.clear();
         boolean expectedResult = ((Boolean) variants[0][2]).booleanValue();
         String caseName = variants[0][1].toString();
-        ;
+
         int startIndex = 0;
         for (int i = 0; i < variants.length; i++) {
             int flag = ((Integer) variants[i][0]).intValue();
@@ -2046,7 +2037,7 @@
         lc.login();
         lc.logout();
         //
-        assertTrue(TestCallbackHandler_Contexted.size() == 1);
+        assertTrue(TestCallbackHandler.size() == 1);
 
         // now, get abort() called
         TestLoginModule.staticMask = TestLoginModule.FAIL_AT_LOGIN;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java Thu Apr  6 23:52:51 2006
@@ -736,9 +736,7 @@
     public void testGetNameUnicodeNormalized() throws Exception {
         String unicodeStr = "CN= \u0401\u0410";
         X500Principal principal = new X500Principal(unicodeStr);
-        String s = principal.getName(X500Principal.CANONICAL);
-        //System.out.println("s = " + s);
-        //assertEquals("CN=\u0415\u0308\u0410".toLowerCase(Locale.US), s);
+        principal.getName(X500Principal.CANONICAL);
     }
 
     /**
@@ -875,7 +873,7 @@
     public void testIllegalInputName_15() {
         try {
             String dn = "CN=,C";
-            X500Principal p = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper attribute value");
         } catch (IllegalArgumentException e) {
         }
@@ -884,7 +882,7 @@
     public void testIllegalInputName_16() {
         try {
             String dn = "CN=,C=+";
-            X500Principal p = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper attribute value");
         } catch (IllegalArgumentException e) {
         }
@@ -910,7 +908,7 @@
     public void testIllegalInputName_05() {
         try {
             String dn = "CN=X+YZ";
-            X500Principal p = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper attribute value");
         } catch (IllegalArgumentException e) {
         }
@@ -956,7 +954,7 @@
     public void testIllegalInputName_09() {
         try {
             String dn = "CN=#";
-            X500Principal p = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper attribute hex value");
         } catch (IllegalArgumentException e) {
             //ignore
@@ -971,7 +969,7 @@
     public void testIllegalInputName_10() {
         try {
             String dn = "CN=#13";
-            X500Principal p = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper attribute hex value");
         } catch (IllegalArgumentException e) {
             //ignore
@@ -986,7 +984,7 @@
     public void testIllegalInputName_11() {
         try {
             String dn = "CN=#1301";
-            X500Principal p = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper attribute hex value");
         } catch (IllegalArgumentException e) {
             //ignore
@@ -1001,7 +999,7 @@
     public void testIllegalInputName_12() {
         try {
             String dn = "CN=#13010101";
-            X500Principal p = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper attribute hex value");
         } catch (IllegalArgumentException e) {
         }
@@ -1014,7 +1012,7 @@
     public void testIllegalInputName_13() {
         try {
             String dn = "CN=# 0";
-            X500Principal p = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper attribute hex value");
         } catch (IllegalArgumentException e) {
         }
@@ -1486,7 +1484,7 @@
     public void testNameWithQuotation_01() throws Exception {
         String dn = "CN=\"ABCDEF";
         try {
-            X500Principal principal = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on string with no closing quotations");
         } catch (IllegalArgumentException e) {
         }
@@ -1800,7 +1798,7 @@
     public void testNameQu() throws Exception {
         String dn = "CN=\"\"B";
         try {
-            X500Principal principal = new X500Principal(dn);
+            new X500Principal(dn);
             fail("No IllegalArgumentException on improper string");
         } catch (IllegalArgumentException e) {
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java Thu Apr  6 23:52:51 2006
@@ -163,7 +163,7 @@
 	
 	public void testIllegalArg() {
 		try {
-			X500PrivateCredential cred= new X500PrivateCredential(cert, key, null);
+			new X500PrivateCredential(cert, key, null);
 			fail("No IllegalArgumentException on null value");
 		}
 		catch(IllegalArgumentException e) {
@@ -173,7 +173,7 @@
 
 	public void testIllegalArg_0() {
 		try {
-			X500PrivateCredential cred= new X500PrivateCredential(cert, null, null);
+			new X500PrivateCredential(cert, null, null);
 			fail("No IllegalArgumentException on null value");
 		}
 		catch(IllegalArgumentException e) {
@@ -183,7 +183,7 @@
 
 	public void testIllegalArg_1() {
 		try {
-			X500PrivateCredential cred= new X500PrivateCredential(null, key, "");
+			new X500PrivateCredential(null, key, "");
 			fail("No IllegalArgumentException on null value");
 		}
 		catch(IllegalArgumentException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateEncodingExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateEncodingExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateEncodingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateEncodingExceptionTest.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 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/javax/security/cert/CertificateExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateExceptionTest.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 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/javax/security/cert/CertificateExpiredExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateExpiredExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateExpiredExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/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/javax/security/cert/CertificateNotYetValidExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateNotYetValidExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateNotYetValidExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/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/javax/security/cert/CertificateParsingExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateParsingExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateParsingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/CertificateParsingExceptionTest.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 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/javax/security/cert/X509CertificateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/X509CertificateTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/X509CertificateTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/cert/X509CertificateTest.java Thu Apr  6 23:52:51 2006
@@ -22,14 +22,10 @@
 package javax.security.cert;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.security.Security;
 import java.security.cert.CertificateFactory;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
-import java.util.Iterator;
 import javax.security.cert.CertificateEncodingException;
 import javax.security.cert.CertificateException;
 import javax.security.cert.X509Certificate;
@@ -103,9 +99,7 @@
             ByteArrayInputStream bais =
                 new ByteArrayInputStream(cert.getEncoded());
 
-            X509Certificate c = X509Certificate.getInstance(bais);
-            assertTrue("The returned value is not an instance "
-                        + "of X509Certificate", c instanceof X509Certificate);
+            X509Certificate.getInstance(bais);
         } catch (java.security.cert.CertificateEncodingException e) {
             e.printStackTrace();
             fail("Unexpected CertificateEncodingException was thrown.");
@@ -128,9 +122,7 @@
             return;
         }
         try {
-            X509Certificate c = X509Certificate.getInstance(cert.getEncoded());
-            assertTrue("The returned value is not an instance "
-                        + "of X509Certificate", c instanceof X509Certificate);
+            X509Certificate.getInstance(cert.getEncoded());
         } catch (java.security.cert.CertificateEncodingException e) {
             e.printStackTrace();
             fail("Unexpected CertificateEncodingException was thrown.");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -49,8 +49,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not AuthenticationException";
-
     static String createErr(Exception tE, Exception eE) {
         return "AuthenticationException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());
@@ -64,7 +62,6 @@
     public void testAuthenticationException01() {
         AuthenticationException tE;
         tE = new AuthenticationException();
-        assertTrue(errNotExc, tE instanceof AuthenticationException);
         assertNull("getMessage() must return null", tE.getMessage());
         assertNull("getCause() must return null", tE.getCause());
     }
@@ -79,8 +76,6 @@
         AuthenticationException tE;
         for (int i = 0; i < msgs.length; i++) {
             tE = new AuthenticationException(msgs[i]);
-            assertTrue(errNotExc.concat(" (detail: ").concat(msgs[i]).concat(")"),
-                    tE instanceof AuthenticationException);
             assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                     .getMessage(), msgs[i]);
             assertNull("getCause() must return null", tE.getCause());
@@ -99,7 +94,6 @@
     public void testAuthenticationException03() {
         String msg = null;
         AuthenticationException tE = new AuthenticationException(msg);
-        assertTrue(errNotExc, tE instanceof AuthenticationException);
         assertNull("getMessage() must return null.", tE.getMessage());
         assertNull("getCause() must return null", tE.getCause());
         try {
@@ -116,7 +110,6 @@
      */
     public void testAuthenticationException04() {
         AuthenticationException tE = new AuthenticationException(null, null);
-        assertTrue(errNotExc, tE instanceof AuthenticationException);
         assertNull("getMessage() must return null", tE.getMessage());
         assertNull("getCause() must return null", tE.getCause());
         try {
@@ -135,8 +128,6 @@
         AuthenticationException tE;
         for (int i = 0; i < msgs.length; i++) {
             tE = new AuthenticationException(msgs[i], null);
-            assertTrue(errNotExc.concat(" (detail: ").concat(msgs[i]).concat(")"),
-                    tE instanceof AuthenticationException);
             assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                     .getMessage(), msgs[i]);
             assertNull("getCause() must return null", tE.getCause());
@@ -155,7 +146,6 @@
      */
     public void testAuthenticationException06() {        
         AuthenticationException tE = new AuthenticationException(null, tCause);
-        assertTrue(errNotExc, tE instanceof AuthenticationException);
         if (tE.getMessage() != null) {
             String toS = tCause.toString();
             String getM = tE.getMessage();
@@ -180,8 +170,6 @@
         AuthenticationException tE;
         for (int i = 0; i < msgs.length; i++) {
             tE = new AuthenticationException(msgs[i], tCause);
-            assertTrue(errNotExc.concat(" (detail: ").concat(msgs[i]).concat(")"),
-                    tE instanceof AuthenticationException);
             String getM = tE.getMessage();
             String toS = tCause.toString();
             if (msgs[i].length() > 0) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -40,7 +40,6 @@
      */
     public void test01() {
         AuthorizeCallback auth = new AuthorizeCallback(null, null);
-        assertTrue(auth instanceof AuthorizeCallback);
         assertNull(auth.getAuthenticationID());
         assertNull(auth.getAuthorizationID());
         assertNull(auth.getAuthorizedID());
@@ -83,7 +82,6 @@
             for (int j = 0; j < authorizedIDs.length; j++) {
                 auth = new AuthorizeCallback(authenticationIDs[i],
                         authorizedIDs[j]);
-                assertTrue(auth instanceof AuthorizeCallback);
                 assertEquals(auth.getAuthenticationID(), authenticationIDs[i]);
                 assertEquals(auth.getAuthorizationID(), authorizedIDs[j]);
                 assertNull(auth.getAuthorizedID());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/RealmCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/RealmCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/RealmCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/RealmCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -22,7 +22,6 @@
 package javax.security.sasl;
 
 import junit.framework.TestCase;
-;
 
 /**
  * Tests for constructors and methods of RealmCallback class
@@ -90,7 +89,6 @@
         for (int i = 0; i < prompts.length; i++) {
             for (int j = 0; j < prompts.length; j++) {
                 rCB = new RealmCallback(prompts[i], defInfo[j]);
-                assertTrue("Incorrect object", rCB instanceof RealmCallback);
                 assertEquals("Incoorect default info", rCB.getDefaultText(),
                         defInfo[j]);
                 assertEquals("Incorrect prompt", rCB.getPrompt(), prompts[i]);
@@ -134,7 +132,6 @@
         String ss;
         for (int i = 0; i < prompts.length; i++) {
             rCB = new RealmCallback(prompts[i]);
-            assertTrue("Incorrect object", rCB instanceof RealmCallback);
             assertNull("Incoorect default info", rCB.getDefaultText());
             assertEquals("Incorrect prompt", rCB.getPrompt(), prompts[i]);
             assertNull("Not null text", rCB.getText());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/RealmChoiceCallbackTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/RealmChoiceCallbackTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/RealmChoiceCallbackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/RealmChoiceCallbackTest.java Thu Apr  6 23:52:51 2006
@@ -120,7 +120,6 @@
         RealmChoiceCallback rCCB;
         for (int i = 0; i < prompts.length; i++) {
             rCCB = new RealmChoiceCallback(prompts[i], choices, 0, false);
-            assertTrue("Incorrect object", rCCB instanceof RealmChoiceCallback);
             assertEquals("Incorrect prompt", rCCB.getPrompt(), prompts[i]);
             String [] ch = rCCB.getChoices();
             assertEquals("Incorrect choices length", ch.length, choices.length);
@@ -161,7 +160,6 @@
         RealmChoiceCallback rCCB;
         for (int i = 0; i < prompts.length; i++) {
             rCCB = new RealmChoiceCallback(prompts[i], choices, 0, true);
-            assertTrue("Incorrect object", rCCB instanceof RealmChoiceCallback);
             assertEquals("Incorrect prompt", rCCB.getPrompt(), prompts[i]);
             String[] ch = rCCB.getChoices();
             assertEquals("Incorrect choices length", ch.length, choices.length);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -58,8 +58,6 @@
  
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not SaslException";
-
     static String createErr(Exception tE, Exception eE) {
         return "SaslException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());
@@ -73,7 +71,6 @@
     public void testSaslException01() {
         SaslException tE;
         tE = new SaslException();
-        assertTrue(errNotExc, tE instanceof SaslException);
         assertNull("getMessage() must return null", tE.getMessage());
         assertNull("getCause() must return null", tE.getCause());
     }
@@ -88,8 +85,6 @@
         SaslException tE;
         for (int i = 0; i < msgs.length; i++) {
             tE = new SaslException(msgs[i]);
-            assertTrue(errNotExc.concat(" (detail: ").concat(msgs[i]).concat(")"),
-                    tE instanceof SaslException);
             assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                     .getMessage(), msgs[i]);
             assertNull("getCause() must return null", tE.getCause());
@@ -108,7 +103,6 @@
     public void testSaslException03() {
         String msg = null;
         SaslException tE = new SaslException(msg);
-        assertTrue(errNotExc, tE instanceof SaslException);
         assertNull("getMessage() must return null.", tE.getMessage());
         assertNull("getCause() must return null", tE.getCause());
         try {
@@ -125,7 +119,6 @@
      */
     public void testSaslException04() {
         SaslException tE = new SaslException(null, null);
-        assertTrue(errNotExc, tE instanceof SaslException);
         assertNull("getMessage() must return null", tE.getMessage());
         assertNull("getCause() must return null", tE.getCause());
         try {
@@ -144,8 +137,6 @@
         SaslException tE;
         for (int i = 0; i < msgs.length; i++) {
             tE = new SaslException(msgs[i], null);
-            assertTrue(errNotExc.concat(" (detail: ").concat(msgs[i]).concat(")"),
-                    tE instanceof SaslException);
             assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                     .getMessage(), msgs[i]);
             assertNull("getCause() must return null", tE.getCause());
@@ -164,7 +155,6 @@
      */
     public void testSaslException06() {        
         SaslException tE = new SaslException(null, tCause);
-        assertTrue(errNotExc, tE instanceof SaslException);
         if (tE.getMessage() != null) {
             String toS = tCause.toString();
             String getM = tE.getMessage();
@@ -194,8 +184,6 @@
         SaslException tE;
         for (int i = 0; i < msgs.length; i++) {
             tE = new SaslException(msgs[i], tCause);
-            assertTrue(errNotExc.concat(" (detail: ").concat(msgs[i]).concat(")"),
-                    tE instanceof SaslException);
             String getM = tE.getMessage();
             String toS = tCause.toString();
             if (msgs[i].length() > 0) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest2.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest2.java Thu Apr  6 23:52:51 2006
@@ -47,8 +47,6 @@
 
     private static final String fClientClass01 = "javax.security.sasl.myClientFactory01";
 
-    private static final String fClientClass02 = "javax.security.sasl.myClientFactory02";
-
     private static final String fServerClass01 = "javax.security.sasl.myServerFactory01";
 
     private static final String fServerClass02 = "javax.security.sasl.myServerFactory02";
@@ -213,9 +211,7 @@
                 .hasMoreElements());
 
         myClientFactory01 mm1 = new myClientFactory01();
-        myClientFactory02 mm2 = new myClientFactory02();
         String[] mech01 = mm1.getMechanismNames(null);
-        String[] mech02 = mm1.getMechanismNames(null);
         int l = 0;
         while (en.hasMoreElements()) {
             SaslClientFactory f = (SaslClientFactory) en.nextElement();
@@ -437,9 +433,7 @@
                 .hasMoreElements());
 
         myServerFactory01 mm1 = new myServerFactory01();
-        myServerFactory02 mm2 = new myServerFactory02();
         String[] mech01 = mm1.getMechanismNames(null);
-        String[] mech02 = mm1.getMechanismNames(null);
         int l = 0;
         while (en.hasMoreElements()) {
             SaslServerFactory f = (SaslServerFactory) en.nextElement();
@@ -497,7 +491,6 @@
         assertNotNull("List of SaslServerFactories should not be null", en);
         assertTrue("List of SaslServerFactories should have elements", en
                 .hasMoreElements());
-        myServerFactory02 mm = new myServerFactory02();
         int l = 0;
         while (en.hasMoreElements()) {
             SaslServerFactory f = (SaslServerFactory) en.nextElement();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest3.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest3.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest3.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest3.java Thu Apr  6 23:52:51 2006
@@ -191,7 +191,6 @@
         SaslClient saslC = Sasl.createSaslClient(new String[] { "NAME-2" },
                 null, "protocol", null, null, cbH);
         assertNotNull("Null result", saslC);
-        assertTrue("Not SaslClient", saslC instanceof SaslClient);
         try {
             saslC.unwrap(null, 1, 1);
             fail("SaslException sould be thrown");
@@ -228,7 +227,6 @@
         SaslClient saslC = Sasl.createSaslClient(new String[] { "NAME-2" },
                 null, "protocol", null, null, cbH);
         assertNotNull("Null result for NAME-2", saslC);
-        assertTrue("Not SaslClient", saslC instanceof SaslClient);
         assertFalse("Incorrect isComplete() result", saslC.isComplete());
         // try to create client for wrong mechanism
         try {
@@ -276,7 +274,6 @@
         saslC = Sasl.createSaslClient(new String[] { "NAME-2" }, null,
                 "protocol", null, null, cbH);
         assertNotNull("Null result for NAME-2", saslC);
-        assertTrue("Incorrect object", saslC instanceof SaslClient);
         try {
             saslC.unwrap(null, 1, 1);
             fail("SaslException sould be thrown");
@@ -297,7 +294,6 @@
         saslC = Sasl.createSaslClient(new String[] { "NAME-6", "NAME-5" },
                 null, "protocol", null, null, cbH);
         assertNotNull("Null result for NAME-6 and NAME-5", saslC);
-        assertTrue("Incorrect object", saslC instanceof SaslClient);
     }
 }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest4.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest4.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest4.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/SaslTest4.java Thu Apr  6 23:52:51 2006
@@ -189,7 +189,6 @@
         SaslServer saslS = Sasl.createSaslServer("MECH-2", "protocol", null,
                 null, cbH);
         assertNotNull("Null result", saslS);
-        assertTrue("Not SaslServer", saslS instanceof SaslServer);
         try {
             saslS.unwrap(null, 1, 1);
             fail("SaslException sould be thrown");
@@ -228,7 +227,6 @@
         SaslServer saslS = Sasl.createSaslServer("MECH-2", "protocol", null,
                 null, cbH);
         assertNotNull("Null result for MECH-2", saslS);
-        assertTrue("Not SaslServer", saslS instanceof SaslServer);
         assertFalse("Incorrect isComplete() result", saslS.isComplete());
         // try to create Server for wrong mechanism
         try {
@@ -276,7 +274,6 @@
 
         saslS = Sasl.createSaslServer("MECH-2", "protocol", null, null, cbH);
         assertNotNull("Null result for MECH-2", saslS);
-        assertTrue("Incorrect object", saslS instanceof SaslServer);
         try {
             saslS.unwrap(null, 1, 1);
             fail("SaslException sould be thrown");
@@ -294,10 +291,8 @@
         // in another provider
         saslS = Sasl.createSaslServer("MECH-6", "protocol", null, null, cbH);
         assertNotNull("Null result for MECH-6", saslS);
-        assertTrue("Incorrect object", saslS instanceof SaslServer);
         saslS = Sasl.createSaslServer("MECH-5", "protocol", null, null, cbH);
         assertNotNull("Null result for MECH-5", saslS);
-        assertTrue("Incorrect object", saslS instanceof SaslServer);
     }
 }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/serialization/AuthenticationExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/serialization/AuthenticationExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/serialization/AuthenticationExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/serialization/AuthenticationExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -39,7 +39,6 @@
     protected Object[] getData() {
         String msg = null;
         Exception cause = new Exception(msgs[1]);
-        AuthenticationException excAuthorication = new AuthenticationException(msgs[0]);
         return new Object[] { new AuthenticationException(),
                 new AuthenticationException(msg),
                 new AuthenticationException(msgs[1]),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/serialization/SaslExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/serialization/SaslExceptionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/serialization/SaslExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/javax/security/sasl/serialization/SaslExceptionTest.java Thu Apr  6 23:52:51 2006
@@ -39,7 +39,6 @@
     protected Object[] getData() {
         String msg = null;
         Exception cause = new Exception(msgs[1]);
-        SaslException excSasl = new SaslException(msgs[0]);
         return new Object[] { new SaslException(),
                 new SaslException(msg),
                 new SaslException(msgs[1]),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/SystemScopeTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/SystemScopeTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/SystemScopeTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/SystemScopeTest.java Thu Apr  6 23:52:51 2006
@@ -21,11 +21,11 @@
 
 package org.apache.harmony.security;
 
-import junit.framework.TestCase;
-import java.security.*;
+import java.security.Identity;
+import java.security.IdentityScope;
+import java.security.KeyManagementException;
 import java.util.Enumeration;
 
-import org.apache.harmony.security.SystemScope;
 import junit.framework.TestCase;
 
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/TestCertUtils.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/TestCertUtils.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/TestCertUtils.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/TestCertUtils.java Thu Apr  6 23:52:51 2006
@@ -53,7 +53,7 @@
 
     private TestCertUtils() {
         throw new Error("statics only");
-    };
+    }
 
     /**
      * Returns new instance of test certificate each time the method is called.
@@ -618,8 +618,6 @@
             int len;
             try {
                 while ((len = is.read(chunk)) > 0) {
-                    String sch = new String(chunk);
-                    String sdata = new String(data);
                     byte[] tmp = new byte[data.length + len];
                     System.arraycopy(data, 0, tmp, 0, data.length);
                     System.arraycopy(chunk, 0, tmp, data.length, len);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/BooleanTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/BooleanTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/BooleanTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/BooleanTest.java Thu Apr  6 23:52:51 2006
@@ -21,16 +21,15 @@
 
 package org.apache.harmony.security.asn1.der;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.util.Arrays;
 
+import junit.framework.TestCase;
+
 import org.apache.harmony.security.asn1.ASN1Boolean;
 import org.apache.harmony.security.asn1.ASN1Exception;
 import org.apache.harmony.security.asn1.DerInputStream;
 import org.apache.harmony.security.asn1.DerOutputStream;
-
-import junit.framework.TestCase;
 
 
 /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/ChoiceTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/ChoiceTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/ChoiceTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/ChoiceTest.java Thu Apr  6 23:52:51 2006
@@ -185,11 +185,10 @@
 
         byte[] encoded = new byte[] { (byte) 0xA0, 0x03, 0x01, 0x01, 0x00 };
 
-        assertEquals("False: ", Boolean.FALSE, (Boolean) explicit
-                .decode(encoded));
+        assertEquals("False: ", Boolean.FALSE, explicit.decode(encoded));
 
         encoded[4] = (byte) 0xFF;
 
-        assertEquals("True: ", Boolean.TRUE, (Boolean) explicit.decode(encoded));
+        assertEquals("True: ", Boolean.TRUE, explicit.decode(encoded));
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/OidTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/OidTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/OidTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/asn1/der/OidTest.java Thu Apr  6 23:52:51 2006
@@ -107,8 +107,7 @@
     public void testEncode() throws IOException {
 
         for (int i = 0; i < oid.length; i++) {
-            DerOutputStream out = new DerOutputStream(ASN1Oid.getInstance(),
-                    (int[]) oid[i][1]);
+            DerOutputStream out = new DerOutputStream(ASN1Oid.getInstance(), oid[i][1]);
             assertTrue((String) oid[i][0], Arrays.equals((byte[]) oid[i][2],
                     out.encoded));
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/cert/TestUtils.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/cert/TestUtils.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/cert/TestUtils.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/cert/TestUtils.java Thu Apr  6 23:52:51 2006
@@ -27,7 +27,6 @@
 import java.io.IOException;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
-import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
 import java.security.cert.CertPathValidatorException;
 import java.security.cert.CertStore;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CRLImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CRLImplTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CRLImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CRLImplTest.java Thu Apr  6 23:52:51 2006
@@ -21,31 +21,27 @@
 package org.apache.harmony.security.provider.cert;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.math.BigInteger;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.PrivateKey;
 import java.security.PublicKey;
 import java.security.Signature;
-import java.security.cert.CRL;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
 import java.security.cert.CRLException;
+import java.security.cert.CertificateFactory;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.Set;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.PublicKey;
-import java.security.PrivateKey;
+
 import javax.security.auth.x500.X500Principal;
 
-import org.apache.harmony.security.asn1.ASN1GeneralizedTime;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
 import org.apache.harmony.security.asn1.ASN1Integer;
-import org.apache.harmony.security.asn1.ASN1OctetString;
-import org.apache.harmony.security.provider.cert.X509CRLImpl;
-import org.apache.harmony.security.provider.cert.X509CertImpl;
 import org.apache.harmony.security.x501.Name;
 import org.apache.harmony.security.x509.AlgorithmIdentifier;
 import org.apache.harmony.security.x509.AuthorityKeyIdentifier;
@@ -59,10 +55,6 @@
 import org.apache.harmony.security.x509.TBSCertList;
 import org.apache.harmony.security.x509.TBSCertificate;
 import org.apache.harmony.security.x509.Validity;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * X509CRLImplTest

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryImplTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryImplTest.java Thu Apr  6 23:52:51 2006
@@ -24,19 +24,12 @@
 import java.io.ByteArrayInputStream;
 import java.security.cert.CRL;
 import java.security.cert.CRLException;
-import java.security.cert.CertPath;
 import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.Iterator;
 
-import org.apache.harmony.security.pkcs7.ContentInfo;
-import org.apache.harmony.security.pkcs7.SignedData;
-import org.apache.harmony.security.provider.cert.X509CertFactoryImpl;
-
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -99,7 +92,6 @@
      */
     public void testEngineGenerateCertificates() {
         X509CertFactoryImpl certFactory = new X509CertFactoryImpl();
-        Certificate cert;
         
         // DER encoded certificate generation testing
         ByteArrayInputStream bais = 
@@ -159,7 +151,6 @@
      */
     public void testEngineGenerateCRLs() {
         X509CertFactoryImpl certFactory = new X509CertFactoryImpl();
-        CRL crl;
         
         // DER encoded crt generation testing
         ByteArrayInputStream bais = 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryPerfTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryPerfTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryPerfTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryPerfTest.java Thu Apr  6 23:52:51 2006
@@ -333,7 +333,6 @@
     }
 
     private static int XXX = 0, flag = 0;
-    private static java.security.cert.Certificate prev = null;
 
     public void testCreationCRL() {
         try {
@@ -653,7 +652,7 @@
             if (certSans == null) {
                 fail("Returned value should not be null.");
             }
-            List sans = (List) extnSANames.getPairsList();
+            List sans = extnSANames.getPairsList();
             if (sans.size() != certSans.size()) {
                 fail("Size of returned collection does not match to the actual");
             }
@@ -663,7 +662,7 @@
                 Integer tag = (Integer) extnSan.get(0);
                 for (int i=0; i< sans.size(); i++) {
                     List san = (List) sans.get(i);
-                    if (tag.equals((Integer) san.get(0))) {
+                    if (tag.equals(san.get(0))) {
                         assertEquals(
                                 "Incorrect value of Subject Alternative Name",
                                 extnSan.get(1), san.get(1));
@@ -684,7 +683,7 @@
             if (certIans == null) {
                 fail("Returned value should not be null.");
             }
-            List ians = (List) extnSANames.getPairsList();
+            List ians = extnSANames.getPairsList();
             if (ians.size() != certIans.size()) {
                 fail("Size of returned collection does not match to the actual");
             }
@@ -694,7 +693,7 @@
                 Integer tag = (Integer) extnIan.get(0);
                 for (int i=0; i< ians.size(); i++) {
                     List ian = (List) ians.get(i);
-                    if (tag.equals((Integer) ian.get(0))) {
+                    if (tag.equals(ian.get(0))) {
                         assertEquals(
                                 "Incorrect value of Issuer Alternative Name",
                                 extnIan.get(1), ian.get(1));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertImplTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertImplTest.java Thu Apr  6 23:52:51 2006
@@ -532,7 +532,7 @@
             if (certSans == null) {
                 fail("Returned value should not be null.");
             }
-            List sans = (List) extnSANames.getPairsList();
+            List sans = extnSANames.getPairsList();
             if (sans.size() != certSans.size()) {
                 fail("Size of returned collection does not match to the actual");
             }
@@ -542,7 +542,7 @@
                 Integer tag = (Integer) extnSan.get(0);
                 for (int i=0; i< sans.size(); i++) {
                     List san = (List) sans.get(i);
-                    if (tag.equals((Integer) san.get(0))) {
+                    if (tag.equals(san.get(0))) {
                         assertEquals(
                                 "Incorrect value of Subject Alternative Name",
                                 extnSan.get(1), san.get(1));
@@ -563,7 +563,7 @@
             if (certIans == null) {
                 fail("Returned value should not be null.");
             }
-            List ians = (List) extnSANames.getPairsList();
+            List ians = extnSANames.getPairsList();
             if (ians.size() != certIans.size()) {
                 fail("Size of returned collection does not match to the actual");
             }
@@ -573,7 +573,7 @@
                 Integer tag = (Integer) extnIan.get(0);
                 for (int i=0; i< ians.size(); i++) {
                     List ian = (List) ians.get(i);
-                    if (tag.equals((Integer) ian.get(0))) {
+                    if (tag.equals(ian.get(0))) {
                         assertEquals(
                                 "Incorrect value of Issuer Alternative Name",
                                 extnIan.get(1), ian.get(1));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertPathImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertPathImplTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertPathImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/provider/cert/X509CertPathImplTest.java Thu Apr  6 23:52:51 2006
@@ -22,22 +22,13 @@
 package org.apache.harmony.security.provider.cert;
 
 import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.security.cert.CertPath;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.harmony.security.asn1.BerInputStream;
-import org.apache.harmony.security.provider.cert.X509CertImplTest;
-import org.apache.harmony.security.provider.cert.X509CertPathImpl;
-import org.apache.harmony.security.x509.Certificate;
-
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -144,34 +135,15 @@
     /**
      * getEncoded() method testing.
      */
-    public void testGetEncoded1() {
-        try {
-            byte[] encoding = certPath.getEncoded();
-        } catch (CertificateEncodingException e) {
-            e.printStackTrace();
-            fail("Unexpected CertificateEncodingException was thrown:"
-                    + e.getMessage());
-        } catch (CertificateException e) {
-            e.printStackTrace();
-            fail("Unexpected CertificateException was thrown:"
-                    + e.getMessage());
-        }
+    public void testGetEncoded1() throws Exception {
+        certPath.getEncoded();
     }
     
     /**
      * getEncoded(String encoding) method testing.
      */
-    public void testGetEncoded2() {
-        try {
-            certPath.getEncoded("ABRACADABRA");
-            fail("CertificateEncodingException should be thrown");
-        } catch (CertificateEncodingException e) {
-            // pass
-        } catch (CertificateException e) {
-            e.printStackTrace();
-            fail("Unexpected CertificateException was thrown:"
-                    + e.getMessage());
-        }
+    public void testGetEncoded2() throws Exception {
+        certPath.getEncoded("ABRACADABRA");
     }
     
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/test/SecurityTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/test/SecurityTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/test/SecurityTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/test/SecurityTest.java Thu Apr  6 23:52:51 2006
@@ -896,9 +896,6 @@
         }
 
         public void testToArray_NotEmptySet() {
-
-            Object[] sample;
-
             set.add(element);
             assertEquals("Set is not empty", set.toArray().length, 1);
             assertTrue("Set element", set.toArray()[0] == element);
@@ -1419,8 +1416,6 @@
         }
 
         public void testToArray_NotEmptySet() {
-            Object[] sample;
-
             set.add(element);
             setReadOnly();
 
@@ -1701,8 +1696,6 @@
         }
 
         public void testToArray_NotEmptySet() {
-            Object[] sample;
-
             set.add(element);
             setSecure();
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x/security/auth/login/DefaultConfigParserTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x/security/auth/login/DefaultConfigParserTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x/security/auth/login/DefaultConfigParserTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x/security/auth/login/DefaultConfigParserTest.java Thu Apr  6 23:52:51 2006
@@ -114,7 +114,6 @@
 	 */
 	public final void testConfigParser_02() throws Exception {
 
-			DefaultConfigurationParser dcp  =  new DefaultConfigurationParser();
 			Map config = DefaultConfigurationParser.configParser(url, p, new HashMap());
 			entriesList = (LinkedList) config.get("Login1");
 
@@ -144,8 +143,6 @@
 	 * @throws Exception
 	 */
 	public final void testNegConfig() throws Exception {
-
-		final String path = p.getProperty("java.io.tmpdir") + File.separator;
 		String[] str = {
 				
 				"Login ERR {\n com.intel.security.auth.module.LoginModule required debug=\"true\" test=false;\n};",
@@ -179,7 +176,7 @@
 			os.flush();
 			os.close();
 			try {
-				Map config = DefaultConfigurationParser.configParser(file.toURL(), p, new HashMap());
+				DefaultConfigurationParser.configParser(file.toURL(), p, new HashMap());
 				fail("no expected InvalidFormatException" + i);
 			} catch (NullPointerException e) {
 				System.out.println(file.getCanonicalPath());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificateListTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificateListTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificateListTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificateListTest.java Thu Apr  6 23:52:51 2006
@@ -24,35 +24,23 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
+import java.math.BigInteger;
 import java.security.cert.CertificateFactory;
 import java.security.cert.X509CRL;
 import java.security.cert.X509CRLEntry;
-import java.math.BigInteger;
 import java.util.Arrays;
-import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.harmony.security.asn1.ASN1GeneralizedTime;
-import org.apache.harmony.security.asn1.ASN1Integer;
-import org.apache.harmony.security.asn1.ASN1OctetString;
-import org.apache.harmony.security.x501.Name;
-import org.apache.harmony.security.x509.AlgorithmIdentifier;
-import org.apache.harmony.security.x509.CertificateList;
-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.TBSCertList;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.harmony.security.asn1.ASN1GeneralizedTime;
+import org.apache.harmony.security.asn1.ASN1Integer;
+import org.apache.harmony.security.x501.Name;
+
 /**
  * CertificateListTest
  */
@@ -216,7 +204,7 @@
         Set rcerts = crl.getRevokedCertificates();
         System.out.println(">> rcerts:"+rcerts);
  
-        System.out.println("}>> "+((X509CRLEntry) rcerts.toArray()[0]));
+        System.out.println("}>> "+ rcerts.toArray()[0]);
         System.out.println("}>> "+((X509CRLEntry) rcerts.toArray()[0]).getCertificateIssuer());
         System.out.println("}>> "+((X509CRLEntry) rcerts.toArray()[1]).getCertificateIssuer());
         System.out.println("}>> "+((X509CRLEntry) rcerts.toArray()[2]).getCertificateIssuer());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificatePoliciesTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificatePoliciesTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificatePoliciesTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificatePoliciesTest.java Thu Apr  6 23:52:51 2006
@@ -23,9 +23,6 @@
 
 import java.util.Iterator;
 import java.util.List;
-import org.apache.harmony.security.asn1.*;
-import org.apache.harmony.security.x509.CertificatePolicies;
-import org.apache.harmony.security.x509.PolicyInformation;
 
 import junit.framework.Test;
 import junit.framework.TestCase;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificateTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificateTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/CertificateTest.java Thu Apr  6 23:52:51 2006
@@ -21,33 +21,20 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.*;
-import java.math.*;
-import java.util.*;
-import java.security.cert.*;
-
-import org.apache.harmony.security.asn1.ASN1Integer;
-
-import org.apache.harmony.security.asn1.*;
-import org.apache.harmony.security.x501.Name;
-import org.apache.harmony.security.x509.AlgorithmIdentifier;
-import org.apache.harmony.security.x509.Certificate;
-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.NameConstraints;
-import org.apache.harmony.security.x509.ORAddress;
-import org.apache.harmony.security.x509.OtherName;
-import org.apache.harmony.security.x509.SubjectPublicKeyInfo;
-import org.apache.harmony.security.x509.TBSCertificate;
-import org.apache.harmony.security.x509.Validity;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.math.BigInteger;
+import java.security.cert.CertificateFactory;
+import java.util.Arrays;
+import java.util.Date;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.harmony.security.asn1.ASN1Integer;
+import org.apache.harmony.security.x501.Name;
+
 /**
  * Testing the encoding/decoding work of the following structure:
  * (as specified in RFC 3280 -
@@ -155,33 +142,31 @@
         extensions.addExtension(extension);
         
         byte[] encoding = extensions.getEncoded();
-        Extensions exts = (Extensions) Extensions.ASN1.decode(encoding);
+        Extensions.ASN1.decode(encoding);
         
         TBSCertificate tbsCertificate = new TBSCertificate(version, serialNumber, 
                 signature, issuer, validity, subject, subjectPublicKeyInfo, 
                 issuerUniqueID, subjectUniqueID, extensions);
 
         encoding = tbsCertificate.getEncoded();
-        TBSCertificate tbsCert = (TBSCertificate) 
-            TBSCertificate.ASN1.decode(encoding);
+        TBSCertificate.ASN1.decode(encoding);
 
         Certificate certificate = new Certificate(tbsCertificate, signature, new byte[10]);
 
         encoding = certificate.getEncoded();
         
-        Certificate cert = (Certificate) Certificate.ASN1.decode(encoding);
+        Certificate.ASN1.decode(encoding);
 
         encoding = Certificate.ASN1.encode(certificate);
         
-        ByteArrayInputStream bais =
-            new ByteArrayInputStream(encoding);
+        ByteArrayInputStream bais = new ByteArrayInputStream(encoding);
 
-        try {
+        //try {
             CertificateFactory cf = CertificateFactory.getInstance("X.509");
-            X509Certificate _cert = (X509Certificate) cf.generateCertificate(bais);
-        } catch (CertificateException e) {
+            cf.generateCertificate(bais);
+        //} catch (CertificateException e) {
             // there is no X.509 certificate factory implementation installed
-        }
+        //}
     }
     
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/EDIPartyNameTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/EDIPartyNameTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/EDIPartyNameTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/EDIPartyNameTest.java Thu Apr  6 23:52:51 2006
@@ -21,13 +21,7 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.*;
-import java.security.cert.*;
-import java.util.*;
-import org.apache.harmony.security.asn1.*;
-import org.apache.harmony.security.x509.EDIPartyName;
-import org.apache.harmony.security.x509.GeneralName;
-import org.apache.harmony.security.x509.GeneralNames;
+import java.util.Arrays;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -80,7 +74,7 @@
                 printAsHex(16, "", " ", _encoded);
                 System.out.println("");
                 pass = false;
-            };
+            }
 
             GeneralName gName = new GeneralName(ediPN);
             encoded = gName.getEncoded();
@@ -102,7 +96,7 @@
                 printAsHex(16, "", " ", _encoded);
                 System.out.println("");
                 pass = false;
-            };
+            }
 
             GeneralNames gNames = new GeneralNames();
             gNames.addName(gName);
@@ -126,7 +120,7 @@
                 printAsHex(16, "", " ", _encoded);
                 System.out.println("");
                 pass = false;
-            };
+            }
         } catch (Exception e) {
             e.printStackTrace();
             fail("Unexpected Exception was thrown.");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/GeneralNameTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/GeneralNameTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/GeneralNameTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/GeneralNameTest.java Thu Apr  6 23:52:51 2006
@@ -21,12 +21,11 @@
 
 package org.apache.harmony.security.x509;
 
-import org.apache.harmony.security.x501.Name;
-import org.apache.harmony.security.x509.*;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
+
+import org.apache.harmony.security.x501.Name;
 
 
 /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/ORAddressTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/ORAddressTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/ORAddressTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/java/common/org/apache/harmony/security/x509/ORAddressTest.java Thu Apr  6 23:52:51 2006
@@ -21,12 +21,6 @@
 
 package org.apache.harmony.security.x509;
 
-import java.io.*;
-
-import org.apache.harmony.security.x509.GeneralName;
-import org.apache.harmony.security.x509.GeneralNames;
-import org.apache.harmony.security.x509.ORAddress;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java Thu Apr  6 23:52:51 2006
@@ -27,7 +27,6 @@
 import java.security.Security;
 import java.security.KeyStore;
 import java.util.Iterator;
-import java.util.Set;
 
 import org.apache.harmony.security.fortress.Engine;
 import org.apache.harmony.security.fortress.Services;
@@ -55,7 +54,6 @@
 
     private static SSLContext findDefault() {
         // FIXME EXPORT CONTROL
-        Set s;
         Provider.Service service;
         for (Iterator it1 = Services.getProvidersList().iterator(); it1
                 .hasNext();) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java Thu Apr  6 23:52:51 2006
@@ -22,12 +22,10 @@
 package javax.net.ssl;
 
 import java.io.IOException;
-import javax.net.SocketFactory;
-
-import junit.framework.TestCase;
-
 import java.net.ServerSocket;
 import java.security.cert.Certificate;
+
+import junit.framework.TestCase;
 
 
 /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java Thu Apr  6 23:52:51 2006
@@ -90,7 +90,7 @@
 
     public final void testGetDefaultSSLSocketFactory() {
         SSLSocketFactory sf = HttpsURLConnection.getDefaultSSLSocketFactory();
-        if (!sf.equals((SSLSocketFactory) SSLSocketFactory.getDefault())) {
+        if (!sf.equals(SSLSocketFactory.getDefault())) {
             fail("incorrect DefaultSSLSocketFactory");
         }
     }
@@ -98,7 +98,7 @@
     public final void testGetSSLSocketFactory() {
         HttpsURLConnection con = new MyHttpsURLConnection(null);
         SSLSocketFactory sf = con.getSSLSocketFactory();
-        if (!sf.equals((SSLSocketFactory) SSLSocketFactory.getDefault())) {
+        if (!sf.equals(SSLSocketFactory.getDefault())) {
             fail("incorrect DefaultSSLSocketFactory");
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyManagerFactorySpiTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyManagerFactorySpiTests.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyManagerFactorySpiTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyManagerFactorySpiTests.java Thu Apr  6 23:52:51 2006
@@ -52,8 +52,7 @@
      * Assertion: constructs KeyManagerFactorySpi
      */
     public void testKeyManagerFactorySpi01() {
-        KeyManagerFactorySpi kmfSpi = (KeyManagerFactorySpi) new MyKeyManagerFactorySpi();
-        assertTrue(kmfSpi instanceof KeyManagerFactorySpi);
+        KeyManagerFactorySpi kmfSpi = new MyKeyManagerFactorySpi();
         assertNull(kmfSpi.engineGetKeyManagers());
         KeyStore kStore = null;
         ManagerFactoryParameters mfp = null;
@@ -97,13 +96,13 @@
         } catch (Exception e) {
             fail("Unexpected: ".concat(e.toString()));
         }
-        mfp = (ManagerFactoryParameters) new MyKeyManagerFactorySpi.Parameters(kStore, null);
+        mfp = new MyKeyManagerFactorySpi.Parameters(kStore, null);
         try {
             kmfSpi.engineInit(mfp);
             fail("InvalidAlgorithmParameterException must be thrown");
         } catch (InvalidAlgorithmParameterException e) {
         }
-        mfp = (ManagerFactoryParameters) new MyKeyManagerFactorySpi.Parameters(kStore, pass);
+        mfp = new MyKeyManagerFactorySpi.Parameters(kStore, pass);
         try {
             kmfSpi.engineInit(mfp);
         } catch (InvalidAlgorithmParameterException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/MySSLContextSpi.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/MySSLContextSpi.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/MySSLContextSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/MySSLContextSpi.java Thu Apr  6 23:52:51 2006
@@ -45,7 +45,7 @@
     protected SSLSocketFactory engineGetSocketFactory() {
         if (!init) {
             throw new RuntimeException("Not initialiazed");
-        };   
+        }   
         return null;
     }
 
@@ -111,7 +111,7 @@
         public String[] getEnabledCipherSuites() { return null; }
         public String[] getEnabledProtocols() {return null; }
         public boolean getEnableSessionCreation() { return true; }
-        public SSLEngineResult.HandshakeStatus getHandshakeStatus() { return null; };
+        public SSLEngineResult.HandshakeStatus getHandshakeStatus() { return null; }
         public boolean getNeedClientAuth() { return true; }
         public SSLSession getSession() { return null; }
         public String[] getSupportedCipherSuites()  { return null; }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLContextSpiTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLContextSpiTests.java?rev=392202&r1=392201&r2=392202&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLContextSpiTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLContextSpiTests.java Thu Apr  6 23:52:51 2006
@@ -22,8 +22,6 @@
 package javax.net.ssl;
 
 import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 
 import javax.net.ssl.SSLContextSpi;
@@ -51,7 +49,7 @@
      * Assertion: constructs SSLContextSpi
      */
     public void testSSLContextSpi01() throws KeyManagementException {
-        SSLContextSpi sslConSpi = (SSLContextSpi) new MySSLContextSpi();
+        SSLContextSpi sslConSpi = new MySSLContextSpi();
         try {
             sslConSpi.engineGetSocketFactory();
             fail("RuntimeException must be thrown");
@@ -89,7 +87,6 @@
             assertEquals("Incorrect message", e.getMessage(),"Not initialiazed");
         }
         sslConSpi.engineInit(null, null, new SecureRandom());
-        assertTrue("Not SSLContextSpi object", sslConSpi instanceof SSLContextSpi);
         assertNull("Not null result", sslConSpi.engineGetSocketFactory());
         assertNull("Not null result", sslConSpi.engineGetServerSocketFactory());
         assertNotNull("Null result", sslConSpi.engineCreateSSLEngine());



Mime
View raw message