You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ml...@apache.org on 2006/06/20 10:11:19 UTC
svn commit: r415555 [6/17] - in
/incubator/harmony/enhanced/classlib/trunk/modules/security: make/common/
src/test/api/java.injected/java/security/acl/
src/test/api/java.injected/java/security/cert/
src/test/api/java.injected/java/security/interfaces/ ...
Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertStoreExceptionTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertStoreExceptionTest.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/CertStoreExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertStoreExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertStoreExceptionTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertStoreExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertStoreExceptionTest.java Tue Jun 20 01:11:04 2006
@@ -1,239 +1,238 @@
-/*
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.cert.CertStoreException;
-
-import junit.framework.TestCase;
-
-
-/**
- * Tests for <code>CertStoreException</code> class constructors and methods.
- *
- */
-public class CertStoreExceptionTest extends TestCase {
-
- public static void main(String[] args) {
- }
-
- /**
- * Constructor for CertStoreExceptionTests.
- *
- * @param arg0
- */
- public CertStoreExceptionTest(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 "CertStoreException: ".concat(tE.toString()).concat(
- " is not equal to caught exception: ").concat(eE.toString());
- }
-
- /**
- * Test for <code>CertStoreException()</code> constructor Assertion:
- * constructs CertStoreException with no detail message
- */
- public void testCertStoreException01() {
- CertStoreException tE = new CertStoreException();
- 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>CertStoreException(String)</code> constructor Assertion:
- * constructs CertStoreException with detail message msg. Parameter
- * <code>msg</code> is not null.
- */
- public void testCertStoreException02() {
- CertStoreException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertStoreException(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>CertStoreException(String)</code> constructor Assertion:
- * constructs CertStoreException when <code>msg</code> is null
- */
- public void testCertStoreException03() {
- String msg = null;
- CertStoreException tE = new CertStoreException(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>CertStoreException(Throwable)</code> constructor
- * Assertion: constructs CertStoreException when <code>cause</code> is
- * null
- */
- public void testCertStoreException04() {
- Throwable cause = null;
- CertStoreException tE = new CertStoreException(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>CertStoreException(Throwable)</code> constructor
- * Assertion: constructs CertStoreException when <code>cause</code> is not
- * null
- */
- public void testCertStoreException05() {
- CertStoreException tE = new CertStoreException(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>CertStoreException(String, Throwable)</code> constructor
- * Assertion: constructs CertStoreException when <code>cause</code> is
- * null <code>msg</code> is null
- */
- public void testCertStoreException06() {
- CertStoreException tE = new CertStoreException(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>CertStoreException(String, Throwable)</code> constructor
- * Assertion: constructs CertStoreException when <code>cause</code> is
- * null <code>msg</code> is not null
- */
- public void testCertStoreException07() {
- CertStoreException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertStoreException(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>CertStoreException(String, Throwable)</code> constructor
- * Assertion: constructs CertStoreException when <code>cause</code> is not
- * null <code>msg</code> is null
- */
- public void testCertStoreException08() {
- CertStoreException tE = new CertStoreException(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>CertStoreException(String, Throwable)</code> constructor
- * Assertion: constructs CertStoreException when <code>cause</code> is not
- * null <code>msg</code> is not null
- */
- public void testCertStoreException09() {
- CertStoreException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertStoreException(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.CertStoreException;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>CertStoreException</code> class constructors and methods.
+ *
+ */
+public class CertStoreExceptionTest extends TestCase {
+
+ public static void main(String[] args) {
+ }
+
+ /**
+ * Constructor for CertStoreExceptionTests.
+ *
+ * @param arg0
+ */
+ public CertStoreExceptionTest(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 "CertStoreException: ".concat(tE.toString()).concat(
+ " is not equal to caught exception: ").concat(eE.toString());
+ }
+
+ /**
+ * Test for <code>CertStoreException()</code> constructor Assertion:
+ * constructs CertStoreException with no detail message
+ */
+ public void testCertStoreException01() {
+ CertStoreException tE = new CertStoreException();
+ 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>CertStoreException(String)</code> constructor Assertion:
+ * constructs CertStoreException with detail message msg. Parameter
+ * <code>msg</code> is not null.
+ */
+ public void testCertStoreException02() {
+ CertStoreException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertStoreException(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>CertStoreException(String)</code> constructor Assertion:
+ * constructs CertStoreException when <code>msg</code> is null
+ */
+ public void testCertStoreException03() {
+ String msg = null;
+ CertStoreException tE = new CertStoreException(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>CertStoreException(Throwable)</code> constructor
+ * Assertion: constructs CertStoreException when <code>cause</code> is
+ * null
+ */
+ public void testCertStoreException04() {
+ Throwable cause = null;
+ CertStoreException tE = new CertStoreException(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>CertStoreException(Throwable)</code> constructor
+ * Assertion: constructs CertStoreException when <code>cause</code> is not
+ * null
+ */
+ public void testCertStoreException05() {
+ CertStoreException tE = new CertStoreException(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>CertStoreException(String, Throwable)</code> constructor
+ * Assertion: constructs CertStoreException when <code>cause</code> is
+ * null <code>msg</code> is null
+ */
+ public void testCertStoreException06() {
+ CertStoreException tE = new CertStoreException(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>CertStoreException(String, Throwable)</code> constructor
+ * Assertion: constructs CertStoreException when <code>cause</code> is
+ * null <code>msg</code> is not null
+ */
+ public void testCertStoreException07() {
+ CertStoreException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertStoreException(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>CertStoreException(String, Throwable)</code> constructor
+ * Assertion: constructs CertStoreException when <code>cause</code> is not
+ * null <code>msg</code> is null
+ */
+ public void testCertStoreException08() {
+ CertStoreException tE = new CertStoreException(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>CertStoreException(String, Throwable)</code> constructor
+ * Assertion: constructs CertStoreException when <code>cause</code> is not
+ * null <code>msg</code> is not null
+ */
+ public void testCertStoreException09() {
+ CertStoreException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertStoreException(msgs[i], tCause);
+ String getM = tE.getMessage();
+ String toS = tCause.toString();
+ if (msgs[i].length() > 0) {
+ assertTrue("getMessage() must contain ".concat(msgs[i]), getM
+ .indexOf(msgs[i]) != -1);
+ if (!getM.equals(msgs[i])) {
+ assertTrue("getMessage() should contain ".concat(toS), getM
+ .indexOf(toS) != -1);
+ }
+ }
+ assertNotNull("getCause() must not return null", tE.getCause());
+ assertEquals("getCause() must return ".concat(tCause.toString()),
+ tE.getCause(), tCause);
+
+ try {
+ throw tE;
+ } catch (Exception e) {
+ assertTrue(createErr(tE, e), tE.equals(e));
+ }
+ }
+ }
+}
Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertStoreSpiTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertStoreSpiTest.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/CertStoreSpiTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertStoreSpiTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertStoreSpiTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertStoreSpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertStoreSpiTest.java Tue Jun 20 01:11:04 2006
@@ -1,98 +1,106 @@
-/*
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-
-import java.security.InvalidAlgorithmParameterException;
-
-import junit.framework.TestCase;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Tests for <code>CertStoreSpi</code> class constructors and methods.
- *
- */
-
-public class CertStoreSpiTest extends TestCase {
-
- /**
- * Constructor for CertStoreSpiTest.
- *
- * @param arg0
- */
- public CertStoreSpiTest(String arg0) {
- super(arg0);
- }
-
- /**
- * Test for <code>CertStoreSpi</code> constructor Assertion: constructs
- * CertStoreSpi
- */
- public void testCertStoreSpi01() throws InvalidAlgorithmParameterException,
- CertStoreException {
- CertStoreSpi certStoreSpi = null;
- CertSelector certSelector = new tmpCertSelector();//new
- // X509CertSelector();
- CRLSelector crlSelector = new tmpCRLSelector();//new X509CRLSelector();
- try {
- certStoreSpi = new MyCertStoreSpi(null);
- fail("InvalidAlgorithmParameterException must be thrown");
- } catch (InvalidAlgorithmParameterException e) {
- }
- certStoreSpi = new MyCertStoreSpi(new MyCertStoreParameters());
- assertNull("Not null collection", certStoreSpi
- .engineGetCertificates(certSelector));
- assertNull("Not null collection", certStoreSpi
- .engineGetCRLs(crlSelector));
- }
-
- public static Test suite() {
- return new TestSuite(CertStoreSpiTest.class);
- }
-
- public static void main(String args[]) {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Additional classes for verification CertStoreSpi class
- */
- public static class tmpCRLSelector implements CRLSelector {
- public Object clone() {
- return null;
- }
- public boolean match (CRL crl) {
- return false;
- }
- }
- public static class tmpCertSelector implements CertSelector {
- public Object clone() {
- return null;
- }
- public boolean match (Certificate crl) {
- return true;
- }
- }
-
-}
+/*
+ * 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.InvalidAlgorithmParameterException;
+import java.security.cert.CRL;
+import java.security.cert.CRLSelector;
+import java.security.cert.CertSelector;
+import java.security.cert.CertStoreException;
+import java.security.cert.CertStoreSpi;
+import java.security.cert.Certificate;
+
+import org.apache.harmony.security.tests.support.cert.MyCertStoreSpi;
+import org.apache.harmony.security.tests.support.cert.MyCertStoreParameters;
+
+import junit.framework.TestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Tests for <code>CertStoreSpi</code> class constructors and methods.
+ *
+ */
+
+public class CertStoreSpiTest extends TestCase {
+
+ /**
+ * Constructor for CertStoreSpiTest.
+ *
+ * @param arg0
+ */
+ public CertStoreSpiTest(String arg0) {
+ super(arg0);
+ }
+
+ /**
+ * Test for <code>CertStoreSpi</code> constructor Assertion: constructs
+ * CertStoreSpi
+ */
+ public void testCertStoreSpi01() throws InvalidAlgorithmParameterException,
+ CertStoreException {
+ CertStoreSpi certStoreSpi = null;
+ CertSelector certSelector = new tmpCertSelector();//new
+ // X509CertSelector();
+ CRLSelector crlSelector = new tmpCRLSelector();//new X509CRLSelector();
+ try {
+ certStoreSpi = new MyCertStoreSpi(null);
+ fail("InvalidAlgorithmParameterException must be thrown");
+ } catch (InvalidAlgorithmParameterException e) {
+ }
+ certStoreSpi = new MyCertStoreSpi(new MyCertStoreParameters());
+ assertNull("Not null collection", certStoreSpi
+ .engineGetCertificates(certSelector));
+ assertNull("Not null collection", certStoreSpi
+ .engineGetCRLs(crlSelector));
+ }
+
+ public static Test suite() {
+ return new TestSuite(CertStoreSpiTest.class);
+ }
+
+ public static void main(String args[]) {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Additional classes for verification CertStoreSpi class
+ */
+ public static class tmpCRLSelector implements CRLSelector {
+ public Object clone() {
+ return null;
+ }
+ public boolean match (CRL crl) {
+ return false;
+ }
+ }
+ public static class tmpCertSelector implements CertSelector {
+ public Object clone() {
+ return null;
+ }
+ public boolean match (Certificate crl) {
+ return true;
+ }
+ }
+
+}
Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateEncodingException2Test.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateEncodingExceptionTest.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/CertificateEncodingException2Test.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateEncodingException2Test.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateEncodingExceptionTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateEncodingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateEncodingException2Test.java Tue Jun 20 01:11:04 2006
@@ -13,11 +13,13 @@
* limitations under the License.
*/
-package tests.api.java.security.cert;
+package org.apache.harmony.security.tests.java.security.cert;
import java.security.cert.CertificateEncodingException;
-public class CertificateEncodingExceptionTest extends junit.framework.TestCase {
+import junit.framework.TestCase;
+
+public class CertificateEncodingException2Test extends junit.framework.TestCase {
/**
* @tests java.security.cert.CertificateEncodingException#CertificateEncodingException()
Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateEncodingExceptionTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateEncodingExceptionTest.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/CertificateEncodingExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateEncodingExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateEncodingExceptionTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateEncodingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateEncodingExceptionTest.java Tue Jun 20 01:11:04 2006
@@ -1,245 +1,245 @@
-/*
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.cert.CertificateEncodingException;
-
-import junit.framework.TestCase;
-
-
-/**
- * Tests for <code>CertificateEncodingException</code> class constructors and
- * methods.
- *
- */
-public class CertificateEncodingExceptionTest extends TestCase {
-
- public static void main(String[] args) {
- }
-
- /**
- * Constructor for CertificateEncodingExceptionTests.
- *
- * @param arg0
- */
- public CertificateEncodingExceptionTest(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 "CertificateEncodingException: ".concat(tE.toString()).concat(
- " is not equal to caught exception: ").concat(eE.toString());
- }
-
- /**
- * Test for <code>CertificateEncodingException()</code> constructor
- * Assertion: constructs CertificateEncodingException with no detail message
- */
- public void testCertificateEncodingException01() {
- CertificateEncodingException tE = new CertificateEncodingException();
- 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>CertificateEncodingException(String)</code> constructor
- * Assertion: constructs CertificateEncodingException with detail message
- * msg. Parameter <code>msg</code> is not null.
- */
- public void testCertificateEncodingException02() {
- CertificateEncodingException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertificateEncodingException(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>CertificateEncodingException(String)</code> constructor
- * Assertion: constructs CertificateEncodingException when <code>msg</code>
- * is null
- */
- public void testCertificateEncodingException03() {
- String msg = null;
- CertificateEncodingException tE = new CertificateEncodingException(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>CertificateEncodingException(Throwable)</code>
- * constructor Assertion: constructs CertificateEncodingException when
- * <code>cause</code> is null
- */
- public void testCertificateEncodingException04() {
- Throwable cause = null;
- CertificateEncodingException tE = new CertificateEncodingException(
- 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>CertificateEncodingException(Throwable)</code>
- * constructor Assertion: constructs CertificateEncodingException when
- * <code>cause</code> is not null
- */
- public void testCertificateEncodingException05() {
- CertificateEncodingException tE = new CertificateEncodingException(
- 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>CertificateEncodingException(String, Throwable)</code>
- * constructor Assertion: constructs CertificateEncodingException when
- * <code>cause</code> is null <code>msg</code> is null
- */
- public void testCertificateEncodingException06() {
- CertificateEncodingException tE = new CertificateEncodingException(
- 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>CertificateEncodingException(String, Throwable)</code>
- * constructor Assertion: constructs CertificateEncodingException when
- * <code>cause</code> is null <code>msg</code> is not null
- */
- public void testCertificateEncodingException07() {
- CertificateEncodingException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertificateEncodingException(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>CertificateEncodingException(String, Throwable)</code>
- * constructor Assertion: constructs CertificateEncodingException when
- * <code>cause</code> is not null <code>msg</code> is null
- */
- public void testCertificateEncodingException08() {
- CertificateEncodingException tE = new CertificateEncodingException(
- 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>CertificateEncodingException(String, Throwable)</code>
- * constructor Assertion: constructs CertificateEncodingException when
- * <code>cause</code> is not null <code>msg</code> is not null
- */
- public void testCertificateEncodingException09() {
- CertificateEncodingException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertificateEncodingException(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.CertificateEncodingException;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Tests for <code>CertificateEncodingException</code> class constructors and
+ * methods.
+ *
+ */
+public class CertificateEncodingExceptionTest extends TestCase {
+
+ public static void main(String[] args) {
+ }
+
+ /**
+ * Constructor for CertificateEncodingExceptionTests.
+ *
+ * @param arg0
+ */
+ public CertificateEncodingExceptionTest(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 "CertificateEncodingException: ".concat(tE.toString()).concat(
+ " is not equal to caught exception: ").concat(eE.toString());
+ }
+
+ /**
+ * Test for <code>CertificateEncodingException()</code> constructor
+ * Assertion: constructs CertificateEncodingException with no detail message
+ */
+ public void testCertificateEncodingException01() {
+ CertificateEncodingException tE = new CertificateEncodingException();
+ 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>CertificateEncodingException(String)</code> constructor
+ * Assertion: constructs CertificateEncodingException with detail message
+ * msg. Parameter <code>msg</code> is not null.
+ */
+ public void testCertificateEncodingException02() {
+ CertificateEncodingException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertificateEncodingException(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>CertificateEncodingException(String)</code> constructor
+ * Assertion: constructs CertificateEncodingException when <code>msg</code>
+ * is null
+ */
+ public void testCertificateEncodingException03() {
+ String msg = null;
+ CertificateEncodingException tE = new CertificateEncodingException(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>CertificateEncodingException(Throwable)</code>
+ * constructor Assertion: constructs CertificateEncodingException when
+ * <code>cause</code> is null
+ */
+ public void testCertificateEncodingException04() {
+ Throwable cause = null;
+ CertificateEncodingException tE = new CertificateEncodingException(
+ 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>CertificateEncodingException(Throwable)</code>
+ * constructor Assertion: constructs CertificateEncodingException when
+ * <code>cause</code> is not null
+ */
+ public void testCertificateEncodingException05() {
+ CertificateEncodingException tE = new CertificateEncodingException(
+ 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>CertificateEncodingException(String, Throwable)</code>
+ * constructor Assertion: constructs CertificateEncodingException when
+ * <code>cause</code> is null <code>msg</code> is null
+ */
+ public void testCertificateEncodingException06() {
+ CertificateEncodingException tE = new CertificateEncodingException(
+ 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>CertificateEncodingException(String, Throwable)</code>
+ * constructor Assertion: constructs CertificateEncodingException when
+ * <code>cause</code> is null <code>msg</code> is not null
+ */
+ public void testCertificateEncodingException07() {
+ CertificateEncodingException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertificateEncodingException(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>CertificateEncodingException(String, Throwable)</code>
+ * constructor Assertion: constructs CertificateEncodingException when
+ * <code>cause</code> is not null <code>msg</code> is null
+ */
+ public void testCertificateEncodingException08() {
+ CertificateEncodingException tE = new CertificateEncodingException(
+ 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>CertificateEncodingException(String, Throwable)</code>
+ * constructor Assertion: constructs CertificateEncodingException when
+ * <code>cause</code> is not null <code>msg</code> is not null
+ */
+ public void testCertificateEncodingException09() {
+ CertificateEncodingException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertificateEncodingException(msgs[i], tCause);
+ String getM = tE.getMessage();
+ String toS = tCause.toString();
+ if (msgs[i].length() > 0) {
+ assertTrue("getMessage() must contain ".concat(msgs[i]), getM
+ .indexOf(msgs[i]) != -1);
+ if (!getM.equals(msgs[i])) {
+ assertTrue("getMessage() should contain ".concat(toS), getM
+ .indexOf(toS) != -1);
+ }
+ }
+ assertNotNull("getCause() must not return null", tE.getCause());
+ assertEquals("getCause() must return ".concat(tCause.toString()),
+ tE.getCause(), tCause);
+
+ try {
+ throw tE;
+ } catch (Exception e) {
+ assertTrue(createErr(tE, e), tE.equals(e));
+ }
+ }
+ }
+}
Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateException2Test.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateExceptionTest.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/CertificateException2Test.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateException2Test.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateExceptionTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/cert/CertificateExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateException2Test.java Tue Jun 20 01:11:04 2006
@@ -13,11 +13,13 @@
* limitations under the License.
*/
-package tests.api.java.security.cert;
+package org.apache.harmony.security.tests.java.security.cert;
import java.security.cert.CertificateException;
-public class CertificateExceptionTest extends junit.framework.TestCase {
+import junit.framework.TestCase;
+
+public class CertificateException2Test extends junit.framework.TestCase {
/**
* @tests java.security.cert.CertificateException#CertificateException()
Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateExceptionTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateExceptionTest.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/CertificateExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateExceptionTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateExceptionTest.java Tue Jun 20 01:11:04 2006
@@ -1,240 +1,240 @@
-/*
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.cert.CertificateException;
-
-import junit.framework.TestCase;
-
-
-/**
- * Tests for <code>CertificateException</code> class constructors and methods.
- *
- */
-public class CertificateExceptionTest extends TestCase {
-
- public static void main(String[] args) {
- }
-
- /**
- * Constructor for CertificateExceptionTests.
- *
- * @param arg0
- */
- public CertificateExceptionTest(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 "CertificateException ".concat(tE.toString()).concat(
- " is not equal to caught exception: ").concat(eE.toString());
- }
-
- /**
- * Test for <code>CertificateException()</code> constructor Assertion:
- * constructs CertificateException with no detail message
- */
- public void testCertificateException01() {
- CertificateException tE = new CertificateException();
- 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>CertificateException(String)</code> constructor
- * Assertion: constructs CertificateException with detail message msg.
- * Parameter <code>msg</code> is not null.
- */
- public void testCertificateException02() {
- CertificateException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertificateException(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>CertificateException(String)</code> constructor
- * Assertion: constructs CertificateException when <code>msg</code> is
- * null
- */
- public void testCertificateException03() {
- String msg = null;
- CertificateException tE = new CertificateException(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>CertificateException(Throwable)</code> constructor
- * Assertion: constructs CertificateException when <code>cause</code> is
- * null
- */
- public void testCertificateException04() {
- Throwable cause = null;
- CertificateException tE = new CertificateException(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>CertificateException(Throwable)</code> constructor
- * Assertion: constructs CertificateException when <code>cause</code> is
- * not null
- */
- public void testCertificateException05() {
- CertificateException tE = new CertificateException(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>CertificateException(String, Throwable)</code>
- * constructor Assertion: constructs CertificateException when
- * <code>cause</code> is null <code>msg</code> is null
- */
- public void testCertificateException06() {
- CertificateException tE = new CertificateException(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>CertificateException(String, Throwable)</code>
- * constructor Assertion: constructs CertificateException when
- * <code>cause</code> is null <code>msg</code> is not null
- */
- public void testCertificateException07() {
- CertificateException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertificateException(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>CertificateException(String, Throwable)</code>
- * constructor Assertion: constructs CertificateException when
- * <code>cause</code> is not null <code>msg</code> is null
- */
- public void testCertificateException08() {
- CertificateException tE = new CertificateException(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>CertificateException(String, Throwable)</code>
- * constructor Assertion: constructs CertificateException when
- * <code>cause</code> is not null <code>msg</code> is not null
- */
- public void testCertificateException09() {
- CertificateException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertificateException(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.CertificateException;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Tests for <code>CertificateException</code> class constructors and methods.
+ *
+ */
+public class CertificateExceptionTest extends TestCase {
+
+ public static void main(String[] args) {
+ }
+
+ /**
+ * Constructor for CertificateExceptionTests.
+ *
+ * @param arg0
+ */
+ public CertificateExceptionTest(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 "CertificateException ".concat(tE.toString()).concat(
+ " is not equal to caught exception: ").concat(eE.toString());
+ }
+
+ /**
+ * Test for <code>CertificateException()</code> constructor Assertion:
+ * constructs CertificateException with no detail message
+ */
+ public void testCertificateException01() {
+ CertificateException tE = new CertificateException();
+ 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>CertificateException(String)</code> constructor
+ * Assertion: constructs CertificateException with detail message msg.
+ * Parameter <code>msg</code> is not null.
+ */
+ public void testCertificateException02() {
+ CertificateException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertificateException(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>CertificateException(String)</code> constructor
+ * Assertion: constructs CertificateException when <code>msg</code> is
+ * null
+ */
+ public void testCertificateException03() {
+ String msg = null;
+ CertificateException tE = new CertificateException(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>CertificateException(Throwable)</code> constructor
+ * Assertion: constructs CertificateException when <code>cause</code> is
+ * null
+ */
+ public void testCertificateException04() {
+ Throwable cause = null;
+ CertificateException tE = new CertificateException(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>CertificateException(Throwable)</code> constructor
+ * Assertion: constructs CertificateException when <code>cause</code> is
+ * not null
+ */
+ public void testCertificateException05() {
+ CertificateException tE = new CertificateException(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>CertificateException(String, Throwable)</code>
+ * constructor Assertion: constructs CertificateException when
+ * <code>cause</code> is null <code>msg</code> is null
+ */
+ public void testCertificateException06() {
+ CertificateException tE = new CertificateException(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>CertificateException(String, Throwable)</code>
+ * constructor Assertion: constructs CertificateException when
+ * <code>cause</code> is null <code>msg</code> is not null
+ */
+ public void testCertificateException07() {
+ CertificateException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertificateException(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>CertificateException(String, Throwable)</code>
+ * constructor Assertion: constructs CertificateException when
+ * <code>cause</code> is not null <code>msg</code> is null
+ */
+ public void testCertificateException08() {
+ CertificateException tE = new CertificateException(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>CertificateException(String, Throwable)</code>
+ * constructor Assertion: constructs CertificateException when
+ * <code>cause</code> is not null <code>msg</code> is not null
+ */
+ public void testCertificateException09() {
+ CertificateException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertificateException(msgs[i], tCause);
+ String getM = tE.getMessage();
+ String toS = tCause.toString();
+ if (msgs[i].length() > 0) {
+ assertTrue("getMessage() must contain ".concat(msgs[i]), getM
+ .indexOf(msgs[i]) != -1);
+ if (!getM.equals(msgs[i])) {
+ assertTrue("getMessage() should contain ".concat(toS), getM
+ .indexOf(toS) != -1);
+ }
+ }
+ assertNotNull("getCause() must not return null", tE.getCause());
+ assertEquals("getCause() must return ".concat(tCause.toString()),
+ tE.getCause(), tCause);
+
+ try {
+ throw tE;
+ } catch (Exception e) {
+ assertTrue(createErr(tE, e), tE.equals(e));
+ }
+ }
+ }
+}
Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateExpiredExceptionTest.java (from r414728, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateExpiredExceptionTest.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/CertificateExpiredExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateExpiredExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateExpiredExceptionTest.java&r1=414728&r2=415555&rev=415555&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/CertificateExpiredExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateExpiredExceptionTest.java Tue Jun 20 01:11:04 2006
@@ -1,111 +1,111 @@
-/*
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package java.security.cert;
-
-import java.security.cert.CertificateExpiredException;
-
-import junit.framework.TestCase;
-
-
-/**
- * Tests for <code>DigestException</code> class constructors and methods.
- *
- */
-public class CertificateExpiredExceptionTest extends TestCase {
-
- public static void main(String[] args) {
- }
-
- /**
- * Constructor for CertificateExpiredExceptionTests.
- *
- * @param arg0
- */
- public CertificateExpiredExceptionTest(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 "CertificateExpiredException: ".concat(tE.toString()).concat(
- " is not equal to caught exception: ").concat(eE.toString());
- }
-
- /**
- * Test for <code>CertificateExpiredException()</code> constructor
- * Assertion: constructs CertificateExpiredException with no detail message
- */
- public void testCertificateExpiredException01() {
- CertificateExpiredException tE = new CertificateExpiredException();
- 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>CertificateExpiredException(String)</code> constructor
- * Assertion: constructs CertificateExpiredException with detail message
- * msg. Parameter <code>msg</code> is not null.
- */
- public void testCertificateExpiredException02() {
- CertificateExpiredException tE;
- for (int i = 0; i < msgs.length; i++) {
- tE = new CertificateExpiredException(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>CertificateExpiredException(String)</code> constructor
- * Assertion: constructs CertificateExpiredException when <code>msg</code>
- * is null
- */
- public void testCertificateExpiredException03() {
- String msg = null;
- CertificateExpiredException tE = new CertificateExpiredException(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.CertificateExpiredException;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Tests for <code>DigestException</code> class constructors and methods.
+ *
+ */
+public class CertificateExpiredExceptionTest extends TestCase {
+
+ public static void main(String[] args) {
+ }
+
+ /**
+ * Constructor for CertificateExpiredExceptionTests.
+ *
+ * @param arg0
+ */
+ public CertificateExpiredExceptionTest(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 "CertificateExpiredException: ".concat(tE.toString()).concat(
+ " is not equal to caught exception: ").concat(eE.toString());
+ }
+
+ /**
+ * Test for <code>CertificateExpiredException()</code> constructor
+ * Assertion: constructs CertificateExpiredException with no detail message
+ */
+ public void testCertificateExpiredException01() {
+ CertificateExpiredException tE = new CertificateExpiredException();
+ 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>CertificateExpiredException(String)</code> constructor
+ * Assertion: constructs CertificateExpiredException with detail message
+ * msg. Parameter <code>msg</code> is not null.
+ */
+ public void testCertificateExpiredException02() {
+ CertificateExpiredException tE;
+ for (int i = 0; i < msgs.length; i++) {
+ tE = new CertificateExpiredException(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>CertificateExpiredException(String)</code> constructor
+ * Assertion: constructs CertificateExpiredException when <code>msg</code>
+ * is null
+ */
+ public void testCertificateExpiredException03() {
+ String msg = null;
+ CertificateExpiredException tE = new CertificateExpiredException(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));
+ }
+ }
+
+}