harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r443539 [29/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/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertPathBuilderSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertPathBuilderSpi.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertPathBuilderSpi.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertPathBuilderSpi.java
Thu Sep 14 18:17:39 2006
@@ -1,46 +1,46 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.tests.support.cert;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.cert.CertPathBuilderException;
-import java.security.cert.CertPathBuilderResult;
-import java.security.cert.CertPathBuilderSpi;
-import java.security.cert.CertPathParameters;
-
-/**
- * Additional class for verification CertPathBuilderSpi 
- * and CertPathBuilder 
- 
- */
-
-public class MyCertPathBuilderSpi extends CertPathBuilderSpi {
-    private int swi = 0;
-    public CertPathBuilderResult engineBuild(CertPathParameters params)
-            throws CertPathBuilderException, InvalidAlgorithmParameterException {
-        swi++;
-        if ((params == null) && ((swi %2 ) != 0)) {
-            throw new CertPathBuilderException("Null parameter");
-        }
-        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.support.cert;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.cert.CertPathBuilderException;
+import java.security.cert.CertPathBuilderResult;
+import java.security.cert.CertPathBuilderSpi;
+import java.security.cert.CertPathParameters;
+
+/**
+ * Additional class for verification CertPathBuilderSpi 
+ * and CertPathBuilder 
+ 
+ */
+
+public class MyCertPathBuilderSpi extends CertPathBuilderSpi {
+    private int swi = 0;
+    public CertPathBuilderResult engineBuild(CertPathParameters params)
+            throws CertPathBuilderException, InvalidAlgorithmParameterException {
+        swi++;
+        if ((params == null) && ((swi %2 ) != 0)) {
+            throw new CertPathBuilderException("Null parameter");
+        }
+        return null;
+    }
 }

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertPathValidatorSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertPathValidatorSpi.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertPathValidatorSpi.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertPathValidatorSpi.java
Thu Sep 14 18:17:39 2006
@@ -1,55 +1,55 @@
-/*
- *  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.support.cert;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.cert.CertPath;
-import java.security.cert.CertPathParameters;
-import java.security.cert.CertPathValidatorException;
-import java.security.cert.CertPathValidatorResult;
-import java.security.cert.CertPathValidatorSpi;
-
-/**
- * Additional class for verification of CertPathValidatorSpi
- * and CertPathValidator
- * 
- */
-
-public class MyCertPathValidatorSpi extends CertPathValidatorSpi {
-    private int sw = 0;
-    public CertPathValidatorResult engineValidate(CertPath certPath,
-            CertPathParameters params) throws CertPathValidatorException,
-            InvalidAlgorithmParameterException {
-        ++sw; 
-        if (certPath == null) {
-            if ((sw % 2) == 0) {
-                throw new CertPathValidatorException("certPath null");
-            }
-        }
-        if (params == null) {
-            if ((sw % 3) == 0) {
-                throw new InvalidAlgorithmParameterException("params 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.support.cert;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.cert.CertPath;
+import java.security.cert.CertPathParameters;
+import java.security.cert.CertPathValidatorException;
+import java.security.cert.CertPathValidatorResult;
+import java.security.cert.CertPathValidatorSpi;
+
+/**
+ * Additional class for verification of CertPathValidatorSpi
+ * and CertPathValidator
+ * 
+ */
+
+public class MyCertPathValidatorSpi extends CertPathValidatorSpi {
+    private int sw = 0;
+    public CertPathValidatorResult engineValidate(CertPath certPath,
+            CertPathParameters params) throws CertPathValidatorException,
+            InvalidAlgorithmParameterException {
+        ++sw; 
+        if (certPath == null) {
+            if ((sw % 2) == 0) {
+                throw new CertPathValidatorException("certPath null");
+            }
+        }
+        if (params == null) {
+            if ((sw % 3) == 0) {
+                throw new InvalidAlgorithmParameterException("params null");
+            }
+        }
+        return null;
+    }
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertStoreParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertStoreParameters.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertStoreParameters.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertStoreParameters.java
Thu Sep 14 18:17:39 2006
@@ -1,42 +1,42 @@
-/*
- *  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.support.cert;
-
-import java.security.cert.CertStoreParameters;
-
-/**
- * Class for verification of CertStore and CertStoreSpi
- * 
- */
-
-public class MyCertStoreParameters implements CertStoreParameters {
-    public MyCertStoreParameters() {
-        super();
-    }
-    public Object clone() {
-        try {
-            return super.clone();
-        } catch (CloneNotSupportedException e) {
-            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.support.cert;
+
+import java.security.cert.CertStoreParameters;
+
+/**
+ * Class for verification of CertStore and CertStoreSpi
+ * 
+ */
+
+public class MyCertStoreParameters implements CertStoreParameters {
+    public MyCertStoreParameters() {
+        super();
+    }
+    public Object clone() {
+        try {
+            return super.clone();
+        } catch (CloneNotSupportedException e) {
+            return null;
+        }
+    }
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertStoreSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertStoreSpi.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertStoreSpi.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertStoreSpi.java
Thu Sep 14 18:17:39 2006
@@ -1,63 +1,63 @@
-/*
- *  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.support.cert;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.cert.CRLSelector;
-import java.security.cert.CertSelector;
-import java.security.cert.CertStoreException;
-import java.security.cert.CertStoreParameters;
-import java.security.cert.CertStoreSpi;
-import java.util.Collection;
-
-/**
- * Additional class for verification CertStoreSpi
- * and CertStore
- * 
- */
-
-public class MyCertStoreSpi extends CertStoreSpi {
-    
-    public MyCertStoreSpi(CertStoreParameters params)
-            throws InvalidAlgorithmParameterException {
-        super(params);        
-        if (!(params instanceof MyCertStoreParameters)) {
-            throw new InvalidAlgorithmParameterException("Invalid params");
-        }
-    }
-
-    public Collection engineGetCertificates(CertSelector selector)
-            throws CertStoreException {
-        if (selector == null) {
-            throw new CertStoreException("Parameter is null");
-        }
-        return null;
-    }
-
-    public Collection engineGetCRLs(CRLSelector selector)
-            throws CertStoreException {
-        if (selector == null) {
-            throw new CertStoreException("Parameter is 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.support.cert;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.cert.CRLSelector;
+import java.security.cert.CertSelector;
+import java.security.cert.CertStoreException;
+import java.security.cert.CertStoreParameters;
+import java.security.cert.CertStoreSpi;
+import java.util.Collection;
+
+/**
+ * Additional class for verification CertStoreSpi
+ * and CertStore
+ * 
+ */
+
+public class MyCertStoreSpi extends CertStoreSpi {
+    
+    public MyCertStoreSpi(CertStoreParameters params)
+            throws InvalidAlgorithmParameterException {
+        super(params);        
+        if (!(params instanceof MyCertStoreParameters)) {
+            throw new InvalidAlgorithmParameterException("Invalid params");
+        }
+    }
+
+    public Collection engineGetCertificates(CertSelector selector)
+            throws CertStoreException {
+        if (selector == null) {
+            throw new CertStoreException("Parameter is null");
+        }
+        return null;
+    }
+
+    public Collection engineGetCRLs(CRLSelector selector)
+            throws CertStoreException {
+        if (selector == null) {
+            throw new CertStoreException("Parameter is null");
+        }
+        return null;
+    }
+}

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

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertificateFactorySpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertificateFactorySpi.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertificateFactorySpi.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/MyCertificateFactorySpi.java
Thu Sep 14 18:17:39 2006
@@ -1,137 +1,137 @@
-/*
- *  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.support.cert;
-
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.security.cert.CRL;
-import java.security.cert.CRLException;
-import java.security.cert.CertPath;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactorySpi;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Additional class for verification CertificateFactorySpi and
- * CertificateFactory classes
- * 
- */
-
-public class MyCertificateFactorySpi extends CertificateFactorySpi {
-    // Variants of execution:
-    // mode: false - list of encodings is empty
-    // mode: true - list of encodings consists of 2 elements
-    //               some exceptions are thrown when
-    private static boolean mode;
-
-    private Set list;
-
-    public MyCertificateFactorySpi() {
-        super();
-        mode = true;
-        list = new HashSet();
-        list.add("aa");
-        list.add("bb");
-    }
-
-    public static void putMode(boolean newMode) {
-        mode = newMode;
-    }
-
-    public Certificate engineGenerateCertificate(InputStream inStream)
-            throws CertificateException {
-        if (!(inStream instanceof DataInputStream)) {
-            throw new CertificateException("Incorrect inputstream");
-        }
-        return null;
-    }
-
-    public Collection engineGenerateCertificates(InputStream inStream)
-            throws CertificateException {
-        if (!(inStream instanceof DataInputStream)) {
-            throw new CertificateException("Incorrect inputstream");
-        }
-        return null;
-    }
-
-    public CRL engineGenerateCRL(InputStream inStream) throws CRLException {
-        if (!(inStream instanceof DataInputStream)) {
-            throw new CRLException("Incorrect inputstream");
-        }
-        return null;
-    }
-
-    public Collection engineGenerateCRLs(InputStream inStream)
-            throws CRLException {
-        if (!(inStream instanceof DataInputStream)) {
-            throw new CRLException("Incorrect inputstream");
-        }
-        return null;
-    }
-
-    public CertPath engineGenerateCertPath(InputStream inStream)
-            throws CertificateException {
-        if (!(inStream instanceof DataInputStream)) {
-            throw new CertificateException("Incorrect inputstream");
-        }
-        Iterator it = engineGetCertPathEncodings();
-        if (!it.hasNext()) {
-            throw new CertificateException("There are no CertPath encodings");
-        }
-        return engineGenerateCertPath(inStream, (String) it.next());
-    }
-
-    public CertPath engineGenerateCertPath(InputStream inStream, String encoding)
-            throws CertificateException {
-        if (!(inStream instanceof DataInputStream)) {
-            throw new CertificateException("Incorrect inputstream");
-        }
-        if (encoding.length() == 0) {
-            if (mode) {
-                throw new IllegalArgumentException("Encoding is empty");
-            }
-        }
-        return null;
-    }
-
-    public CertPath engineGenerateCertPath(List certificates)
-            throws CertificateException {
-        if (certificates == null) {
-            if (mode) {
-                throw new NullPointerException("certificates is null");
-            }
-        }
-        return null;
-    }
-
-    public Iterator engineGetCertPathEncodings() {
-        if (!mode) {
-            list.clear();
-        }
-        return list.iterator();
-    }
+/*
+ *  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.support.cert;
+
+import java.io.DataInputStream;
+import java.io.InputStream;
+import java.security.cert.CRL;
+import java.security.cert.CRLException;
+import java.security.cert.CertPath;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactorySpi;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Additional class for verification CertificateFactorySpi and
+ * CertificateFactory classes
+ * 
+ */
+
+public class MyCertificateFactorySpi extends CertificateFactorySpi {
+    // Variants of execution:
+    // mode: false - list of encodings is empty
+    // mode: true - list of encodings consists of 2 elements
+    //               some exceptions are thrown when
+    private static boolean mode;
+
+    private Set list;
+
+    public MyCertificateFactorySpi() {
+        super();
+        mode = true;
+        list = new HashSet();
+        list.add("aa");
+        list.add("bb");
+    }
+
+    public static void putMode(boolean newMode) {
+        mode = newMode;
+    }
+
+    public Certificate engineGenerateCertificate(InputStream inStream)
+            throws CertificateException {
+        if (!(inStream instanceof DataInputStream)) {
+            throw new CertificateException("Incorrect inputstream");
+        }
+        return null;
+    }
+
+    public Collection engineGenerateCertificates(InputStream inStream)
+            throws CertificateException {
+        if (!(inStream instanceof DataInputStream)) {
+            throw new CertificateException("Incorrect inputstream");
+        }
+        return null;
+    }
+
+    public CRL engineGenerateCRL(InputStream inStream) throws CRLException {
+        if (!(inStream instanceof DataInputStream)) {
+            throw new CRLException("Incorrect inputstream");
+        }
+        return null;
+    }
+
+    public Collection engineGenerateCRLs(InputStream inStream)
+            throws CRLException {
+        if (!(inStream instanceof DataInputStream)) {
+            throw new CRLException("Incorrect inputstream");
+        }
+        return null;
+    }
+
+    public CertPath engineGenerateCertPath(InputStream inStream)
+            throws CertificateException {
+        if (!(inStream instanceof DataInputStream)) {
+            throw new CertificateException("Incorrect inputstream");
+        }
+        Iterator it = engineGetCertPathEncodings();
+        if (!it.hasNext()) {
+            throw new CertificateException("There are no CertPath encodings");
+        }
+        return engineGenerateCertPath(inStream, (String) it.next());
+    }
+
+    public CertPath engineGenerateCertPath(InputStream inStream, String encoding)
+            throws CertificateException {
+        if (!(inStream instanceof DataInputStream)) {
+            throw new CertificateException("Incorrect inputstream");
+        }
+        if (encoding.length() == 0) {
+            if (mode) {
+                throw new IllegalArgumentException("Encoding is empty");
+            }
+        }
+        return null;
+    }
+
+    public CertPath engineGenerateCertPath(List certificates)
+            throws CertificateException {
+        if (certificates == null) {
+            if (mode) {
+                throw new NullPointerException("certificates is null");
+            }
+        }
+        return null;
+    }
+
+    public Iterator engineGetCertPathEncodings() {
+        if (!mode) {
+            list.clear();
+        }
+        return list.iterator();
+    }
 }

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

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

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/spec/MyEncodedKeySpec.java
------------------------------------------------------------------------------
    svn:eol-style = native

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



Mime
View raw message