harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r415555 [8/17] - in /incubator/harmony/enhanced/classlib/trunk/modules/security: make/common/ src/test/api/java.injected/java/security/acl/ src/test/api/java.injected/java/security/cert/ src/test/api/java.injected/java/security/interfaces/ ...
Date Tue, 20 Jun 2006 08:11:19 GMT
Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory3Test.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateFactory3Test.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory3Test.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory3Test.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateFactory3Test.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateFactory3Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory3Test.java Tue Jun 20 01:11:04 2006
@@ -1,239 +1,243 @@
-/*
- *  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.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.apache.harmony.security.tests.support.SpiEngUtils;
-import org.apache.harmony.security.tests.support.TestUtils;
-
-
-/**
- * Tests for <code>CertificateFactory</code> class methods
- */
-
-public class CertificateFactory3Test extends TestCase {
-
-    /**
-     * Constructor for CertificateFactoryFileTests.
-     * @param arg0
-     */
-    public CertificateFactory3Test(String arg0) {
-        super(arg0);
-    }
-    private static String defaultProviderName = null;
-
-    private static Provider defaultProvider = null;
-
-    private static boolean X509Support = false;
-
-    private static String defaultType = CertificateFactory1Test.defaultType;
-
-    public static String fileCertificateX509 = "java/security/cert/serialization/Certificate.X.509";
-    public static String fileCertPathPki = "java/security/cert/serialization/CertPath.PkiPath";
-
-    private static String NotSupportMsg = "";
-
-    static {
-        defaultProvider = SpiEngUtils.isSupport(defaultType,
-                CertificateFactory1Test.srvCertificateFactory);
-        X509Support = (defaultProvider != null);
-        defaultProviderName = (X509Support ? defaultProvider.getName() : null);
-        NotSupportMsg = defaultType.concat(" is not supported");
-        fileCertificateX509 = SpiEngUtils.getFileName(TestUtils.TEST_ROOT,
-                fileCertificateX509);
-        fileCertificateX509 = fileCertificateX509.replace('/',File.separatorChar);
-        fileCertPathPki = SpiEngUtils.getFileName(TestUtils.TEST_ROOT,
-                fileCertPathPki);
-        fileCertPathPki = fileCertPathPki.replace('/',File.separatorChar);
-    
-    }
-
-    private static CertificateFactory[] initCertFs() {
-        if (!X509Support) {
-            fail(NotSupportMsg);
-            return null;
-        }
-        try {
-            CertificateFactory[] certFs = new CertificateFactory[3];
-            certFs[0] = CertificateFactory.getInstance(defaultType);
-            certFs[1] = CertificateFactory.getInstance(defaultType,
-                    defaultProviderName);
-            certFs[2] = CertificateFactory.getInstance(defaultType,
-                    defaultProvider);
-            return certFs;
-        } catch (Exception e) {
-            return null;
-        }
-    }
-    
-    /**
-     * Test for 
-     * <code>generateCertificate(InputStream inStream)</code> method
-     * Assertion: returns Certificate
-     */
-    public void testGenerateCertificate() 
-            throws CertificateException, NoSuchProviderException,
-                FileNotFoundException, IOException {
-        if (!X509Support) {
-            fail(NotSupportMsg);
-            return;
-        }
-        CertificateFactory[] certFs = initCertFs();
-        assertNotNull("CertificateFactory objects were not created", certFs);
-        FileInputStream fis = null;
-        Certificate [] certs = new Certificate[3];
-        for (int i = 0; i < certFs.length; i++) {
-            fis = new FileInputStream(fileCertificateX509);
-            certs[i] = certFs[i].generateCertificate(fis);
-            fis.close();
-        }        
-        assertEquals(certs[0], certs[1]);
-        assertEquals(certs[0], certs[2]);
-    }
-    /**
-     * Test for 
-     * <code>generateCertificates(InputStream inStream)</code> method
-     * Assertion: returns Collection which consists of 1 Certificate
-     */
-    public void testeGnerateCertificates() 
-            throws CertificateException, NoSuchProviderException,
-                FileNotFoundException, IOException {
-        if (!X509Support) {
-            fail(NotSupportMsg);
-            return;
-        }
-        CertificateFactory[] certFs = initCertFs();
-        assertNotNull("CertificateFactory objects were not created", certFs);
-        FileInputStream fis = new FileInputStream(fileCertificateX509);
-        Certificate cert = certFs[0].generateCertificate(fis);
-        fis.close();
-        for (int i = 0; i < certFs.length; i++) {
-            Collection col = null;
-            fis = new FileInputStream(fileCertificateX509);
-            col = certFs[i].generateCertificates(fis);
-            fis.close();
-            Iterator it = col.iterator();
-            assertEquals("Incorrect Collection size", col.size(), 1);
-            assertEquals("Incorect Certificate in Collection", cert, it.next());
-        }
-    }
-    /**
-     * Test for 
-     * <code>generateCertPath(List certificates)</code> method
-     * Assertion: returns CertPath with 1 Certificate
-     */
-    public void testGenerateCertPath01() 
-            throws CertificateException, NoSuchProviderException,
-                FileNotFoundException, IOException{
-        if (!X509Support) {
-            fail(NotSupportMsg);
-            return;
-        }
-        CertificateFactory[] certFs = initCertFs();
-        assertNotNull("CertificateFactory objects were not created", certFs);
-        // create list of certificates with one certificate
-        FileInputStream fis = new FileInputStream(fileCertificateX509);
-        Certificate cert = certFs[0].generateCertificate(fis);
-        fis.close();
-        List list = new Vector();
-        list.add(cert);
-        for (int i = 0; i < certFs.length; i++) {
-            CertPath certPath = null;
-            certPath = certFs[i].generateCertPath(list);
-            assertEquals(cert.getType(), certPath.getType());
-            List list1 = certPath.getCertificates();
-            assertFalse("Result list is empty",list1.isEmpty());
-            Iterator it = list1.iterator();
-            assertEquals("Incorrect Certificate in CertPath", cert, it.next());
-        }
-    }    
-    /**
-     * Test for 
-     * <code>generateCertPath(InputStream inStream, String encoding)</code> method
-     * Assertion: returns CertPath with 1 Certificate
-     */
-    public void testGenerateCertPath02() 
-            throws CertificateException, NoSuchProviderException,
-                FileNotFoundException, IOException {
-        if (!X509Support) {
-            fail(NotSupportMsg);
-            return;
-        }
-        CertificateFactory[] certFs = initCertFs();
-        assertNotNull("CertificateFactory objects were not created", certFs);
-        for (int i = 0; i < certFs.length; i++) {
-            CertPath certPath = null;
-            FileInputStream fis = new FileInputStream(fileCertPathPki);
-            certPath = certFs[i].generateCertPath(fis, "PkiPath");
-            fis.close();
-            assertEquals(defaultType, certPath.getType());
-            List list1 = certPath.getCertificates();
-            assertFalse("Result list is empty",list1.isEmpty());
-        }
-    }    
-    /**
-     * Test for 
-     * <code>generateCertPath(InputStream inStream)</code> method
-     * Assertion: returns CertPath with 1 Certificate
-     */
-    public void testGenerateCertPath03() 
-            throws CertificateException, NoSuchProviderException,
-                FileNotFoundException, IOException{
-        if (!X509Support) {
-            fail(NotSupportMsg);
-            return;
-        }
-        String certPathEncoding = "PkiPath";
-        CertificateFactory[] certFs = initCertFs();
-        assertNotNull("CertificateFactory objects were not created", certFs);
-        for (int i = 0; i < certFs.length; i++) {
-            Iterator it = certFs[0].getCertPathEncodings();
-            if (it.hasNext()) {
-                if (certPathEncoding.equals(it.next())) {
-                    CertPath certPath = null;
-                    FileInputStream fis = new FileInputStream(fileCertPathPki);
-                    certPath = certFs[i].generateCertPath(fis);
-                    fis.close();
-                    assertEquals(defaultType, certPath.getType());
-                    List list1 = certPath.getCertificates();
-                    assertFalse("Result list is empty",list1.isEmpty());
-                } else {
-                    fail("Default encoding is not ".concat(certPathEncoding));
-                }
-            } else {
-                fail("There are no CertPath encodings");
-            }
-        }
-    }
-}
+/*
+ *  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.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.cert;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.security.NoSuchProviderException;
+import java.security.Provider;
+import java.security.cert.CertPath;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.harmony.security.tests.java.security.cert.CertificateFactory1Test;
+import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.security.tests.support.TestUtils;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>CertificateFactory</code> class methods
+ */
+
+public class CertificateFactory3Test extends TestCase {
+
+    /**
+     * Constructor for CertificateFactoryFileTests.
+     * @param arg0
+     */
+    public CertificateFactory3Test(String arg0) {
+        super(arg0);
+    }
+    private static String defaultProviderName = null;
+
+    private static Provider defaultProvider = null;
+
+    private static boolean X509Support = false;
+
+    private static String defaultType = CertificateFactory1Test.defaultType;
+
+    public static String fileCertificateX509 = "java/security/cert/serialization/Certificate.X.509";
+    public static String fileCertPathPki = "java/security/cert/serialization/CertPath.PkiPath";
+
+    private static String NotSupportMsg = "";
+
+    static {
+        defaultProvider = SpiEngUtils.isSupport(defaultType,
+                CertificateFactory1Test.srvCertificateFactory);
+        X509Support = (defaultProvider != null);
+        defaultProviderName = (X509Support ? defaultProvider.getName() : null);
+        NotSupportMsg = defaultType.concat(" is not supported");
+        fileCertificateX509 = SpiEngUtils.getFileName(TestUtils.TEST_ROOT,
+                fileCertificateX509);
+        fileCertificateX509 = fileCertificateX509.replace('/',File.separatorChar);
+        fileCertPathPki = SpiEngUtils.getFileName(TestUtils.TEST_ROOT,
+                fileCertPathPki);
+        fileCertPathPki = fileCertPathPki.replace('/',File.separatorChar);
+    
+    }
+
+    private static CertificateFactory[] initCertFs() {
+        if (!X509Support) {
+            fail(NotSupportMsg);
+            return null;
+        }
+        try {
+            CertificateFactory[] certFs = new CertificateFactory[3];
+            certFs[0] = CertificateFactory.getInstance(defaultType);
+            certFs[1] = CertificateFactory.getInstance(defaultType,
+                    defaultProviderName);
+            certFs[2] = CertificateFactory.getInstance(defaultType,
+                    defaultProvider);
+            return certFs;
+        } catch (Exception e) {
+            return null;
+        }
+    }
+    
+    /**
+     * Test for 
+     * <code>generateCertificate(InputStream inStream)</code> method
+     * Assertion: returns Certificate
+     */
+    public void testGenerateCertificate() 
+            throws CertificateException, NoSuchProviderException,
+                FileNotFoundException, IOException {
+        if (!X509Support) {
+            fail(NotSupportMsg);
+            return;
+        }
+        CertificateFactory[] certFs = initCertFs();
+        assertNotNull("CertificateFactory objects were not created", certFs);
+        FileInputStream fis = null;
+        Certificate [] certs = new Certificate[3];
+        for (int i = 0; i < certFs.length; i++) {
+            fis = new FileInputStream(fileCertificateX509);
+            certs[i] = certFs[i].generateCertificate(fis);
+            fis.close();
+        }        
+        assertEquals(certs[0], certs[1]);
+        assertEquals(certs[0], certs[2]);
+    }
+    /**
+     * Test for 
+     * <code>generateCertificates(InputStream inStream)</code> method
+     * Assertion: returns Collection which consists of 1 Certificate
+     */
+    public void testeGnerateCertificates() 
+            throws CertificateException, NoSuchProviderException,
+                FileNotFoundException, IOException {
+        if (!X509Support) {
+            fail(NotSupportMsg);
+            return;
+        }
+        CertificateFactory[] certFs = initCertFs();
+        assertNotNull("CertificateFactory objects were not created", certFs);
+        FileInputStream fis = new FileInputStream(fileCertificateX509);
+        Certificate cert = certFs[0].generateCertificate(fis);
+        fis.close();
+        for (int i = 0; i < certFs.length; i++) {
+            Collection col = null;
+            fis = new FileInputStream(fileCertificateX509);
+            col = certFs[i].generateCertificates(fis);
+            fis.close();
+            Iterator it = col.iterator();
+            assertEquals("Incorrect Collection size", col.size(), 1);
+            assertEquals("Incorect Certificate in Collection", cert, it.next());
+        }
+    }
+    /**
+     * Test for 
+     * <code>generateCertPath(List certificates)</code> method
+     * Assertion: returns CertPath with 1 Certificate
+     */
+    public void testGenerateCertPath01() 
+            throws CertificateException, NoSuchProviderException,
+                FileNotFoundException, IOException{
+        if (!X509Support) {
+            fail(NotSupportMsg);
+            return;
+        }
+        CertificateFactory[] certFs = initCertFs();
+        assertNotNull("CertificateFactory objects were not created", certFs);
+        // create list of certificates with one certificate
+        FileInputStream fis = new FileInputStream(fileCertificateX509);
+        Certificate cert = certFs[0].generateCertificate(fis);
+        fis.close();
+        List list = new Vector();
+        list.add(cert);
+        for (int i = 0; i < certFs.length; i++) {
+            CertPath certPath = null;
+            certPath = certFs[i].generateCertPath(list);
+            assertEquals(cert.getType(), certPath.getType());
+            List list1 = certPath.getCertificates();
+            assertFalse("Result list is empty",list1.isEmpty());
+            Iterator it = list1.iterator();
+            assertEquals("Incorrect Certificate in CertPath", cert, it.next());
+        }
+    }    
+    /**
+     * Test for 
+     * <code>generateCertPath(InputStream inStream, String encoding)</code> method
+     * Assertion: returns CertPath with 1 Certificate
+     */
+    public void testGenerateCertPath02() 
+            throws CertificateException, NoSuchProviderException,
+                FileNotFoundException, IOException {
+        if (!X509Support) {
+            fail(NotSupportMsg);
+            return;
+        }
+        CertificateFactory[] certFs = initCertFs();
+        assertNotNull("CertificateFactory objects were not created", certFs);
+        for (int i = 0; i < certFs.length; i++) {
+            CertPath certPath = null;
+            FileInputStream fis = new FileInputStream(fileCertPathPki);
+            certPath = certFs[i].generateCertPath(fis, "PkiPath");
+            fis.close();
+            assertEquals(defaultType, certPath.getType());
+            List list1 = certPath.getCertificates();
+            assertFalse("Result list is empty",list1.isEmpty());
+        }
+    }    
+    /**
+     * Test for 
+     * <code>generateCertPath(InputStream inStream)</code> method
+     * Assertion: returns CertPath with 1 Certificate
+     */
+    public void testGenerateCertPath03() 
+            throws CertificateException, NoSuchProviderException,
+                FileNotFoundException, IOException{
+        if (!X509Support) {
+            fail(NotSupportMsg);
+            return;
+        }
+        String certPathEncoding = "PkiPath";
+        CertificateFactory[] certFs = initCertFs();
+        assertNotNull("CertificateFactory objects were not created", certFs);
+        for (int i = 0; i < certFs.length; i++) {
+            Iterator it = certFs[0].getCertPathEncodings();
+            if (it.hasNext()) {
+                if (certPathEncoding.equals(it.next())) {
+                    CertPath certPath = null;
+                    FileInputStream fis = new FileInputStream(fileCertPathPki);
+                    certPath = certFs[i].generateCertPath(fis);
+                    fis.close();
+                    assertEquals(defaultType, certPath.getType());
+                    List list1 = certPath.getCertificates();
+                    assertFalse("Result list is empty",list1.isEmpty());
+                } else {
+                    fail("Default encoding is not ".concat(certPathEncoding));
+                }
+            } else {
+                fail("There are no CertPath encodings");
+            }
+        }
+    }
+}

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory4Test.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateFactoryTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory4Test.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory4Test.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateFactoryTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateFactoryTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory4Test.java Tue Jun 20 01:11:04 2006
@@ -13,7 +13,7 @@
  * limitations under the License.
  */
 
