harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r443539 [9/29] - in /incubator/harmony/enhanced/classlib/trunk/modules/security: ./ .settings/ META-INF/ make/ src/main/java/common/java/security/ src/main/java/common/java/security/acl/ src/main/java/common/java/security/cert/ src/main/jav...
Date Fri, 15 Sep 2006 01:18:16 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Identity2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Identity2Test.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Identity2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Identity2Test.java Thu Sep 14 18:17:39 2006
@@ -1,310 +1,310 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.java.security;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.Identity;
-import java.security.IdentityScope;
-import java.security.KeyManagementException;
-import java.security.KeyPairGenerator;
-import java.security.Principal;
-import java.security.PublicKey;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-
-import org.apache.harmony.security.tests.java.security.IdentityScope2Test.IdentityScopeSubclass;
-
-public class Identity2Test extends junit.framework.TestCase {
-
-    static PublicKey pubKey;
-    static {
-        try {
-            pubKey = KeyPairGenerator.getInstance("DSA").genKeyPair().getPublic();
-        } catch (Exception e) {
-            fail(e.toString());
-        }
-    }
-
-	public static class CertificateImpl implements java.security.Certificate {
-
-		X509Certificate cert;
-
-		public CertificateImpl(X509Certificate cert) {
-			this.cert = cert;
-		}
-
-		public Principal getGuarantor() {
-			return cert.getIssuerDN();
-		}
-
-		public void encode(OutputStream out) {
-		}
-
-		public void decode(InputStream in) {
-		}
-
-		public String toString() {
-			return "";
-		}
-
-		public String toString(boolean b) {
-			return "";
-		}
-
-		public String getFormat() {
-			return cert.getType();
-		}
-
-		public Principal getPrincipal() {
-			return cert.getSubjectDN();
-		}
-
-		public PublicKey getPublicKey() {
-			return cert.getPublicKey();
-		}
-	}
-
-	String certificate = "-----BEGIN CERTIFICATE-----\n"
-			+ "MIICZTCCAdICBQL3AAC2MA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw\n"
-			+ "HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl\n"
-			+ "IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NzAyMjAwMDAwMDBa\n"
-			+ "Fw05ODAyMjAyMzU5NTlaMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv\n"
-			+ "cm5pYTESMBAGA1UEBxMJUGFsbyBBbHRvMR8wHQYDVQQKExZTdW4gTWljcm9zeXN0\n"
-			+ "ZW1zLCBJbmMuMSEwHwYDVQQLExhUZXN0IGFuZCBFdmFsdWF0aW9uIE9ubHkxGjAY\n"
-			+ "BgNVBAMTEWFyZ29uLmVuZy5zdW4uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
-			+ "iQKBgQCofmdY+PiUWN01FOzEewf+GaG+lFf132UpzATmYJkA4AEA/juW7jSi+LJk\n"
-			+ "wJKi5GO4RyZoyimAL/5yIWDV6l1KlvxyKslr0REhMBaD/3Z3EsLTTEf5gVrQS6sT\n"
-			+ "WMoSZAyzB39kFfsB6oUXNtV8+UKKxSxKbxvhQn267PeCz5VX2QIDAQABMA0GCSqG\n"
-			+ "SIb3DQEBAgUAA34AXl3at6luiV/7I9MN5CXYoPJYI8Bcdc1hBagJvTMcmlqL2uOZ\n"
-			+ "H9T5hNMEL9Tk6aI7yZPXcw/xI2K6pOR/FrMp0UwJmdxX7ljV6ZtUZf7pY492UqwC\n"
-			+ "1777XQ9UEZyrKJvF5ntleeO0ayBqLGVKCWzWZX9YsXCpv47FNLZbupE=\n"
-			+ "-----END CERTIFICATE-----\n";
-
-	ByteArrayInputStream certArray = new ByteArrayInputStream(certificate
-			.getBytes());
-
-	String certificate2 = "-----BEGIN CERTIFICATE-----\n"
-			+ "MIICZzCCAdCgAwIBAgIBGzANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJVUzEY\n"
-			+ "MBYGA1UEChMPVS5TLiBHb3Zlcm5tZW50MQwwCgYDVQQLEwNEb0QxDDAKBgNVBAsT\n"
-			+ "A1BLSTEcMBoGA1UEAxMTRG9EIFBLSSBNZWQgUm9vdCBDQTAeFw05ODA4MDMyMjAy\n"
-			+ "MjlaFw0wODA4MDQyMjAyMjlaMGExCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9VLlMu\n"
-			+ "IEdvdmVybm1lbnQxDDAKBgNVBAsTA0RvRDEMMAoGA1UECxMDUEtJMRwwGgYDVQQD\n"
-			+ "ExNEb0QgUEtJIE1lZCBSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n"
-			+ "gQDbrM/J9FrJSX+zxFUbsI9Vw5QbguVBIa95rwW/0M8+sM0r5gd+DY6iubm6wnXk\n"
-			+ "CSvbfQlFEDSKr4WYeeGp+d9WlDnQdtDFLdA45tCi5SHjnW+hGAmZnld0rz6wQekF\n"
-			+ "5xQaa5A6wjhMlLOjbh27zyscrorMJ1O5FBOWnEHcRv6xqQIDAQABoy8wLTAdBgNV\n"
-			+ "HQ4EFgQUVrmYR6m9701cHQ3r5kXyG7zsCN0wDAYDVR0TBAUwAwEB/zANBgkqhkiG\n"
-			+ "9w0BAQUFAAOBgQDVX1Y0YqC7vekeZjVxtyuC8Mnxbrz6D109AX07LEIRzNYzwZ0w\n"
-			+ "MTImSp9sEzWW+3FueBIU7AxGys2O7X0qmN3zgszPfSiocBuQuXIYQctJhKjF5KVc\n"
-			+ "VGQRYYlt+myhl2vy6yPzEVCjiKwMEb1Spu0irCf+lFW2hsdjvmSQMtZvOw==\n"
-			+ "-----END CERTIFICATE-----\n";
-
-	ByteArrayInputStream certArray2 = new ByteArrayInputStream(certificate2
-			.getBytes());
-
-	public static class IdentitySubclass extends Identity {
-		public IdentitySubclass() {
-			super();
-		}
-
-		public IdentitySubclass(String name) {
-			super(name);
-		}
-
-		public IdentitySubclass(String name, IdentityScope scope)
-				throws KeyManagementException {
-			super(name, scope);
-		}
-	}
-
-	/**
-	 * @tests java.security.Identity#Identity()
-	 */
-	public void test_Constructor() {
-		new IdentitySubclass();
-	}
-
-	/**
-	 * @tests java.security.Identity#Identity(java.lang.String)
-	 */
-	public void test_ConstructorLjava_lang_String() {
-		new IdentitySubclass("test");
-	}
-
-	/**
-	 * @tests java.security.Identity#Identity(java.lang.String,
-	 *        java.security.IdentityScope)
-	 */
-	public void test_ConstructorLjava_lang_StringLjava_security_IdentityScope() throws Exception {
-       		new IdentitySubclass("test", new IdentityScopeSubclass());
-	}
-
-	/**
-	 * @tests java.security.Identity#getScope()
-	 */
-	public void test_getScope() throws Exception {
-       		IdentityScope scope = new IdentityScopeSubclass();
-       		IdentitySubclass sub = new IdentitySubclass("test", scope);
-       		IdentityScope returnedScope = sub.getScope();
-       		assertEquals("Wrong Scope returned", scope, returnedScope);
-	}
-
-	/**
-	 * @tests java.security.Identity#getPublicKey()
-	 */
-	public void test_getPublicKey() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test",
-       				new IdentityScopeSubclass());
-       		sub.setPublicKey(pubKey);
-       		PublicKey returnedPubKey = sub.getPublicKey();
-       		assertEquals("Wrong PublicKey returned", pubKey, returnedPubKey);
-	}
-
-	/**
-	 * @tests java.security.Identity#getName()
-	 */
-	public void test_getName() throws Exception {
-       		String name = "test";
-       		IdentitySubclass sub = new IdentitySubclass(name,
-       				new IdentityScopeSubclass());
-       		assertEquals("Wrong Name returned", name, sub.getName());
-	}
-
-	/**
-	 * @tests java.security.Identity#getInfo()
-	 */
-	public void test_getInfo() throws Exception {
-       		String info = "This is the general information.";
-       		IdentitySubclass sub = new IdentitySubclass("test",
-       				new IdentityScopeSubclass());
-       		sub.setInfo(info);
-       		assertEquals("Wrong Info returned", info, sub.getInfo());
-	}
-
-	/**
-	 * @tests java.security.Identity#certificates()
-	 */
-	public void test_certificates() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test",
-       				new IdentityScopeSubclass());
-       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
-       		X509Certificate cert[] = new X509Certificate[1];
-       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
-       		sub.setPublicKey(cert[0].getPublicKey());
-       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
-       		sub.addCertificate(certImpl);
-       		java.security.Certificate[] certs = sub.certificates();
-       		assertEquals("Certificate not contained in the identity",
-       				certs[0], certImpl);
-	}
-
-	/**
-	 * @tests java.security.Identity#addCertificate(java.security.Certificate)
-	 */
-	public void test_addCertificateLjava_security_Certificate() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test",
-       				new IdentityScopeSubclass());
-       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
-       		X509Certificate cert[] = new X509Certificate[1];
-       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
-       		sub.setPublicKey(cert[0].getPublicKey());
-       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
-       		sub.addCertificate(certImpl);
-	}
-
-	/**
-	 * @tests java.security.Identity#removeCertificate(java.security.Certificate)
-	 */
-	public void test_removeCertificateLjava_security_Certificate() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test",
-       				new IdentityScopeSubclass());
-       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
-       		X509Certificate cert[] = new X509Certificate[1];
-       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
-       		sub.setPublicKey(cert[0].getPublicKey());
-       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
-       		sub.addCertificate(certImpl);
-       		sub.removeCertificate(certImpl);
-       		java.security.Certificate[] certs = sub.certificates();
-       		assertEquals("Certificate not removed", 0, certs.length);
-	}
-
-	/**
-	 * @tests java.security.Identity#equals(java.lang.Object)
-	 */
-	public void test_equalsLjava_lang_Object() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test",
-       				new IdentityScopeSubclass());
-       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
-       		X509Certificate cert[] = new X509Certificate[1];
-       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
-       		sub.setPublicKey(cert[0].getPublicKey());
-       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
-       		sub.addCertificate(certImpl);
-       		IdentitySubclass sub2 = new IdentitySubclass("test",
-       				new IdentityScopeSubclass());
-       		assertEquals("the two Identity objects are not equal", sub2, sub);
-	}
-
-	/**
-	 * @tests java.security.Identity#identityEquals(java.security.Identity)
-	 */
-	public void test_identityEqualsLjava_security_Identity() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test", null);
-       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
-       		X509Certificate cert[] = new X509Certificate[1];
-       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
-       		sub.setPublicKey(cert[0].getPublicKey());
-       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
-       		sub.addCertificate(certImpl);
-       		IdentitySubclass sub2 = new IdentitySubclass("test", null);
-       		sub2.setPublicKey(cert[0].getPublicKey());
-       		assertEquals("the two Identity objects are not identity-equal",
-       				sub2, sub);
-	}
-
-	/**
-	 * @tests java.security.Identity#toString()
-	 */
-	public void test_toString() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test", null);
-       		assertNotNull(sub.toString());
-       		assertTrue("The String returned is not valid", sub.toString()
-       				.length() > 0);
-	}
-
-	/**
-	 * @tests java.security.Identity#toString(boolean)
-	 */
-	public void test_toStringZ() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test", null);
-       		assertNotNull(sub.toString(true));
-       		assertTrue("The String returned is not valid", sub.toString(true)
-       				.length() > 0);
-	}
-
-	/**
-	 * @tests java.security.Identity#hashCode()
-	 */
-	public void test_hashCode() throws Exception {
-       		IdentitySubclass sub = new IdentitySubclass("test", null);
-       		IdentitySubclass sub2 = new IdentitySubclass("test", null);
-       		assertEquals("The 2 hash codes are not equal", sub.hashCode(), sub2
-       				.hashCode());
-	}
-}
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.security.tests.java.security;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.Identity;
+import java.security.IdentityScope;
+import java.security.KeyManagementException;
+import java.security.KeyPairGenerator;
+import java.security.Principal;
+import java.security.PublicKey;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+
+import org.apache.harmony.security.tests.java.security.IdentityScope2Test.IdentityScopeSubclass;
+
+public class Identity2Test extends junit.framework.TestCase {
+
+    static PublicKey pubKey;
+    static {
+        try {
+            pubKey = KeyPairGenerator.getInstance("DSA").genKeyPair().getPublic();
+        } catch (Exception e) {
+            fail(e.toString());
+        }
+    }
+
+	public static class CertificateImpl implements java.security.Certificate {
+
+		X509Certificate cert;
+
+		public CertificateImpl(X509Certificate cert) {
+			this.cert = cert;
+		}
+
+		public Principal getGuarantor() {
+			return cert.getIssuerDN();
+		}
+
+		public void encode(OutputStream out) {
+		}
+
+		public void decode(InputStream in) {
+		}
+
+		public String toString() {
+			return "";
+		}
+
+		public String toString(boolean b) {
+			return "";
+		}
+
+		public String getFormat() {
+			return cert.getType();
+		}
+
+		public Principal getPrincipal() {
+			return cert.getSubjectDN();
+		}
+
+		public PublicKey getPublicKey() {
+			return cert.getPublicKey();
+		}
+	}
+
+	String certificate = "-----BEGIN CERTIFICATE-----\n"
+			+ "MIICZTCCAdICBQL3AAC2MA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw\n"
+			+ "HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl\n"
+			+ "IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NzAyMjAwMDAwMDBa\n"
+			+ "Fw05ODAyMjAyMzU5NTlaMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv\n"
+			+ "cm5pYTESMBAGA1UEBxMJUGFsbyBBbHRvMR8wHQYDVQQKExZTdW4gTWljcm9zeXN0\n"
+			+ "ZW1zLCBJbmMuMSEwHwYDVQQLExhUZXN0IGFuZCBFdmFsdWF0aW9uIE9ubHkxGjAY\n"
+			+ "BgNVBAMTEWFyZ29uLmVuZy5zdW4uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
+			+ "iQKBgQCofmdY+PiUWN01FOzEewf+GaG+lFf132UpzATmYJkA4AEA/juW7jSi+LJk\n"
+			+ "wJKi5GO4RyZoyimAL/5yIWDV6l1KlvxyKslr0REhMBaD/3Z3EsLTTEf5gVrQS6sT\n"
+			+ "WMoSZAyzB39kFfsB6oUXNtV8+UKKxSxKbxvhQn267PeCz5VX2QIDAQABMA0GCSqG\n"
+			+ "SIb3DQEBAgUAA34AXl3at6luiV/7I9MN5CXYoPJYI8Bcdc1hBagJvTMcmlqL2uOZ\n"
+			+ "H9T5hNMEL9Tk6aI7yZPXcw/xI2K6pOR/FrMp0UwJmdxX7ljV6ZtUZf7pY492UqwC\n"
+			+ "1777XQ9UEZyrKJvF5ntleeO0ayBqLGVKCWzWZX9YsXCpv47FNLZbupE=\n"
+			+ "-----END CERTIFICATE-----\n";
+
+	ByteArrayInputStream certArray = new ByteArrayInputStream(certificate
+			.getBytes());
+
+	String certificate2 = "-----BEGIN CERTIFICATE-----\n"
+			+ "MIICZzCCAdCgAwIBAgIBGzANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJVUzEY\n"
+			+ "MBYGA1UEChMPVS5TLiBHb3Zlcm5tZW50MQwwCgYDVQQLEwNEb0QxDDAKBgNVBAsT\n"
+			+ "A1BLSTEcMBoGA1UEAxMTRG9EIFBLSSBNZWQgUm9vdCBDQTAeFw05ODA4MDMyMjAy\n"
+			+ "MjlaFw0wODA4MDQyMjAyMjlaMGExCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9VLlMu\n"
+			+ "IEdvdmVybm1lbnQxDDAKBgNVBAsTA0RvRDEMMAoGA1UECxMDUEtJMRwwGgYDVQQD\n"
+			+ "ExNEb0QgUEtJIE1lZCBSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n"
+			+ "gQDbrM/J9FrJSX+zxFUbsI9Vw5QbguVBIa95rwW/0M8+sM0r5gd+DY6iubm6wnXk\n"
+			+ "CSvbfQlFEDSKr4WYeeGp+d9WlDnQdtDFLdA45tCi5SHjnW+hGAmZnld0rz6wQekF\n"
+			+ "5xQaa5A6wjhMlLOjbh27zyscrorMJ1O5FBOWnEHcRv6xqQIDAQABoy8wLTAdBgNV\n"
+			+ "HQ4EFgQUVrmYR6m9701cHQ3r5kXyG7zsCN0wDAYDVR0TBAUwAwEB/zANBgkqhkiG\n"
+			+ "9w0BAQUFAAOBgQDVX1Y0YqC7vekeZjVxtyuC8Mnxbrz6D109AX07LEIRzNYzwZ0w\n"
+			+ "MTImSp9sEzWW+3FueBIU7AxGys2O7X0qmN3zgszPfSiocBuQuXIYQctJhKjF5KVc\n"
+			+ "VGQRYYlt+myhl2vy6yPzEVCjiKwMEb1Spu0irCf+lFW2hsdjvmSQMtZvOw==\n"
+			+ "-----END CERTIFICATE-----\n";
+
+	ByteArrayInputStream certArray2 = new ByteArrayInputStream(certificate2
+			.getBytes());
+
+	public static class IdentitySubclass extends Identity {
+		public IdentitySubclass() {
+			super();
+		}
+
+		public IdentitySubclass(String name) {
+			super(name);
+		}
+
+		public IdentitySubclass(String name, IdentityScope scope)
+				throws KeyManagementException {
+			super(name, scope);
+		}
+	}
+
+	/**
+	 * @tests java.security.Identity#Identity()
+	 */
+	public void test_Constructor() {
+		new IdentitySubclass();
+	}
+
+	/**
+	 * @tests java.security.Identity#Identity(java.lang.String)
+	 */
+	public void test_ConstructorLjava_lang_String() {
+		new IdentitySubclass("test");
+	}
+
+	/**
+	 * @tests java.security.Identity#Identity(java.lang.String,
+	 *        java.security.IdentityScope)
+	 */
+	public void test_ConstructorLjava_lang_StringLjava_security_IdentityScope() throws Exception {
+       		new IdentitySubclass("test", new IdentityScopeSubclass());
+	}
+
+	/**
+	 * @tests java.security.Identity#getScope()
+	 */
+	public void test_getScope() throws Exception {
+       		IdentityScope scope = new IdentityScopeSubclass();
+       		IdentitySubclass sub = new IdentitySubclass("test", scope);
+       		IdentityScope returnedScope = sub.getScope();
+       		assertEquals("Wrong Scope returned", scope, returnedScope);
+	}
+
+	/**
+	 * @tests java.security.Identity#getPublicKey()
+	 */
+	public void test_getPublicKey() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test",
+       				new IdentityScopeSubclass());
+       		sub.setPublicKey(pubKey);
+       		PublicKey returnedPubKey = sub.getPublicKey();
+       		assertEquals("Wrong PublicKey returned", pubKey, returnedPubKey);
+	}
+
+	/**
+	 * @tests java.security.Identity#getName()
+	 */
+	public void test_getName() throws Exception {
+       		String name = "test";
+       		IdentitySubclass sub = new IdentitySubclass(name,
+       				new IdentityScopeSubclass());
+       		assertEquals("Wrong Name returned", name, sub.getName());
+	}
+
+	/**
+	 * @tests java.security.Identity#getInfo()
+	 */
+	public void test_getInfo() throws Exception {
+       		String info = "This is the general information.";
+       		IdentitySubclass sub = new IdentitySubclass("test",
+       				new IdentityScopeSubclass());
+       		sub.setInfo(info);
+       		assertEquals("Wrong Info returned", info, sub.getInfo());
+	}
+
+	/**
+	 * @tests java.security.Identity#certificates()
+	 */
+	public void test_certificates() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test",
+       				new IdentityScopeSubclass());
+       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
+       		X509Certificate cert[] = new X509Certificate[1];
+       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
+       		sub.setPublicKey(cert[0].getPublicKey());
+       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
+       		sub.addCertificate(certImpl);
+       		java.security.Certificate[] certs = sub.certificates();
+       		assertEquals("Certificate not contained in the identity",
+       				certs[0], certImpl);
+	}
+
+	/**
+	 * @tests java.security.Identity#addCertificate(java.security.Certificate)
+	 */
+	public void test_addCertificateLjava_security_Certificate() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test",
+       				new IdentityScopeSubclass());
+       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
+       		X509Certificate cert[] = new X509Certificate[1];
+       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
+       		sub.setPublicKey(cert[0].getPublicKey());
+       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
+       		sub.addCertificate(certImpl);
+	}
+
+	/**
+	 * @tests java.security.Identity#removeCertificate(java.security.Certificate)
+	 */
+	public void test_removeCertificateLjava_security_Certificate() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test",
+       				new IdentityScopeSubclass());
+       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
+       		X509Certificate cert[] = new X509Certificate[1];
+       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
+       		sub.setPublicKey(cert[0].getPublicKey());
+       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
+       		sub.addCertificate(certImpl);
+       		sub.removeCertificate(certImpl);
+       		java.security.Certificate[] certs = sub.certificates();
+       		assertEquals("Certificate not removed", 0, certs.length);
+	}
+
+	/**
+	 * @tests java.security.Identity#equals(java.lang.Object)
+	 */
+	public void test_equalsLjava_lang_Object() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test",
+       				new IdentityScopeSubclass());
+       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
+       		X509Certificate cert[] = new X509Certificate[1];
+       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
+       		sub.setPublicKey(cert[0].getPublicKey());
+       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
+       		sub.addCertificate(certImpl);
+       		IdentitySubclass sub2 = new IdentitySubclass("test",
+       				new IdentityScopeSubclass());
+       		assertEquals("the two Identity objects are not equal", sub2, sub);
+	}
+
+	/**
+	 * @tests java.security.Identity#identityEquals(java.security.Identity)
+	 */
+	public void test_identityEqualsLjava_security_Identity() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test", null);
+       		CertificateFactory cf = CertificateFactory.getInstance("X.509");
+       		X509Certificate cert[] = new X509Certificate[1];
+       		cert[0] = (X509Certificate) cf.generateCertificate(certArray);
+       		sub.setPublicKey(cert[0].getPublicKey());
+       		CertificateImpl certImpl = new CertificateImpl(cert[0]);
+       		sub.addCertificate(certImpl);
+       		IdentitySubclass sub2 = new IdentitySubclass("test", null);
+       		sub2.setPublicKey(cert[0].getPublicKey());
+       		assertEquals("the two Identity objects are not identity-equal",
+       				sub2, sub);
+	}
+
+	/**
+	 * @tests java.security.Identity#toString()
+	 */
+	public void test_toString() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test", null);
+       		assertNotNull(sub.toString());
+       		assertTrue("The String returned is not valid", sub.toString()
+       				.length() > 0);
+	}
+
+	/**
+	 * @tests java.security.Identity#toString(boolean)
+	 */
+	public void test_toStringZ() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test", null);
+       		assertNotNull(sub.toString(true));
+       		assertTrue("The String returned is not valid", sub.toString(true)
+       				.length() > 0);
+	}
+
+	/**
+	 * @tests java.security.Identity#hashCode()
+	 */
+	public void test_hashCode() throws Exception {
+       		IdentitySubclass sub = new IdentitySubclass("test", null);
+       		IdentitySubclass sub2 = new IdentitySubclass("test", null);
+       		assertEquals("The 2 hash codes are not equal", sub.hashCode(), sub2
+       				.hashCode());
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Identity2Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java Thu Sep 14 18:17:39 2006
@@ -1,262 +1,262 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.java.security;
-
-import java.security.Identity;
-import java.security.IdentityScope;
-import java.security.KeyManagementException;
-import java.security.KeyPairGenerator;
-import java.security.PublicKey;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.apache.harmony.security.tests.java.security.Identity2Test.IdentitySubclass;
-
-public class IdentityScope2Test extends junit.framework.TestCase {
-
-	static PublicKey pubKey;
-    static {
-        try {
-            pubKey = KeyPairGenerator.getInstance("DSA").genKeyPair().getPublic();
-        } catch (Exception e) {
-            fail(e.toString());
-        }
-    }
-
-	public static class IdentityScopeSubclass extends IdentityScope {
-		Hashtable identities;
-
-		public IdentityScopeSubclass(String name, PublicKey pk) {
-			super(name);
-			try {
-				setPublicKey(pk);
-			} catch (KeyManagementException e) {
-			}
-			identities = new Hashtable();
-		}
-
-		public IdentityScopeSubclass() {
-			super();
-			identities = new Hashtable();
-		}
-
-		public IdentityScopeSubclass(String name) {
-			super(name);
-			identities = new Hashtable();
-		}
-
-		public IdentityScopeSubclass(String name, IdentityScope scope)
-				throws KeyManagementException {
-			super(name, scope);
-			identities = new Hashtable();
-		}
-
-		public int size() {
-			return identities.size();
-		}
-
-		public Identity getIdentity(String name) {
-			Enumeration en = identities();
-			while (en.hasMoreElements()) {
-				Identity current = (Identity) en.nextElement();
-				if (current.getName().equals(name))
-					return current;
-			}
-			return null;
-		}
-
-		public Identity getIdentity(PublicKey pk) {
-			Enumeration en = identities();
-			while (en.hasMoreElements()) {
-				Identity current = (Identity) en.nextElement();
-				if (current.getPublicKey() == pk)
-					return current;
-			}
-			return null;
-		}
-
-		public Enumeration identities() {
-			return identities.elements();
-		}
-
-		public void addIdentity(Identity id) throws KeyManagementException {
-			if (identities.containsKey(id))
-				throw new KeyManagementException(
-						"This Identity is already contained in the scope");
-			if (getIdentity(id.getPublicKey()) != null)
-				throw new KeyManagementException(
-						"This Identity's public key already exists in the scope");
-			identities.put(id, id);
-		}
-
-		public void removeIdentity(Identity id) throws KeyManagementException {
-			if (!identities.containsKey(id))
-				throw new KeyManagementException(
-						"This Identity is not contained in the scope");
-			identities.remove(id);
-		}
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#IdentityScope()
-	 */
-	public void test_Constructor() {
-		new IdentityScopeSubclass();
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#IdentityScope(java.lang.String)
-	 */
-	public void test_ConstructorLjava_lang_String() {
-		new IdentityScopeSubclass("test");
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#IdentityScope(java.lang.String,
-	 *        java.security.IdentityScope)
-	 */
-	public void test_ConstructorLjava_lang_StringLjava_security_IdentityScope() throws Exception {
-		new IdentityScopeSubclass("test", new IdentityScopeSubclass());
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#addIdentity(java.security.Identity)
-	 */
-	public void test_addIdentityLjava_security_Identity() throws Exception {
-       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
-       				new IdentityScopeSubclass());
-       		Identity id = new IdentitySubclass("id1");
-       		id.setPublicKey(pubKey);
-       		sub.addIdentity(id);
-       		try {
-       			Identity id2 = new IdentitySubclass("id2");
-       			id2.setPublicKey(pubKey);
-       			sub.addIdentity(id2);
-       			fail("KeyManagementException should have been thrown");
-       		} catch (KeyManagementException e) {
-       			// Expected
-       		}
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#removeIdentity(java.security.Identity)
-	 */
-	public void test_removeIdentityLjava_security_Identity() throws Exception {
-       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
-       				new IdentityScopeSubclass());
-       		Identity id = new IdentitySubclass();
-       		id.setPublicKey(pubKey);
-       		sub.addIdentity(id);
-       		sub.removeIdentity(id);
-       		try {
-       			sub.removeIdentity(id);
-       			fail("KeyManagementException should have been thrown");
-       		} catch (KeyManagementException e) {
-       			// expected
-       		}
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#identities()
-	 */
-	public void test_identities() throws Exception {
-       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
-       				new IdentityScopeSubclass());
-       		Identity id = new IdentitySubclass();
-       		id.setPublicKey(pubKey);
-       		sub.addIdentity(id);
-       		Enumeration en = sub.identities();
-       		assertTrue("Wrong object contained in identities", en.nextElement()
-       				.equals(id));
-       		assertTrue("Contains too many elements", !en.hasMoreElements());
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#getIdentity(java.security.Principal)
-	 */
-	public void test_getIdentityLjava_security_Principal() throws Exception {
-       		Identity id = new IdentitySubclass("principal name");
-       		id.setPublicKey(pubKey);
-       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
-       				new IdentityScopeSubclass());
-       		sub.addIdentity(id);
-       		Identity returnedId = sub.getIdentity(id);
-       		assertEquals("Returned Identity not the same as the added one", id,
-       				returnedId);
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#getIdentity(java.security.PublicKey)
-	 */
-	public void test_getIdentityLjava_security_PublicKey() throws Exception {
-       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
-       				new IdentityScopeSubclass());
-       		Identity id = new IdentitySubclass();
-       		id.setPublicKey(pubKey);
-       		sub.addIdentity(id);
-       		Identity returnedId = sub.getIdentity(pubKey);
-       		assertEquals("Returned Identity not the same as the added one", id,
-       				returnedId);
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#getIdentity(java.lang.String)
-	 */
-	public void test_getIdentityLjava_lang_String() throws Exception {
-       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
-       				new IdentityScopeSubclass());
-       		Identity id = new IdentitySubclass("test");
-       		id.setPublicKey(pubKey);
-       		sub.addIdentity(id);
-       		Identity returnedId = sub.getIdentity("test");
-       		assertEquals("Returned Identity not the same as the added one", id,
-       				returnedId);
-	}
-
-	/**
-	 * @tests java.security.IdentityScope#size()
-	 */
-	public void test_size() throws Exception {
-       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
-       				new IdentityScopeSubclass());
-       		Identity id = new IdentitySubclass();
-       		id.setPublicKey(pubKey);
-       		sub.addIdentity(id);
-       		assertEquals("Wrong size", 1, sub.size());
-	}
-
-    /**
-     * @tests java.security.IdentityScope#toString()
-     */
-    public void test_toString() throws Exception {
-            IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
-                    new IdentityScopeSubclass());
-            Identity id = new IdentitySubclass();
-            id.setPublicKey(pubKey);
-            sub.addIdentity(id);
-            assertNotNull("toString returned a null", sub.toString());
-            assertTrue("Not a valid String ", sub.toString().length() > 0);
-    }
-
-    public void test_getIdentity() throws Exception {
-        //Regression for HARMONY-1173
-        IdentityScope scope = IdentityScope.getSystemScope(); 
-        try {
-            scope.getIdentity((String) null);
-            fail("NPE expected");
-        } catch (NullPointerException npe) {}
-    }
-}
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.security.tests.java.security;
+
+import java.security.Identity;
+import java.security.IdentityScope;
+import java.security.KeyManagementException;
+import java.security.KeyPairGenerator;
+import java.security.PublicKey;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import org.apache.harmony.security.tests.java.security.Identity2Test.IdentitySubclass;
+
+public class IdentityScope2Test extends junit.framework.TestCase {
+
+	static PublicKey pubKey;
+    static {
+        try {
+            pubKey = KeyPairGenerator.getInstance("DSA").genKeyPair().getPublic();
+        } catch (Exception e) {
+            fail(e.toString());
+        }
+    }
+
+	public static class IdentityScopeSubclass extends IdentityScope {
+		Hashtable identities;
+
+		public IdentityScopeSubclass(String name, PublicKey pk) {
+			super(name);
+			try {
+				setPublicKey(pk);
+			} catch (KeyManagementException e) {
+			}
+			identities = new Hashtable();
+		}
+
+		public IdentityScopeSubclass() {
+			super();
+			identities = new Hashtable();
+		}
+
+		public IdentityScopeSubclass(String name) {
+			super(name);
+			identities = new Hashtable();
+		}
+
+		public IdentityScopeSubclass(String name, IdentityScope scope)
+				throws KeyManagementException {
+			super(name, scope);
+			identities = new Hashtable();
+		}
+
+		public int size() {
+			return identities.size();
+		}
+
+		public Identity getIdentity(String name) {
+			Enumeration en = identities();
+			while (en.hasMoreElements()) {
+				Identity current = (Identity) en.nextElement();
+				if (current.getName().equals(name))
+					return current;
+			}
+			return null;
+		}
+
+		public Identity getIdentity(PublicKey pk) {
+			Enumeration en = identities();
+			while (en.hasMoreElements()) {
+				Identity current = (Identity) en.nextElement();
+				if (current.getPublicKey() == pk)
+					return current;
+			}
+			return null;
+		}
+
+		public Enumeration identities() {
+			return identities.elements();
+		}
+
+		public void addIdentity(Identity id) throws KeyManagementException {
+			if (identities.containsKey(id))
+				throw new KeyManagementException(
+						"This Identity is already contained in the scope");
+			if (getIdentity(id.getPublicKey()) != null)
+				throw new KeyManagementException(
+						"This Identity's public key already exists in the scope");
+			identities.put(id, id);
+		}
+
+		public void removeIdentity(Identity id) throws KeyManagementException {
+			if (!identities.containsKey(id))
+				throw new KeyManagementException(
+						"This Identity is not contained in the scope");
+			identities.remove(id);
+		}
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#IdentityScope()
+	 */
+	public void test_Constructor() {
+		new IdentityScopeSubclass();
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#IdentityScope(java.lang.String)
+	 */
+	public void test_ConstructorLjava_lang_String() {
+		new IdentityScopeSubclass("test");
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#IdentityScope(java.lang.String,
+	 *        java.security.IdentityScope)
+	 */
+	public void test_ConstructorLjava_lang_StringLjava_security_IdentityScope() throws Exception {
+		new IdentityScopeSubclass("test", new IdentityScopeSubclass());
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#addIdentity(java.security.Identity)
+	 */
+	public void test_addIdentityLjava_security_Identity() throws Exception {
+       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
+       				new IdentityScopeSubclass());
+       		Identity id = new IdentitySubclass("id1");
+       		id.setPublicKey(pubKey);
+       		sub.addIdentity(id);
+       		try {
+       			Identity id2 = new IdentitySubclass("id2");
+       			id2.setPublicKey(pubKey);
+       			sub.addIdentity(id2);
+       			fail("KeyManagementException should have been thrown");
+       		} catch (KeyManagementException e) {
+       			// Expected
+       		}
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#removeIdentity(java.security.Identity)
+	 */
+	public void test_removeIdentityLjava_security_Identity() throws Exception {
+       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
+       				new IdentityScopeSubclass());
+       		Identity id = new IdentitySubclass();
+       		id.setPublicKey(pubKey);
+       		sub.addIdentity(id);
+       		sub.removeIdentity(id);
+       		try {
+       			sub.removeIdentity(id);
+       			fail("KeyManagementException should have been thrown");
+       		} catch (KeyManagementException e) {
+       			// expected
+       		}
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#identities()
+	 */
+	public void test_identities() throws Exception {
+       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
+       				new IdentityScopeSubclass());
+       		Identity id = new IdentitySubclass();
+       		id.setPublicKey(pubKey);
+       		sub.addIdentity(id);
+       		Enumeration en = sub.identities();
+       		assertTrue("Wrong object contained in identities", en.nextElement()
+       				.equals(id));
+       		assertTrue("Contains too many elements", !en.hasMoreElements());
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#getIdentity(java.security.Principal)
+	 */
+	public void test_getIdentityLjava_security_Principal() throws Exception {
+       		Identity id = new IdentitySubclass("principal name");
+       		id.setPublicKey(pubKey);
+       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
+       				new IdentityScopeSubclass());
+       		sub.addIdentity(id);
+       		Identity returnedId = sub.getIdentity(id);
+       		assertEquals("Returned Identity not the same as the added one", id,
+       				returnedId);
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#getIdentity(java.security.PublicKey)
+	 */
+	public void test_getIdentityLjava_security_PublicKey() throws Exception {
+       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
+       				new IdentityScopeSubclass());
+       		Identity id = new IdentitySubclass();
+       		id.setPublicKey(pubKey);
+       		sub.addIdentity(id);
+       		Identity returnedId = sub.getIdentity(pubKey);
+       		assertEquals("Returned Identity not the same as the added one", id,
+       				returnedId);
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#getIdentity(java.lang.String)
+	 */
+	public void test_getIdentityLjava_lang_String() throws Exception {
+       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
+       				new IdentityScopeSubclass());
+       		Identity id = new IdentitySubclass("test");
+       		id.setPublicKey(pubKey);
+       		sub.addIdentity(id);
+       		Identity returnedId = sub.getIdentity("test");
+       		assertEquals("Returned Identity not the same as the added one", id,
+       				returnedId);
+	}
+
+	/**
+	 * @tests java.security.IdentityScope#size()
+	 */
+	public void test_size() throws Exception {
+       		IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
+       				new IdentityScopeSubclass());
+       		Identity id = new IdentitySubclass();
+       		id.setPublicKey(pubKey);
+       		sub.addIdentity(id);
+       		assertEquals("Wrong size", 1, sub.size());
+	}
+
+    /**
+     * @tests java.security.IdentityScope#toString()
+     */
+    public void test_toString() throws Exception {
+            IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
+                    new IdentityScopeSubclass());
+            Identity id = new IdentitySubclass();
+            id.setPublicKey(pubKey);
+            sub.addIdentity(id);
+            assertNotNull("toString returned a null", sub.toString());
+            assertTrue("Not a valid String ", sub.toString().length() > 0);
+    }
+
+    public void test_getIdentity() throws Exception {
+        //Regression for HARMONY-1173
+        IdentityScope scope = IdentityScope.getSystemScope(); 
+        try {
+            scope.getIdentity((String) null);
+            fail("NPE expected");
+        } catch (NullPointerException npe) {}
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/IdentityScopeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterException2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterException2Test.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterException2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterException2Test.java Thu Sep 14 18:17:39 2006
@@ -1,49 +1,49 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.java.security;
-
-import java.security.InvalidAlgorithmParameterException;
-
-public class InvalidAlgorithmParameterException2Test extends
-		junit.framework.TestCase {
-
-	/**
-	 * @tests java.security.InvalidAlgorithmParameterException#InvalidAlgorithmParameterException()
-	 */
-	public void test_Constructor() {
-		// Test for method java.security.InvalidAlgorithmParameterException()
-		InvalidAlgorithmParameterException e = new InvalidAlgorithmParameterException();
-		assertNotNull("Constructor returned null instance", e);
-		assertEquals("Failed toString test for constructed instance",
-				"java.security.InvalidAlgorithmParameterException", e
-						.toString());
-	}
-
-	/**
-	 * @tests java.security.InvalidAlgorithmParameterException#InvalidAlgorithmParameterException(java.lang.String)
-	 */
-	public void test_ConstructorLjava_lang_String() {
-		// Test for method
-		// java.security.InvalidAlgorithmParameterException(java.lang.String)
-		InvalidAlgorithmParameterException e = new InvalidAlgorithmParameterException(
-				"test message");
-		assertNotNull("Constructor returned null instance", e);
-		assertEquals(
-				"Failed toString test for constructed instance",
-				"java.security.InvalidAlgorithmParameterException: test message",
-				e.toString());
-	}
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.security.tests.java.security;
+
+import java.security.InvalidAlgorithmParameterException;
+
+public class InvalidAlgorithmParameterException2Test extends
+		junit.framework.TestCase {
+
+	/**
+	 * @tests java.security.InvalidAlgorithmParameterException#InvalidAlgorithmParameterException()
+	 */
+	public void test_Constructor() {
+		// Test for method java.security.InvalidAlgorithmParameterException()
+		InvalidAlgorithmParameterException e = new InvalidAlgorithmParameterException();
+		assertNotNull("Constructor returned null instance", e);
+		assertEquals("Failed toString test for constructed instance",
+				"java.security.InvalidAlgorithmParameterException", e
+						.toString());
+	}
+
+	/**
+	 * @tests java.security.InvalidAlgorithmParameterException#InvalidAlgorithmParameterException(java.lang.String)
+	 */
+	public void test_ConstructorLjava_lang_String() {
+		// Test for method
+		// java.security.InvalidAlgorithmParameterException(java.lang.String)
+		InvalidAlgorithmParameterException e = new InvalidAlgorithmParameterException(
+				"test message");
+		assertNotNull("Constructor returned null instance", e);
+		assertEquals(
+				"Failed toString test for constructed instance",
+				"java.security.InvalidAlgorithmParameterException: test message",
+				e.toString());
+	}
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterException2Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidKeyException2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidKeyException2Test.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidKeyException2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidKeyException2Test.java Thu Sep 14 18:17:39 2006
@@ -1,44 +1,44 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.java.security;
-
-import java.security.InvalidKeyException;
-
-public class InvalidKeyException2Test extends junit.framework.TestCase {
-
-	/**
-	 * @tests java.security.InvalidKeyException#InvalidKeyException()
-	 */
-	public void test_Constructor() {
-		// Test for method java.security.InvalidKeyException()
-		InvalidKeyException e = new InvalidKeyException();
-		assertNotNull("Constructor returned a null", e);
-		assertEquals("Failed toString test for constructed instance", "java.security.InvalidKeyException", e
-				.toString());
-	}
-
-	/**
-	 * @tests java.security.InvalidKeyException#InvalidKeyException(java.lang.String)
-	 */
-	public void test_ConstructorLjava_lang_String() {
-		// Test for method java.security.InvalidKeyException(java.lang.String)
-		InvalidKeyException e = new InvalidKeyException("test message");
-		assertNotNull("Constructor returned a null", e);
-		assertEquals("Failed toString test for constructed instance", 
-						"java.security.InvalidKeyException: test message", e
-				.toString());
-	}
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.security.tests.java.security;
+
+import java.security.InvalidKeyException;
+
+public class InvalidKeyException2Test extends junit.framework.TestCase {
+
+	/**
+	 * @tests java.security.InvalidKeyException#InvalidKeyException()
+	 */
+	public void test_Constructor() {
+		// Test for method java.security.InvalidKeyException()
+		InvalidKeyException e = new InvalidKeyException();
+		assertNotNull("Constructor returned a null", e);
+		assertEquals("Failed toString test for constructed instance", "java.security.InvalidKeyException", e
+				.toString());
+	}
+
+	/**
+	 * @tests java.security.InvalidKeyException#InvalidKeyException(java.lang.String)
+	 */
+	public void test_ConstructorLjava_lang_String() {
+		// Test for method java.security.InvalidKeyException(java.lang.String)
+		InvalidKeyException e = new InvalidKeyException("test message");
+		assertNotNull("Constructor returned a null", e);
+		assertEquals("Failed toString test for constructed instance", 
+						"java.security.InvalidKeyException: test message", e
+				.toString());
+	}
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidKeyException2Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidKeyExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidParameterException2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidParameterException2Test.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidParameterException2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidParameterException2Test.java Thu Sep 14 18:17:39 2006
@@ -1,46 +1,46 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.java.security;
-
-import java.security.InvalidParameterException;
-
-public class InvalidParameterException2Test extends junit.framework.TestCase {
-
-	/**
-	 * @tests java.security.InvalidParameterException#InvalidParameterException()
-	 */
-	public void test_Constructor() {
-		// Test for method java.security.InvalidParameterException()
-		InvalidParameterException e = new InvalidParameterException();
-		assertEquals("Failed toString test for constructed instance", "java.security.InvalidParameterException", e
-				.toString());
-	}
-
-	/**
-	 * @tests java.security.InvalidParameterException#InvalidParameterException(java.lang.String)
-	 */
-	public void test_ConstructorLjava_lang_String() {
-		// Test for method
-		// java.security.InvalidParameterException(java.lang.String)
-		InvalidParameterException e = new InvalidParameterException(
-				"test message");
-		assertEquals("Failed toString test for constructed instance",
-				
-								"java.security.InvalidParameterException: test message", e
-						.toString()
-						);
-	}
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.security.tests.java.security;
+
+import java.security.InvalidParameterException;
+
+public class InvalidParameterException2Test extends junit.framework.TestCase {
+
+	/**
+	 * @tests java.security.InvalidParameterException#InvalidParameterException()
+	 */
+	public void test_Constructor() {
+		// Test for method java.security.InvalidParameterException()
+		InvalidParameterException e = new InvalidParameterException();
+		assertEquals("Failed toString test for constructed instance", "java.security.InvalidParameterException", e
+				.toString());
+	}
+
+	/**
+	 * @tests java.security.InvalidParameterException#InvalidParameterException(java.lang.String)
+	 */
+	public void test_ConstructorLjava_lang_String() {
+		// Test for method
+		// java.security.InvalidParameterException(java.lang.String)
+		InvalidParameterException e = new InvalidParameterException(
+				"test message");
+		assertEquals("Failed toString test for constructed instance",
+				
+								"java.security.InvalidParameterException: test message", e
+						.toString()
+						);
+	}
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidParameterException2Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidParameterExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSCallbackHandlerProtectionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSPasswordProtectionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSPrivateKeyEntryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSSecretKeyEntryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSTrustedCertificateEntryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyException2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyException2Test.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyException2Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyException2Test.java Thu Sep 14 18:17:39 2006
@@ -1,41 +1,41 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.java.security;
-
-import java.security.KeyException;
-
-public class KeyException2Test extends junit.framework.TestCase {
-
-	/**
-	 * @tests java.security.KeyException#KeyException()
-	 */
-	public void test_Constructor() {
-		// Test for method java.security.KeyException()
-		KeyException e = new KeyException();
-		assertEquals("Failed toString test for constructed instance", "java.security.KeyException", e
-				.toString());
-	}
-
-	/**
-	 * @tests java.security.KeyException#KeyException(java.lang.String)
-	 */
-	public void test_ConstructorLjava_lang_String() {
-		// Test for method java.security.KeyException(java.lang.String)
-		KeyException e = new KeyException("test message");
-		assertEquals("Failed toString test for constructed instance", "java.security.KeyException: test message", e
-				.toString());
-	}
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.security.tests.java.security;
+
+import java.security.KeyException;
+
+public class KeyException2Test extends junit.framework.TestCase {
+
+	/**
+	 * @tests java.security.KeyException#KeyException()
+	 */
+	public void test_Constructor() {
+		// Test for method java.security.KeyException()
+		KeyException e = new KeyException();
+		assertEquals("Failed toString test for constructed instance", "java.security.KeyException", e
+				.toString());
+	}
+
+	/**
+	 * @tests java.security.KeyException#KeyException(java.lang.String)
+	 */
+	public void test_ConstructorLjava_lang_String() {
+		// Test for method java.security.KeyException(java.lang.String)
+		KeyException e = new KeyException("test message");
+		assertEquals("Failed toString test for constructed instance", "java.security.KeyException: test message", e
+				.toString());
+	}
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyException2Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message