harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r443539 [20/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/ja...
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/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?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/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 Thu Sep 14 18:17:39 2006
@@ -1,289 +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 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;
-        }
-    }
-}
+/*
+ *  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;
+        }
+    }
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/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?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/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 Thu Sep 14 18:17:39 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 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));
-        }
-    }
-
-}
+/*
+ *  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));
+        }
+    }
+
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/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?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/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 Thu Sep 14 18:17:39 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 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));
-            }
-        }
-    }
-}
+/*
+ *  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));
+            }
+        }
+    }
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/PKIXBuilderParametersTest.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/PKIXBuilderParametersTest.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/cert/PKIXBuilderParametersTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/PKIXBuilderParametersTest.java Thu Sep 14 18:17:39 2006
@@ -1,183 +1,183 @@
-/*
- *  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 Vladimir N. Molotkov
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.tests.java.security.cert;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore;
-import java.security.cert.PKIXBuilderParameters;
-import java.security.cert.PKIXParameters;
-import java.security.cert.X509CertSelector;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.harmony.security.tests.support.cert.TestUtils;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>PKIXBuilderParameters</code> fields and methods
- * 
- */
-public class PKIXBuilderParametersTest extends TestCase {
-    private static final int DEFAULT_MAX_PATH_LEN = 5;
-
-    /**
-     * Constructor for PKIXBuilderParametersTest.
-     * @param name
-     */
-    public PKIXBuilderParametersTest(String name) {
-        super(name);
-    }
-
-    /**
-     * Test #1 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
-     * constructor<br>
-     * Assertion: creates an instance of <code>PKIXBuilderParameters</code>
-     * @throws InvalidAlgorithmParameterException
-     */
-    public final void testPKIXBuilderParametersSetCertSelector01()
-        throws InvalidAlgorithmParameterException {
-        Set taSet = TestUtils.getTrustAnchorSet();
-        if (taSet == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor set)");
-        }
-        // both parameters are valid and non-null
-        PKIXParameters p =
-            new PKIXBuilderParameters(taSet, new X509CertSelector());
-        assertTrue("instanceOf", p instanceof PKIXBuilderParameters);
-        assertNotNull("certSelector", p.getTargetCertConstraints());
-    }
-
-    /**
-     * Test #2 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
-     * constructor<br>
-     * Assertion: creates an instance of <code>PKIXBuilderParameters</code>
-     * @throws InvalidAlgorithmParameterException
-     */
-    public final void testPKIXBuilderParametersSetCertSelector02()
-        throws InvalidAlgorithmParameterException {
-        Set taSet = TestUtils.getTrustAnchorSet();
-        if (taSet == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor set)");
-        }
-        // both parameters are valid but CertSelector is null
-        PKIXParameters p = new PKIXBuilderParameters(taSet, null);
-        assertTrue("instanceOf", p instanceof PKIXBuilderParameters);
-        assertNull("certSelector", p.getTargetCertConstraints());
-    }
-
-    /**
-     * Test #3 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
-     * constructor<br>
-     * Assertion: ... the <code>Set</code> is copied to protect against
-     * subsequent modifications
-     * @throws InvalidAlgorithmParameterException
-     */
-    public final void testPKIXBuilderParametersSetCertSelector03()
-        throws InvalidAlgorithmParameterException {
-        Set taSet = TestUtils.getTrustAnchorSet();
-        if (taSet == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor set)");
-        }
-        HashSet originalSet = (HashSet)taSet;
-        HashSet originalSetCopy = (HashSet)originalSet.clone();
-        // create test object using originalSet 
-        PKIXBuilderParameters pp =
-            new PKIXBuilderParameters(originalSetCopy, null);
-        // modify originalSet
-        originalSetCopy.clear();
-        // check that test object's internal state
-        // has not been affected by the above modification
-        Set returnedSet = pp.getTrustAnchors();
-        assertEquals(originalSet, returnedSet);
-    }
-
-    /**
-     * Test #4 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
-     * constructor<br>
-     * Assertion: <code>NullPointerException</code> -
-     * if the specified <code>Set</code> is null
-     */
-    public final void testPKIXBuilderParametersSetCertSelector04() throws Exception {
-        try {
-            // pass null
-            new PKIXBuilderParameters((Set)null, null);
-            fail("NPE expected");
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * Test #5 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
-     * constructor<br>
-     * Assertion: <code>InvalidAlgorithmParameterException</code> -
-     * if the specified <code>Set</code> is empty
-     * (<code>trustAnchors.isEmpty() == true</code>)
-     */
-    public final void testPKIXBuilderParametersSetCertSelector05() {
-        try {
-            // use empty set
-            new PKIXBuilderParameters(new HashSet(), null);
-            fail("InvalidAlgorithmParameterException expected");
-        } catch (InvalidAlgorithmParameterException e) {
-        }
-    }
-
-    /**
-     * Test #6 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
-     * constructor<br>
-     * Assertion: <code>ClassCastException</code> -
-     * if any of the elements in the <code>Set</code> are not of type
-     * <code>java.security.cert.TrustAnchor</code>
-     */
-    public final void testPKIXBuilderParametersSetCertSelector06() throws Exception {
-        Set taSet = TestUtils.getTrustAnchorSet();
-        if (taSet == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor set)");
-        }
-
-        // add wrong object to valid set
-        assertTrue(taSet.add(new Object()));
-
-        try {
-            new PKIXBuilderParameters(taSet, null);
-            fail("ClassCastException expected");
-        } catch (ClassCastException e) {
-        }
-    }
-
-    /**
-     * Test #4 for <code>PKIXBuilderParameters(KeyStore, CertSelector)</code>
-     * constructor<br>
-     * Assertion: <code>NullPointerException</code> -
-     * if the <code>keystore</code> is <code>null</code>
-     */
-    public final void testPKIXBuilderParametersKeyStoreCertSelector04() throws Exception {
-        try {
-            // pass null
-            new PKIXBuilderParameters((KeyStore)null, null);
-            fail("NPE expected");
-        } catch (NullPointerException 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 Vladimir N. Molotkov
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.cert;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.KeyStore;
+import java.security.cert.PKIXBuilderParameters;
+import java.security.cert.PKIXParameters;
+import java.security.cert.X509CertSelector;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.harmony.security.tests.support.cert.TestUtils;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>PKIXBuilderParameters</code> fields and methods
+ * 
+ */
+public class PKIXBuilderParametersTest extends TestCase {
+    private static final int DEFAULT_MAX_PATH_LEN = 5;
+
+    /**
+     * Constructor for PKIXBuilderParametersTest.
+     * @param name
+     */
+    public PKIXBuilderParametersTest(String name) {
+        super(name);
+    }
+
+    /**
+     * Test #1 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
+     * constructor<br>
+     * Assertion: creates an instance of <code>PKIXBuilderParameters</code>
+     * @throws InvalidAlgorithmParameterException
+     */
+    public final void testPKIXBuilderParametersSetCertSelector01()
+        throws InvalidAlgorithmParameterException {
+        Set taSet = TestUtils.getTrustAnchorSet();
+        if (taSet == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor set)");
+        }
+        // both parameters are valid and non-null
+        PKIXParameters p =
+            new PKIXBuilderParameters(taSet, new X509CertSelector());
+        assertTrue("instanceOf", p instanceof PKIXBuilderParameters);
+        assertNotNull("certSelector", p.getTargetCertConstraints());
+    }
+
+    /**
+     * Test #2 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
+     * constructor<br>
+     * Assertion: creates an instance of <code>PKIXBuilderParameters</code>
+     * @throws InvalidAlgorithmParameterException
+     */
+    public final void testPKIXBuilderParametersSetCertSelector02()
+        throws InvalidAlgorithmParameterException {
+        Set taSet = TestUtils.getTrustAnchorSet();
+        if (taSet == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor set)");
+        }
+        // both parameters are valid but CertSelector is null
+        PKIXParameters p = new PKIXBuilderParameters(taSet, null);
+        assertTrue("instanceOf", p instanceof PKIXBuilderParameters);
+        assertNull("certSelector", p.getTargetCertConstraints());
+    }
+
+    /**
+     * Test #3 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
+     * constructor<br>
+     * Assertion: ... the <code>Set</code> is copied to protect against
+     * subsequent modifications
+     * @throws InvalidAlgorithmParameterException
+     */
+    public final void testPKIXBuilderParametersSetCertSelector03()
+        throws InvalidAlgorithmParameterException {
+        Set taSet = TestUtils.getTrustAnchorSet();
+        if (taSet == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor set)");
+        }
+        HashSet originalSet = (HashSet)taSet;
+        HashSet originalSetCopy = (HashSet)originalSet.clone();
+        // create test object using originalSet 
+        PKIXBuilderParameters pp =
+            new PKIXBuilderParameters(originalSetCopy, null);
+        // modify originalSet
+        originalSetCopy.clear();
+        // check that test object's internal state
+        // has not been affected by the above modification
+        Set returnedSet = pp.getTrustAnchors();
+        assertEquals(originalSet, returnedSet);
+    }
+
+    /**
+     * Test #4 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
+     * constructor<br>
+     * Assertion: <code>NullPointerException</code> -
+     * if the specified <code>Set</code> is null
+     */
+    public final void testPKIXBuilderParametersSetCertSelector04() throws Exception {
+        try {
+            // pass null
+            new PKIXBuilderParameters((Set)null, null);
+            fail("NPE expected");
+        } catch (NullPointerException e) {
+        }
+    }
+
+    /**
+     * Test #5 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
+     * constructor<br>
+     * Assertion: <code>InvalidAlgorithmParameterException</code> -
+     * if the specified <code>Set</code> is empty
+     * (<code>trustAnchors.isEmpty() == true</code>)
+     */
+    public final void testPKIXBuilderParametersSetCertSelector05() {
+        try {
+            // use empty set
+            new PKIXBuilderParameters(new HashSet(), null);
+            fail("InvalidAlgorithmParameterException expected");
+        } catch (InvalidAlgorithmParameterException e) {
+        }
+    }
+
+    /**
+     * Test #6 for <code>PKIXBuilderParameters(Set, CertSelector)</code>
+     * constructor<br>
+     * Assertion: <code>ClassCastException</code> -
+     * if any of the elements in the <code>Set</code> are not of type
+     * <code>java.security.cert.TrustAnchor</code>
+     */
+    public final void testPKIXBuilderParametersSetCertSelector06() throws Exception {
+        Set taSet = TestUtils.getTrustAnchorSet();
+        if (taSet == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor set)");
+        }
+
+        // add wrong object to valid set
+        assertTrue(taSet.add(new Object()));
+
+        try {
+            new PKIXBuilderParameters(taSet, null);
+            fail("ClassCastException expected");
+        } catch (ClassCastException e) {
+        }
+    }
+
+    /**
+     * Test #4 for <code>PKIXBuilderParameters(KeyStore, CertSelector)</code>
+     * constructor<br>
+     * Assertion: <code>NullPointerException</code> -
+     * if the <code>keystore</code> is <code>null</code>
+     */
+    public final void testPKIXBuilderParametersKeyStoreCertSelector04() throws Exception {
+        try {
+            // pass null
+            new PKIXBuilderParameters((KeyStore)null, null);
+            fail("NPE expected");
+        } catch (NullPointerException e) {
+        }
+    }
+
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/PKIXCertPathBuilderResultTest.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/PKIXCertPathBuilderResultTest.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/cert/PKIXCertPathBuilderResultTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/PKIXCertPathBuilderResultTest.java Thu Sep 14 18:17:39 2006
@@ -1,239 +1,239 @@
-/*
- *  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 Vladimir N. Molotkov
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.tests.java.security.cert;
-
-import java.security.NoSuchAlgorithmException;
-import java.security.PublicKey;
-import java.security.cert.CertPath;
-import java.security.cert.CertPathBuilderResult;
-import java.security.cert.PKIXCertPathBuilderResult;
-import java.security.cert.TrustAnchor;
-import java.security.spec.InvalidKeySpecException;
-
-import org.apache.harmony.security.tests.support.cert.MyCertPath;
-import org.apache.harmony.security.tests.support.cert.TestUtils;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>PKIXCertPathBuilderResult</code>
- * 
- */
-public class PKIXCertPathBuilderResultTest extends TestCase {
-    /**
-     * Cert path encoding stub
-     */
-    private static final byte[] testEncoding = new byte[] {
-            (byte)1, (byte)2, (byte)3, (byte)4, (byte)5
-    };
-
-    /**
-     * PublicKey stub
-     */
-    private static PublicKey testPublicKey = new PublicKey() {
-        public String getAlgorithm() {
-            return "NeverMind";
-        }
-        public String getFormat() {
-            return "NeverMind";
-        }
-        public byte[] getEncoded() {
-            return new byte[] {};
-        }
-    };
-
-
-    /**
-     * Constructor for PKIXCertPathBuilderResultTest.
-     * @param name
-     */
-    public PKIXCertPathBuilderResultTest(String name) {
-        super(name);
-    }
-
-    //
-    // Tests
-    //
-
-    /**
-     * Test #1 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
-     *   PolicyNode, PublicKey)</code> constructor<br>
-     * Assertion: Creates an instance of <code>PKIXCertPathBuilderResult</code>
-     * @throws NoSuchAlgorithmException
-     * @throws InvalidKeySpecException
-     */
-    public final void testPKIXCertPathBuilderResult01()
-        throws InvalidKeySpecException,
-               NoSuchAlgorithmException {
-        TrustAnchor ta = TestUtils.getTrustAnchor();
-        if (ta == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor)");
-        }
-        CertPathBuilderResult r =
-            new PKIXCertPathBuilderResult(
-                    new MyCertPath(testEncoding),
-                    ta,
-                    TestUtils.getPolicyTree(),
-                    testPublicKey);
-        assertTrue(r instanceof PKIXCertPathBuilderResult);
-    }
-
-    /**
-     * Test #2 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
-     *   PolicyNode, PublicKey)</code> constructor<br>
-     * Assertion: plicy tree parameter may be <code>null</code>
-     * @throws NoSuchAlgorithmException
-     * @throws InvalidKeySpecException
-     */
-    public final void testPKIXCertPathBuilderResult02()
-        throws InvalidKeySpecException,
-               NoSuchAlgorithmException {
-        TrustAnchor ta = TestUtils.getTrustAnchor();
-        if (ta == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor)");
-        }
-        CertPathBuilderResult r =
-            new PKIXCertPathBuilderResult(
-                    new MyCertPath(testEncoding),
-                    ta,
-                    null,
-                    testPublicKey);
-        assertTrue(r instanceof PKIXCertPathBuilderResult);
-    }
-
-    /**
-     * Test #3 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
-     *   PolicyNode, PublicKey)</code> constructor<br>
-     * Assertion: <code>NullPointerException</code>
-     * if certPath is <code>null</code>
-     */
-    public final void testPKIXCertPathBuilderResult03() {
-        TrustAnchor ta = TestUtils.getTrustAnchor();
-        if (ta == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor)");
-        }
-
-        try {
-            // pass null
-            new PKIXCertPathBuilderResult(
-                    null,
-                    ta,
-                    TestUtils.getPolicyTree(),
-                    testPublicKey);
-            fail("NPE expected");
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * Test #4 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
-     *   PolicyNode, PublicKey)</code> constructor<br>
-     * Assertion: <code>NullPointerException</code>
-     * if trustAnchor is <code>null</code>
-     */
-    public final void testPKIXCertPathBuilderResult04() {
-        try {
-            // pass null
-            new PKIXCertPathBuilderResult(
-                    new MyCertPath(testEncoding),
-                    null,
-                    TestUtils.getPolicyTree(),
-                    testPublicKey);
-            fail("NPE expected");
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * Test #5 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
-     *   PolicyNode, PublicKey)</code> constructor<br>
-     * Assertion: <code>NullPointerException</code>
-     * if publicKey is <code>null</code>
-     */
-    public final void testPKIXCertPathBuilderResult05() {
-        TrustAnchor ta = TestUtils.getTrustAnchor();
-        if (ta == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor)");
-        }
-
-        try {
-            // pass null
-            new PKIXCertPathBuilderResult(
-                    new MyCertPath(testEncoding),
-                    ta,
-                    TestUtils.getPolicyTree(),
-                    null);
-            fail("NPE expected");
-        } catch (NullPointerException e) {
-        }
-    }
-
-    /**
-     * Test for <code>getCertPath()</code> method<br>
-     * Assertion: the built and validated <code>CertPath</code>
-     * (never <code>null</code>)
-     * @throws NoSuchAlgorithmException
-     * @throws InvalidKeySpecException
-     */
-    public final void testGetCertPath() throws Exception {
-        TrustAnchor ta = TestUtils.getTrustAnchor();
-        if (ta == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor)");
-        }
-
-        CertPath cp = new MyCertPath(testEncoding);
-        CertPathBuilderResult r =
-            new PKIXCertPathBuilderResult(
-                    cp,
-                    ta,
-                    TestUtils.getPolicyTree(),
-                    testPublicKey);
-
-        // must return the same reference
-        // as passed to the constructor
-        assertSame(cp, r.getCertPath());
-    }
-
-    /**
-     * Test for <code>toString()</code> method<br>
-     * Assertion: the printable representation of this object
-     * @throws NoSuchAlgorithmException
-     * @throws InvalidKeySpecException
-     */
-    public final void testToString()
-        throws InvalidKeySpecException,
-               NoSuchAlgorithmException {
-        TrustAnchor ta = TestUtils.getTrustAnchor();
-        if (ta == null) {
-            fail(getName() + ": not performed (could not create test TrustAnchor)");
-        }
-        CertPathBuilderResult r =
-            new PKIXCertPathBuilderResult(
-                    new MyCertPath(testEncoding),
-                    ta,
-                    TestUtils.getPolicyTree(),
-                    testPublicKey);
-
-        assertNotNull(r.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.
+ */
+
+/**
+* @author Vladimir N. Molotkov
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.cert;
+
+import java.security.NoSuchAlgorithmException;
+import java.security.PublicKey;
+import java.security.cert.CertPath;
+import java.security.cert.CertPathBuilderResult;
+import java.security.cert.PKIXCertPathBuilderResult;
+import java.security.cert.TrustAnchor;
+import java.security.spec.InvalidKeySpecException;
+
+import org.apache.harmony.security.tests.support.cert.MyCertPath;
+import org.apache.harmony.security.tests.support.cert.TestUtils;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>PKIXCertPathBuilderResult</code>
+ * 
+ */
+public class PKIXCertPathBuilderResultTest extends TestCase {
+    /**
+     * Cert path encoding stub
+     */
+    private static final byte[] testEncoding = new byte[] {
+            (byte)1, (byte)2, (byte)3, (byte)4, (byte)5
+    };
+
+    /**
+     * PublicKey stub
+     */
+    private static PublicKey testPublicKey = new PublicKey() {
+        public String getAlgorithm() {
+            return "NeverMind";
+        }
+        public String getFormat() {
+            return "NeverMind";
+        }
+        public byte[] getEncoded() {
+            return new byte[] {};
+        }
+    };
+
+
+    /**
+     * Constructor for PKIXCertPathBuilderResultTest.
+     * @param name
+     */
+    public PKIXCertPathBuilderResultTest(String name) {
+        super(name);
+    }
+
+    //
+    // Tests
+    //
+
+    /**
+     * Test #1 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
+     *   PolicyNode, PublicKey)</code> constructor<br>
+     * Assertion: Creates an instance of <code>PKIXCertPathBuilderResult</code>
+     * @throws NoSuchAlgorithmException
+     * @throws InvalidKeySpecException
+     */
+    public final void testPKIXCertPathBuilderResult01()
+        throws InvalidKeySpecException,
+               NoSuchAlgorithmException {
+        TrustAnchor ta = TestUtils.getTrustAnchor();
+        if (ta == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor)");
+        }
+        CertPathBuilderResult r =
+            new PKIXCertPathBuilderResult(
+                    new MyCertPath(testEncoding),
+                    ta,
+                    TestUtils.getPolicyTree(),
+                    testPublicKey);
+        assertTrue(r instanceof PKIXCertPathBuilderResult);
+    }
+
+    /**
+     * Test #2 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
+     *   PolicyNode, PublicKey)</code> constructor<br>
+     * Assertion: plicy tree parameter may be <code>null</code>
+     * @throws NoSuchAlgorithmException
+     * @throws InvalidKeySpecException
+     */
+    public final void testPKIXCertPathBuilderResult02()
+        throws InvalidKeySpecException,
+               NoSuchAlgorithmException {
+        TrustAnchor ta = TestUtils.getTrustAnchor();
+        if (ta == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor)");
+        }
+        CertPathBuilderResult r =
+            new PKIXCertPathBuilderResult(
+                    new MyCertPath(testEncoding),
+                    ta,
+                    null,
+                    testPublicKey);
+        assertTrue(r instanceof PKIXCertPathBuilderResult);
+    }
+
+    /**
+     * Test #3 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
+     *   PolicyNode, PublicKey)</code> constructor<br>
+     * Assertion: <code>NullPointerException</code>
+     * if certPath is <code>null</code>
+     */
+    public final void testPKIXCertPathBuilderResult03() {
+        TrustAnchor ta = TestUtils.getTrustAnchor();
+        if (ta == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor)");
+        }
+
+        try {
+            // pass null
+            new PKIXCertPathBuilderResult(
+                    null,
+                    ta,
+                    TestUtils.getPolicyTree(),
+                    testPublicKey);
+            fail("NPE expected");
+        } catch (NullPointerException e) {
+        }
+    }
+
+    /**
+     * Test #4 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
+     *   PolicyNode, PublicKey)</code> constructor<br>
+     * Assertion: <code>NullPointerException</code>
+     * if trustAnchor is <code>null</code>
+     */
+    public final void testPKIXCertPathBuilderResult04() {
+        try {
+            // pass null
+            new PKIXCertPathBuilderResult(
+                    new MyCertPath(testEncoding),
+                    null,
+                    TestUtils.getPolicyTree(),
+                    testPublicKey);
+            fail("NPE expected");
+        } catch (NullPointerException e) {
+        }
+    }
+
+    /**
+     * Test #5 for <code>PKIXCertPathBuilderResult(CertPath, TrustAnchor,
+     *   PolicyNode, PublicKey)</code> constructor<br>
+     * Assertion: <code>NullPointerException</code>
+     * if publicKey is <code>null</code>
+     */
+    public final void testPKIXCertPathBuilderResult05() {
+        TrustAnchor ta = TestUtils.getTrustAnchor();
+        if (ta == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor)");
+        }
+
+        try {
+            // pass null
+            new PKIXCertPathBuilderResult(
+                    new MyCertPath(testEncoding),
+                    ta,
+                    TestUtils.getPolicyTree(),
+                    null);
+            fail("NPE expected");
+        } catch (NullPointerException e) {
+        }
+    }
+
+    /**
+     * Test for <code>getCertPath()</code> method<br>
+     * Assertion: the built and validated <code>CertPath</code>
+     * (never <code>null</code>)
+     * @throws NoSuchAlgorithmException
+     * @throws InvalidKeySpecException
+     */
+    public final void testGetCertPath() throws Exception {
+        TrustAnchor ta = TestUtils.getTrustAnchor();
+        if (ta == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor)");
+        }
+
+        CertPath cp = new MyCertPath(testEncoding);
+        CertPathBuilderResult r =
+            new PKIXCertPathBuilderResult(
+                    cp,
+                    ta,
+                    TestUtils.getPolicyTree(),
+                    testPublicKey);
+
+        // must return the same reference
+        // as passed to the constructor
+        assertSame(cp, r.getCertPath());
+    }
+
+    /**
+     * Test for <code>toString()</code> method<br>
+     * Assertion: the printable representation of this object
+     * @throws NoSuchAlgorithmException
+     * @throws InvalidKeySpecException
+     */
+    public final void testToString()
+        throws InvalidKeySpecException,
+               NoSuchAlgorithmException {
+        TrustAnchor ta = TestUtils.getTrustAnchor();
+        if (ta == null) {
+            fail(getName() + ": not performed (could not create test TrustAnchor)");
+        }
+        CertPathBuilderResult r =
+            new PKIXCertPathBuilderResult(
+                    new MyCertPath(testEncoding),
+                    ta,
+                    TestUtils.getPolicyTree(),
+                    testPublicKey);
+
+        assertNotNull(r.toString());
+    }
+
+}

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



Mime
View raw message