-package tests.api.java.security.cert;
+package org.apache.harmony.security.tests.java.security.cert;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -32,7 +32,9 @@
 import tests.support.Support_GetResource;
 import tests.support.resource.Support_Resources;
 
-public class CertificateFactoryTest extends junit.framework.TestCase {
+import junit.framework.TestCase;
+
+public class CertificateFactory4Test extends junit.framework.TestCase {
 
 	private static final String BASE_URL = Support_GetResource
 			.getResourceURL("/../internalres/");

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactorySpiTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateFactorySpiTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactorySpiTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactorySpiTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateFactorySpiTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateFactorySpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactorySpiTest.java Tue Jun 20 01:11:04 2006
@@ -1,282 +1,289 @@
-/*
- *  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.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>CertificateFactorySpi</code> class constructors and methods
- * 
- */
-
-public class CertificateFactorySpiTest extends TestCase {
-    /**
-     * Constructor for CertStoreSpiTest.
-     * 
-     * @param arg0
-     */
-    public CertificateFactorySpiTest(String arg0) {
-        super(arg0);
-    }
-
-    /**
-     * Test for <code>CertificateFactorySpi</code> constructor 
-     * Assertion: constructs CertificateFactorySpi
-     */
-    public void testCertificateFactorySpi01() throws CertificateException,
-            CRLException {
-        CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
-        ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
-        try {
-            certFactorySpi.engineGenerateCertPath(bais);
-            fail("UnsupportedOperationException must be thrown");
-        } catch (UnsupportedOperationException e) {
-        }
-        try {
-            certFactorySpi.engineGenerateCertPath(bais, "");
-            fail("UnsupportedOperationException must be thrown");
-        } catch (UnsupportedOperationException e) {
-        }
-        try {
-            List list = null;
-            certFactorySpi.engineGenerateCertPath(list);
-            fail("UnsupportedOperationException must be thrown");
-        } catch (UnsupportedOperationException e) {
-        }
-        try {
-            certFactorySpi.engineGetCertPathEncodings();
-            fail("UnsupportedOperationException must be thrown");
-        } catch (UnsupportedOperationException e) {
-        }
-        Certificate cc = certFactorySpi
-                .engineGenerateCertificate(bais);
-        assertNull("Not null Cerificate", cc);
-        try {
-            certFactorySpi.engineGenerateCertificate(null);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        Collection col = certFactorySpi
-                .engineGenerateCertificates(bais);
-        assertNull("Not null Collection", col);
-        try {
-            certFactorySpi.engineGenerateCertificates(null);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-
-        CRL ccCRL = certFactorySpi.engineGenerateCRL(bais);
-        assertNull("Not null CRL", ccCRL);
-        try {
-            certFactorySpi.engineGenerateCRL(null);
-            fail("CRLException must be thrown");
-        } catch (CRLException e) {
-        }
-
-        Collection colCRL = certFactorySpi
-                .engineGenerateCRLs(bais);
-        assertNull("Not null CRL", colCRL);
-        try {
-            certFactorySpi.engineGenerateCRLs(null);
-            fail("CRLException must be thrown");
-        } catch (CRLException e) {
-        }
-    }
-
-    /**
-     * Test for <code>CertificateFactorySpi</code> constructor 
-     * Assertion: constructs CertificateFactorySpi
-     */
-    public void testCertificateFactorySpi02() throws CertificateException,
-            CRLException {
-        CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
-        MyCertificateFactorySpi.putMode(true);
-        ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
-        DataInputStream dis = new DataInputStream(bais);
-        try {
-            certFactorySpi.engineGenerateCertPath(bais);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        certFactorySpi.engineGenerateCertPath(dis);
-        try {
-            certFactorySpi.engineGenerateCertPath(bais, "aa");
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        try {
-            certFactorySpi.engineGenerateCertPath(dis, "");
-            fail("IllegalArgumentException must be thrown");
-        } catch (IllegalArgumentException e) {
-        }
-        certFactorySpi.engineGenerateCertPath(dis, "ss");
-
-        try {
-            certFactorySpi.engineGenerateCertificate(bais);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        try {
-            certFactorySpi.engineGenerateCertificates(null);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        Certificate cert = certFactorySpi
-                .engineGenerateCertificate(dis);
-        assertNull("Result must be null", cert);
-        Collection col = certFactorySpi
-                .engineGenerateCertificates(dis);
-        assertNull("Result must be null", col);
-
-        try {
-            certFactorySpi.engineGenerateCRL(bais);
-            fail("CRLException must be thrown");
-        } catch (CRLException e) {
-        }
-        try {
-            certFactorySpi.engineGenerateCRLs(null);
-            fail("CRLException must be thrown");
-        } catch (CRLException e) {
-        }
-        CRL crl = certFactorySpi.engineGenerateCRL(dis);
-        assertNull("Result must be null", crl);
-        col = certFactorySpi.engineGenerateCRLs(dis);
-        assertNull("Result must be null", col);
-
-        List list = null;
-        try { 
-            certFactorySpi.engineGenerateCertPath(list);
-            fail("NullPointerException must be thrown");
-        } catch (NullPointerException e) {            
-        }
-        Iterator enc = certFactorySpi.engineGetCertPathEncodings();
-        assertTrue("Incorrect Iterator", enc.hasNext());
-    }
-    
-    /**
-     * Test for <code>CertificateFactorySpi</code> constructor 
-     * Assertion: constructs CertificateFactorySpi
-     */
-    public void testCertificateFactorySpi03() throws CertificateException,
-            CRLException {
-        CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
-        MyCertificateFactorySpi.putMode(false);
-        ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
-        DataInputStream dis = new DataInputStream(bais);
-        try {
-            certFactorySpi.engineGenerateCertPath(bais);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        try {
-            certFactorySpi.engineGenerateCertPath(dis);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        try {
-            certFactorySpi.engineGenerateCertPath(bais, "aa");
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        certFactorySpi.engineGenerateCertPath(dis, "");
-        certFactorySpi.engineGenerateCertPath(dis, "ss");
-
-        try {
-            certFactorySpi.engineGenerateCertificate(bais);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        try {
-            certFactorySpi.engineGenerateCertificates(null);
-            fail("CertificateException must be thrown");
-        } catch (CertificateException e) {
-        }
-        Certificate cert = certFactorySpi
-                .engineGenerateCertificate(dis);
-        assertNull("Result must be null", cert);
-        Collection col = certFactorySpi
-                .engineGenerateCertificates(dis);
-        assertNull("Result must be null", col);
-
-        try {
-            certFactorySpi.engineGenerateCRL(bais);
-            fail("CRLException must be thrown");
-        } catch (CRLException e) {
-        }
-        try {
-            certFactorySpi.engineGenerateCRLs(null);
-            fail("CRLException must be thrown");
-        } catch (CRLException e) {
-        }
-        CRL crl = certFactorySpi.engineGenerateCRL(dis);
-        assertNull("Result must be null", crl);
-        col = certFactorySpi.engineGenerateCRLs(dis);
-        assertNull("Result must be null", col);
-
-        List list = null;
-        certFactorySpi.engineGenerateCertPath(list);
-        Iterator enc = certFactorySpi.engineGetCertPathEncodings();
-        assertFalse("Incorrect Iterator", enc.hasNext());
-    }
-
-    
-    private static class extCertificateFactorySpi extends CertificateFactorySpi {
-        public Certificate engineGenerateCertificate(InputStream inStream)
-                throws CertificateException {
-            if (inStream == null) {
-                throw new CertificateException("InputStream null");
-            }
-            return null;
-        }
-
-        public Collection engineGenerateCertificates(InputStream inStream)
-                throws CertificateException {
-            if (inStream == null) {
-                throw new CertificateException("InputStream null");
-            }
-            return null;
-        }
-
-        public CRL engineGenerateCRL(InputStream inStream) throws CRLException {
-            if (inStream == null) {
-                throw new CRLException("InputStream null");
-            }
-            return null;
-        }
-
-        public Collection engineGenerateCRLs(InputStream inStream)
-                throws CRLException {
-            if (inStream == null) {
-                throw new CRLException("InputStream null");
-            }
-            return null;
-        }
-    }
-}
+/*
+ *  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.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.cert;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.InputStream;
+import java.security.cert.CRL;
+import java.security.cert.CRLException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactorySpi;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.harmony.security.tests.support.cert.MyCertificateFactorySpi;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>CertificateFactorySpi</code> class constructors and methods
+ * 
+ */
+
+public class CertificateFactorySpiTest extends TestCase {
+    /**
+     * Constructor for CertStoreSpiTest.
+     * 
+     * @param arg0
+     */
+    public CertificateFactorySpiTest(String arg0) {
+        super(arg0);
+    }
+
+    /**
+     * Test for <code>CertificateFactorySpi</code> constructor 
+     * Assertion: constructs CertificateFactorySpi
+     */
+    public void testCertificateFactorySpi01() throws CertificateException,
+            CRLException {
+        CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
+        ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
+        try {
+            certFactorySpi.engineGenerateCertPath(bais);
+            fail("UnsupportedOperationException must be thrown");
+        } catch (UnsupportedOperationException e) {
+        }
+        try {
+            certFactorySpi.engineGenerateCertPath(bais, "");
+            fail("UnsupportedOperationException must be thrown");
+        } catch (UnsupportedOperationException e) {
+        }
+        try {
+            List list = null;
+            certFactorySpi.engineGenerateCertPath(list);
+            fail("UnsupportedOperationException must be thrown");
+        } catch (UnsupportedOperationException e) {
+        }
+        try {
+            certFactorySpi.engineGetCertPathEncodings();
+            fail("UnsupportedOperationException must be thrown");
+        } catch (UnsupportedOperationException e) {
+        }
+        Certificate cc = certFactorySpi
+                .engineGenerateCertificate(bais);
+        assertNull("Not null Cerificate", cc);
+        try {
+            certFactorySpi.engineGenerateCertificate(null);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        Collection col = certFactorySpi
+                .engineGenerateCertificates(bais);
+        assertNull("Not null Collection", col);
+        try {
+            certFactorySpi.engineGenerateCertificates(null);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+
+        CRL ccCRL = certFactorySpi.engineGenerateCRL(bais);
+        assertNull("Not null CRL", ccCRL);
+        try {
+            certFactorySpi.engineGenerateCRL(null);
+            fail("CRLException must be thrown");
+        } catch (CRLException e) {
+        }
+
+        Collection colCRL = certFactorySpi
+                .engineGenerateCRLs(bais);
+        assertNull("Not null CRL", colCRL);
+        try {
+            certFactorySpi.engineGenerateCRLs(null);
+            fail("CRLException must be thrown");
+        } catch (CRLException e) {
+        }
+    }
+
+    /**
+     * Test for <code>CertificateFactorySpi</code> constructor 
+     * Assertion: constructs CertificateFactorySpi
+     */
+    public void testCertificateFactorySpi02() throws CertificateException,
+            CRLException {
+        CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
+        MyCertificateFactorySpi.putMode(true);
+        ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
+        DataInputStream dis = new DataInputStream(bais);
+        try {
+            certFactorySpi.engineGenerateCertPath(bais);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        certFactorySpi.engineGenerateCertPath(dis);
+        try {
+            certFactorySpi.engineGenerateCertPath(bais, "aa");
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        try {
+            certFactorySpi.engineGenerateCertPath(dis, "");
+            fail("IllegalArgumentException must be thrown");
+        } catch (IllegalArgumentException e) {
+        }
+        certFactorySpi.engineGenerateCertPath(dis, "ss");
+
+        try {
+            certFactorySpi.engineGenerateCertificate(bais);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        try {
+            certFactorySpi.engineGenerateCertificates(null);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        Certificate cert = certFactorySpi
+                .engineGenerateCertificate(dis);
+        assertNull("Result must be null", cert);
+        Collection col = certFactorySpi
+                .engineGenerateCertificates(dis);
+        assertNull("Result must be null", col);
+
+        try {
+            certFactorySpi.engineGenerateCRL(bais);
+            fail("CRLException must be thrown");
+        } catch (CRLException e) {
+        }
+        try {
+            certFactorySpi.engineGenerateCRLs(null);
+            fail("CRLException must be thrown");
+        } catch (CRLException e) {
+        }
+        CRL crl = certFactorySpi.engineGenerateCRL(dis);
+        assertNull("Result must be null", crl);
+        col = certFactorySpi.engineGenerateCRLs(dis);
+        assertNull("Result must be null", col);
+
+        List list = null;
+        try { 
+            certFactorySpi.engineGenerateCertPath(list);
+            fail("NullPointerException must be thrown");
+        } catch (NullPointerException e) {            
+        }
+        Iterator enc = certFactorySpi.engineGetCertPathEncodings();
+        assertTrue("Incorrect Iterator", enc.hasNext());
+    }
+    
+    /**
+     * Test for <code>CertificateFactorySpi</code> constructor 
+     * Assertion: constructs CertificateFactorySpi
+     */
+    public void testCertificateFactorySpi03() throws CertificateException,
+            CRLException {
+        CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
+        MyCertificateFactorySpi.putMode(false);
+        ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
+        DataInputStream dis = new DataInputStream(bais);
+        try {
+            certFactorySpi.engineGenerateCertPath(bais);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        try {
+            certFactorySpi.engineGenerateCertPath(dis);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        try {
+            certFactorySpi.engineGenerateCertPath(bais, "aa");
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        certFactorySpi.engineGenerateCertPath(dis, "");
+        certFactorySpi.engineGenerateCertPath(dis, "ss");
+
+        try {
+            certFactorySpi.engineGenerateCertificate(bais);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        try {
+            certFactorySpi.engineGenerateCertificates(null);
+            fail("CertificateException must be thrown");
+        } catch (CertificateException e) {
+        }
+        Certificate cert = certFactorySpi
+                .engineGenerateCertificate(dis);
+        assertNull("Result must be null", cert);
+        Collection col = certFactorySpi
+                .engineGenerateCertificates(dis);
+        assertNull("Result must be null", col);
+
+        try {
+            certFactorySpi.engineGenerateCRL(bais);
+            fail("CRLException must be thrown");
+        } catch (CRLException e) {
+        }
+        try {
+            certFactorySpi.engineGenerateCRLs(null);
+            fail("CRLException must be thrown");
+        } catch (CRLException e) {
+        }
+        CRL crl = certFactorySpi.engineGenerateCRL(dis);
+        assertNull("Result must be null", crl);
+        col = certFactorySpi.engineGenerateCRLs(dis);
+        assertNull("Result must be null", col);
+
+        List list = null;
+        certFactorySpi.engineGenerateCertPath(list);
+        Iterator enc = certFactorySpi.engineGetCertPathEncodings();
+        assertFalse("Incorrect Iterator", enc.hasNext());
+    }
+
+    
+    private static class extCertificateFactorySpi extends CertificateFactorySpi {
+        public Certificate engineGenerateCertificate(InputStream inStream)
+                throws CertificateException {
+            if (inStream == null) {
+                throw new CertificateException("InputStream null");
+            }
+            return null;
+        }
+
+        public Collection engineGenerateCertificates(InputStream inStream)
+                throws CertificateException {
+            if (inStream == null) {
+                throw new CertificateException("InputStream null");
+            }
+            return null;
+        }
+
+        public CRL engineGenerateCRL(InputStream inStream) throws CRLException {
+            if (inStream == null) {
+                throw new CRLException("InputStream null");
+            }
+            return null;
+        }
+
+        public Collection engineGenerateCRLs(InputStream inStream)
+                throws CRLException {
+            if (inStream == null) {
+                throw new CRLException("InputStream null");
+            }
+            return null;
+        }
+    }
+}

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateNotYetValidExceptionTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateNotYetValidExceptionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateNotYetValidExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateNotYetValidExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateNotYetValidExceptionTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateNotYetValidExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateNotYetValidExceptionTest.java Tue Jun 20 01:11:04 2006
@@ -1,114 +1,114 @@
-/*
- *  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.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.cert.CertificateNotYetValidException;
-
-import junit.framework.TestCase;
-
-
-/**
- * Tests for <code>DigestException</code> class constructors and methods.
- * 
- */
-public class CertificateNotYetValidExceptionTest extends TestCase {
-
-    public static void main(String[] args) {
-    }
-
-    /**
-     * Constructor for CertificateNotYetValidExceptionTests.
-     * 
-     * @param arg0
-     */
-    public CertificateNotYetValidExceptionTest(String arg0) {
-        super(arg0);
-    }
-
-    static String[] msgs = {
-            "",
-            "Check new message",
-            "Check new message Check new message Check new message Check new message Check new message" };
-
-    static Throwable tCause = new Throwable("Throwable for exception");
-
-    static String createErr(Exception tE, Exception eE) {
-        return "CertificateNotYetValidException: ".concat(tE.toString())
-                .concat(" is not equal to caught exception: ").concat(
-                        eE.toString());
-    }
-
-    /**
-     * Test for <code>CertificateNotYetValidException()</code> constructor
-     * Assertion: constructs CertificateNotYetValidException with no detail
-     * message
-     */
-    public void testCertificateNotYetValidException01() {
-        CertificateNotYetValidException tE = new CertificateNotYetValidException();
-        assertNull("getMessage() must return null.", tE.getMessage());
-        assertNull("getCause() must return null", tE.getCause());
-        try {
-            throw tE;
-        } catch (Exception e) {
-            assertTrue(createErr(tE, e), tE.equals(e));
-        }
-    }
-
-    /**
-     * Test for <code>CertificateNotYetValidException(String)</code>
-     * constructor Assertion: constructs CertificateNotYetValidException with
-     * detail message msg. Parameter <code>msg</code> is not null.
-     */
-    public void testCertificateNotYetValidException02() {
-        CertificateNotYetValidException tE;
-        for (int i = 0; i < msgs.length; i++) {
-            tE = new CertificateNotYetValidException(msgs[i]);
-            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
-                    .getMessage(), msgs[i]);
-            assertNull("getCause() must return null", tE.getCause());
-            try {
-                throw tE;
-            } catch (Exception e) {
-                assertTrue(createErr(tE, e), tE.equals(e));
-            }
-        }
-    }
-
-    /**
-     * Test for <code>CertificateNotYetValidException(String)</code>
-     * constructor Assertion: constructs CertificateNotYetValidException when
-     * <code>msg</code> is null
-     */
-    public void testCertificateNotYetValidException03() {
-        String msg = null;
-        CertificateNotYetValidException tE = new CertificateNotYetValidException(
-                msg);
-        assertNull("getMessage() must return null.", tE.getMessage());
-        assertNull("getCause() must return null", tE.getCause());
-        try {
-            throw tE;
-        } catch (Exception e) {
-            assertTrue(createErr(tE, e), tE.equals(e));
-        }
-    }
-
-}
+/*
+ *  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.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.cert;
+
+import java.security.cert.CertificateNotYetValidException;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Tests for <code>DigestException</code> class constructors and methods.
+ * 
+ */
+public class CertificateNotYetValidExceptionTest extends TestCase {
+
+    public static void main(String[] args) {
+    }
+
+    /**
+     * Constructor for CertificateNotYetValidExceptionTests.
+     * 
+     * @param arg0
+     */
+    public CertificateNotYetValidExceptionTest(String arg0) {
+        super(arg0);
+    }
+
+    static String[] msgs = {
+            "",
+            "Check new message",
+            "Check new message Check new message Check new message Check new message Check new message" };
+
+    static Throwable tCause = new Throwable("Throwable for exception");
+
+    static String createErr(Exception tE, Exception eE) {
+        return "CertificateNotYetValidException: ".concat(tE.toString())
+                .concat(" is not equal to caught exception: ").concat(
+                        eE.toString());
+    }
+
+    /**
+     * Test for <code>CertificateNotYetValidException()</code> constructor
+     * Assertion: constructs CertificateNotYetValidException with no detail
+     * message
+     */
+    public void testCertificateNotYetValidException01() {
+        CertificateNotYetValidException tE = new CertificateNotYetValidException();
+        assertNull("getMessage() must return null.", tE.getMessage());
+        assertNull("getCause() must return null", tE.getCause());
+        try {
+            throw tE;
+        } catch (Exception e) {
+            assertTrue(createErr(tE, e), tE.equals(e));
+        }
+    }
+
+    /**
+     * Test for <code>CertificateNotYetValidException(String)</code>
+     * constructor Assertion: constructs CertificateNotYetValidException with
+     * detail message msg. Parameter <code>msg</code> is not null.
+     */
+    public void testCertificateNotYetValidException02() {
+        CertificateNotYetValidException tE;
+        for (int i = 0; i < msgs.length; i++) {
+            tE = new CertificateNotYetValidException(msgs[i]);
+            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
+                    .getMessage(), msgs[i]);
+            assertNull("getCause() must return null", tE.getCause());
+            try {
+                throw tE;
+            } catch (Exception e) {
+                assertTrue(createErr(tE, e), tE.equals(e));
+            }
+        }
+    }
+
+    /**
+     * Test for <code>CertificateNotYetValidException(String)</code>
+     * constructor Assertion: constructs CertificateNotYetValidException when
+     * <code>msg</code> is null
+     */
+    public void testCertificateNotYetValidException03() {
+        String msg = null;
+        CertificateNotYetValidException tE = new CertificateNotYetValidException(
+                msg);
+        assertNull("getMessage() must return null.", tE.getMessage());
+        assertNull("getCause() must return null", tE.getCause());
+        try {
+            throw tE;
+        } catch (Exception e) {
+            assertTrue(createErr(tE, e), tE.equals(e));
+        }
+    }
+
+}

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateParsingExceptionTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateParsingExceptionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateParsingExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateParsingExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateParsingExceptionTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateParsingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateParsingExceptionTest.java Tue Jun 20 01:11:04 2006
@@ -1,243 +1,243 @@
-/*
- *  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.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.cert.CertificateParsingException;
-
-import junit.framework.TestCase;
-
-
-/**
- * Tests for <code>CertificateParsingException</code> class constructors and
- * methods.
- * 
- */
-public class CertificateParsingExceptionTest extends TestCase {
-
-    public static void main(String[] args) {
-    }
-
-    /**
-     * Constructor for CertificateParsingExceptionTests.
-     * 
-     * @param arg0
-     */
-    public CertificateParsingExceptionTest(String arg0) {
-        super(arg0);
-    }
-
-    private static String[] msgs = {
-            "",
-            "Check new message",
-            "Check new message Check new message Check new message Check new message Check new message" };
-
-    private static Throwable tCause = new Throwable("Throwable for exception");
-
-    static String createErr(Exception tE, Exception eE) {
-        return "CertificateParsingException: ".concat(tE.toString()).concat(
-                " is not equal to caught exception: ").concat(eE.toString());
-    }
-
-    /**
-     * Test for <code>CertificateParsingException()</code> constructor
-     * Assertion: constructs CertificateParsingException with no detail message
-     */
-    public void testCertificateParsingException01() {
-        CertificateParsingException tE = new CertificateParsingException();
-        assertNull("getMessage() must return null.", tE.getMessage());
-        assertNull("getCause() must return null", tE.getCause());
-        try {
-            throw tE;
-        } catch (Exception e) {
-            assertTrue(createErr(tE, e), tE.equals(e));
-        }
-    }
-
-    /**
-     * Test for <code>CertificateParsingException(String)</code> constructor
-     * Assertion: constructs CertificateParsingException with detail message
-     * msg. Parameter <code>msg</code> is not null.
-     */
-    public void testCertificateParsingException02() {
-        CertificateParsingException tE;
-        for (int i = 0; i < msgs.length; i++) {
-            tE = new CertificateParsingException(msgs[i]);
-            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
-                    .getMessage(), msgs[i]);
-            assertNull("getCause() must return null", tE.getCause());
-            try {
-                throw tE;
-            } catch (Exception e) {
-                assertTrue(createErr(tE, e), tE.equals(e));
-            }
-        }
-    }
-
-    /**
-     * Test for <code>CertificateParsingException(String)</code> constructor
-     * Assertion: constructs CertificateParsingException when <code>msg</code>
-     * is null
-     */
-    public void testCertificateParsingException03() {
-        String msg = null;
-        CertificateParsingException tE = new CertificateParsingException(msg);
-        assertNull("getMessage() must return null.", tE.getMessage());
-        assertNull("getCause() must return null", tE.getCause());
-        try {
-            throw tE;
-        } catch (Exception e) {
-            assertTrue(createErr(tE, e), tE.equals(e));
-        }
-    }
-
-    /**
-     * Test for <code>CertificateParsingException(Throwable)</code>
-     * constructor Assertion: constructs CertificateParsingException when
-     * <code>cause</code> is null
-     */
-    public void testCertificateParsingException04() {
-        Throwable cause = null;
-        CertificateParsingException tE = new CertificateParsingException(cause);
-        assertNull("getMessage() must return null.", tE.getMessage());
-        assertNull("getCause() must return null", tE.getCause());
-        try {
-            throw tE;
-        } catch (Exception e) {
-            assertTrue(createErr(tE, e), tE.equals(e));
-        }
-    }
-
-    /**
-     * Test for <code>CertificateParsingException(Throwable)</code>
-     * constructor Assertion: constructs CertificateParsingException when
-     * <code>cause</code> is not null
-     */
-    public void testCertificateParsingException05() {
-        CertificateParsingException tE = new CertificateParsingException(tCause);
-        if (tE.getMessage() != null) {
-            String toS = tCause.toString();
-            String getM = tE.getMessage();
-            assertTrue("getMessage() should contain ".concat(toS), (getM
-                    .indexOf(toS) != -1));
-        }
-        assertNotNull("getCause() must not return null", tE.getCause());
-        assertEquals("getCause() must return ".concat(tCause.toString()), tE
-                .getCause(), tCause);
-        try {
-            throw tE;
-        } catch (Exception e) {
-            assertTrue(createErr(tE, e), tE.equals(e));
-        }
-    }
-
-    /**
-     * Test for <code>CertificateParsingException(String, Throwable)</code>
-     * constructor Assertion: constructs CertificateParsingException when
-     * <code>cause</code> is null <code>msg</code> is null
-     */
-    public void testCertificateParsingException06() {
-        CertificateParsingException tE = new CertificateParsingException(null,
-                null);
-        assertNull("getMessage() must return null", tE.getMessage());
-        assertNull("getCause() must return null", tE.getCause());
-        try {
-            throw tE;
-        } catch (Exception e) {
-            assertTrue(createErr(tE, e), tE.equals(e));
-        }
-    }
-
-    /**
-     * Test for <code>CertificateParsingException(String, Throwable)</code>
-     * constructor Assertion: constructs CertificateParsingException when
-     * <code>cause</code> is null <code>msg</code> is not null
-     */
-    public void testCertificateParsingException07() {
-        CertificateParsingException tE;
-        for (int i = 0; i < msgs.length; i++) {
-            tE = new CertificateParsingException(msgs[i], null);
-            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
-                    .getMessage(), msgs[i]);
-            assertNull("getCause() must return null", tE.getCause());
-            try {
-                throw tE;
-            } catch (Exception e) {
-                assertTrue(createErr(tE, e), tE.equals(e));
-            }
-        }
-    }
-
-    /**
-     * Test for <code>CertificateParsingException(String, Throwable)</code>
-     * constructor Assertion: constructs CertificateParsingException when
-     * <code>cause</code> is not null <code>msg</code> is null
-     */
-    public void testCertificateParsingException08() {
-        CertificateParsingException tE = new CertificateParsingException(null,
-                tCause);
-        if (tE.getMessage() != null) {
-            String toS = tCause.toString();
-            String getM = tE.getMessage();
-            assertTrue("getMessage() must should ".concat(toS), (getM
-                    .indexOf(toS) != -1));
-        }
-        assertNotNull("getCause() must not return null", tE.getCause());
-        assertEquals("getCause() must return ".concat(tCause.toString()), tE
-                .getCause(), tCause);
-        try {
-            throw tE;
-        } catch (Exception e) {
-            assertTrue(createErr(tE, e), tE.equals(e));
-        }
-    }
-
-    /**
-     * Test for <code>CertificateParsingException(String, Throwable)</code>
-     * constructor Assertion: constructs CertificateParsingException when
-     * <code>cause</code> is not null <code>msg</code> is not null
-     */
-    public void testCertificateParsingException09() {
-        CertificateParsingException tE;
-        for (int i = 0; i < msgs.length; i++) {
-            tE = new CertificateParsingException(msgs[i], tCause);
-            String getM = tE.getMessage();
-            String toS = tCause.toString();
-            if (msgs[i].length() > 0) {
-                assertTrue("getMessage() must contain ".concat(msgs[i]), getM
-                        .indexOf(msgs[i]) != -1);
-                if (!getM.equals(msgs[i])) {
-                    assertTrue("getMessage() should contain ".concat(toS), getM
-                            .indexOf(toS) != -1);
-                }
-            }
-            assertNotNull("getCause() must not return null", tE.getCause());
-            assertEquals("getCause() must return ".concat(tCause.toString()),
-                    tE.getCause(), tCause);
-
-            try {
-                throw tE;
-            } catch (Exception e) {
-                assertTrue(createErr(tE, e), tE.equals(e));
-            }
-        }
-    }
-}
+/*
+ *  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.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.cert;
+
+import java.security.cert.CertificateParsingException;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Tests for <code>CertificateParsingException</code> class constructors and
+ * methods.
+ * 
+ */
+public class CertificateParsingExceptionTest extends TestCase {
+
+    public static void main(String[] args) {
+    }
+
+    /**
+     * Constructor for CertificateParsingExceptionTests.
+     * 
+     * @param arg0
+     */
+    public CertificateParsingExceptionTest(String arg0) {
+        super(arg0);
+    }
+
+    private static String[] msgs = {
+            "",
+            "Check new message",
+            "Check new message Check new message Check new message Check new message Check new message" };
+
+    private static Throwable tCause = new Throwable("Throwable for exception");
+
+    static String createErr(Exception tE, Exception eE) {
+        return "CertificateParsingException: ".concat(tE.toString()).concat(
+                " is not equal to caught exception: ").concat(eE.toString());
+    }
+
+    /**
+     * Test for <code>CertificateParsingException()</code> constructor
+     * Assertion: constructs CertificateParsingException with no detail message
+     */
+    public void testCertificateParsingException01() {
+        CertificateParsingException tE = new CertificateParsingException();
+        assertNull("getMessage() must return null.", tE.getMessage());
+        assertNull("getCause() must return null", tE.getCause());
+        try {
+            throw tE;
+        } catch (Exception e) {
+            assertTrue(createErr(tE, e), tE.equals(e));
+        }
+    }
+
+    /**
+     * Test for <code>CertificateParsingException(String)</code> constructor
+     * Assertion: constructs CertificateParsingException with detail message
+     * msg. Parameter <code>msg</code> is not null.
+     */
+    public void testCertificateParsingException02() {
+        CertificateParsingException tE;
+        for (int i = 0; i < msgs.length; i++) {
+            tE = new CertificateParsingException(msgs[i]);
+            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
+                    .getMessage(), msgs[i]);
+            assertNull("getCause() must return null", tE.getCause());
+            try {
+                throw tE;
+            } catch (Exception e) {
+                assertTrue(createErr(tE, e), tE.equals(e));
+            }
+        }
+    }
+
+    /**
+     * Test for <code>CertificateParsingException(String)</code> constructor
+     * Assertion: constructs CertificateParsingException when <code>msg</code>
+     * is null
+     */
+    public void testCertificateParsingException03() {
+        String msg = null;
+        CertificateParsingException tE = new CertificateParsingException(msg);
+        assertNull("getMessage() must return null.", tE.getMessage());
+        assertNull("getCause() must return null", tE.getCause());
+        try {
+            throw tE;
+        } catch (Exception e) {
+            assertTrue(createErr(tE, e), tE.equals(e));
+        }
+    }
+
+    /**
+     * Test for <code>CertificateParsingException(Throwable)</code>
+     * constructor Assertion: constructs CertificateParsingException when
+     * <code>cause</code> is null
+     */
+    public void testCertificateParsingException04() {
+        Throwable cause = null;
+        CertificateParsingException tE = new CertificateParsingException(cause);
+        assertNull("getMessage() must return null.", tE.getMessage());
+        assertNull("getCause() must return null", tE.getCause());
+        try {
+            throw tE;
+        } catch (Exception e) {
+            assertTrue(createErr(tE, e), tE.equals(e));
+        }
+    }
+
+    /**
+     * Test for <code>CertificateParsingException(Throwable)</code>
+     * constructor Assertion: constructs CertificateParsingException when
+     * <code>cause</code> is not null
+     */
+    public void testCertificateParsingException05() {
+        CertificateParsingException tE = new CertificateParsingException(tCause);
+        if (tE.getMessage() != null) {
+            String toS = tCause.toString();
+            String getM = tE.getMessage();
+            assertTrue("getMessage() should contain ".concat(toS), (getM
+                    .indexOf(toS) != -1));
+        }
+        assertNotNull("getCause() must not return null", tE.getCause());
+        assertEquals("getCause() must return ".concat(tCause.toString()), tE
+                .getCause(), tCause);
+        try {
+            throw tE;
+        } catch (Exception e) {
+            assertTrue(createErr(tE, e), tE.equals(e));
+        }
+    }
+
+    /**
+     * Test for <code>CertificateParsingException(String, Throwable)</code>
+     * constructor Assertion: constructs CertificateParsingException when
+     * <code>cause</code> is null <code>msg</code> is null
+     */
+    public void testCertificateParsingException06() {
+        CertificateParsingException tE = new CertificateParsingException(null,
+                null);
+        assertNull("getMessage() must return null", tE.getMessage());
+        assertNull("getCause() must return null", tE.getCause());
+        try {
+            throw tE;
+        } catch (Exception e) {
+            assertTrue(createErr(tE, e), tE.equals(e));
+        }
+    }
+
+    /**
+     * Test for <code>CertificateParsingException(String, Throwable)</code>
+     * constructor Assertion: constructs CertificateParsingException when
+     * <code>cause</code> is null <code>msg</code> is not null
+     */
+    public void testCertificateParsingException07() {
+        CertificateParsingException tE;
+        for (int i = 0; i < msgs.length; i++) {
+            tE = new CertificateParsingException(msgs[i], null);
+            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
+                    .getMessage(), msgs[i]);
+            assertNull("getCause() must return null", tE.getCause());
+            try {
+                throw tE;
+            } catch (Exception e) {
+                assertTrue(createErr(tE, e), tE.equals(e));
+            }
+        }
+    }
+
+    /**
+     * Test for <code>CertificateParsingException(String, Throwable)</code>
+     * constructor Assertion: constructs CertificateParsingException when
+     * <code>cause</code> is not null <code>msg</code> is null
+     */
+    public void testCertificateParsingException08() {
+        CertificateParsingException tE = new CertificateParsingException(null,
+                tCause);
+        if (tE.getMessage() != null) {
+            String toS = tCause.toString();
+            String getM = tE.getMessage();
+            assertTrue("getMessage() must should ".concat(toS), (getM
+                    .indexOf(toS) != -1));
+        }
+        assertNotNull("getCause() must not return null", tE.getCause());
+        assertEquals("getCause() must return ".concat(tCause.toString()), tE
+                .getCause(), tCause);
+        try {
+            throw tE;
+        } catch (Exception e) {
+            assertTrue(createErr(tE, e), tE.equals(e));
+        }
+    }
+
+    /**
+     * Test for <code>CertificateParsingException(String, Throwable)</code>
+     * constructor Assertion: constructs CertificateParsingException when
+     * <code>cause</code> is not null <code>msg</code> is not null
+     */
+    public void testCertificateParsingException09() {
+        CertificateParsingException tE;
+        for (int i = 0; i < msgs.length; i++) {
+            tE = new CertificateParsingException(msgs[i], tCause);
+            String getM = tE.getMessage();
+            String toS = tCause.toString();
+            if (msgs[i].length() > 0) {
+                assertTrue("getMessage() must contain ".concat(msgs[i]), getM
+                        .indexOf(msgs[i]) != -1);
+                if (!getM.equals(msgs[i])) {
+                    assertTrue("getMessage() should contain ".concat(toS), getM
+                            .indexOf(toS) != -1);
+                }
+            }
+            assertNotNull("getCause() must not return null", tE.getCause());
+            assertEquals("getCause() must return ".concat(tCause.toString()),
+                    tE.getCause(), tCause);
+
+            try {
+                throw tE;
+            } catch (Exception e) {
+                assertTrue(createErr(tE, e), tE.equals(e));
+            }
+        }
+    }
+}

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateTest.java Tue Jun 20 01:11:04 2006
@@ -19,17 +19,19 @@
 * @version $Revision$
 */
 
-package java.security.cert;
+package org.apache.harmony.security.tests.java.security.cert;
 
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
 import java.security.SignatureException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateEncodingException;
+import java.security.cert.CertificateException;
 
 import org.apache.harmony.security.tests.support.cert.MyCertificate;
 
 import junit.framework.TestCase;
-
 
 /**
  * Tests for <code>Certificate</code> fields and methods

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CollectionCertStoreParametersTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CollectionCertStoreParametersTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CollectionCertStoreParametersTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CollectionCertStoreParametersTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CollectionCertStoreParametersTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CollectionCertStoreParametersTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CollectionCertStoreParametersTest.java Tue Jun 20 01:11:04 2006
@@ -19,15 +19,16 @@
 * @version $Revision$
 */
 
-package java.security.cert;
+package org.apache.harmony.security.tests.java.security.cert;
 
+import java.security.cert.CertStoreParameters;
+import java.security.cert.CollectionCertStoreParameters;
 import java.util.Collection;
 import java.util.Vector;
 
 import org.apache.harmony.security.tests.support.cert.MyCertificate;
 
 import junit.framework.TestCase;
-
 
 /**
  * Tests for <code>CollectionCertStoreParameters</code>

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/LDAPCertStoreParametersTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/LDAPCertStoreParametersTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/LDAPCertStoreParametersTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/LDAPCertStoreParametersTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/LDAPCertStoreParametersTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/LDAPCertStoreParametersTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/LDAPCertStoreParametersTest.java Tue Jun 20 01:11:04 2006
@@ -19,7 +19,10 @@
 * @version $Revision$
 */
 
-package java.security.cert;
+package org.apache.harmony.security.tests.java.security.cert;
+
+import java.security.cert.CertStoreParameters;
+import java.security.cert.LDAPCertStoreParameters;
 
 import junit.framework.TestCase;
 



Mime
View raw message