harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r443539 [28/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/impl/java/org/apache/harmony/security/tests/java/security/spec/ECParameterSpec_ImplTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECParameterSpec_ImplTest.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECParameterSpec_ImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECParameterSpec_ImplTest.java Thu Sep 14 18:17:39 2006
@@ -1,264 +1,264 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Vladimir N. Molotkov
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.tests.java.security.spec;
-
-import java.math.BigInteger;
-import java.security.spec.ECFieldFp;
-import java.security.spec.ECParameterSpec;
-import java.security.spec.ECPoint;
-import java.security.spec.EllipticCurve;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>ECParameterSpec</code> class fields and methods.
- * 
- */
-public class ECParameterSpec_ImplTest extends TestCase {
-
-    //
-    // Tests
-    //
-    // NOTE: the following tests use EC domain parameters
-    // which are invalid for real EC cryptography application
-    // but must be acceptable by the class under test according
-    // to the API specification
-    //
-
-    /**
-     * Test #1 for <code>ECParameterSpec(EllipticCurve, ECPoint, BigInteger, int)</code> constructor<br> 
-     * Assertion: creates <code>ECParameterSpec</code> instance<br>
-     * Test preconditions: valid parameters passed<br>
-     * Expected: must pass without any exceptions
-     */
-    public final void testECParameterSpec01() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);        
-    }
-
-    /**
-     * Test #2 for <code>ECParameterSpec(EllipticCurve, ECPoint, BigInteger, int)</code> constructor<br> 
-     * Assertion: throws <code>NullPointerException</code> if
-     * <code>curve</code>, <code>generator</code> or <code>order</code> is <code>null</code><br>
-     * Test preconditions: pass <code>null</code> as mentioned parameters<br>
-     * Expected: must throw <code>NullPointerException</code>
-     */
-    public final void testECParameterSpec02() {
-        // Valid (see note below) parameters set
-        EllipticCurve curve =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        BigInteger order = BigInteger.valueOf(5L);
-
-        // Test case 1: curve is null
-        try {
-            new ECParameterSpec(null, generator, order, 10);
-            fail("#1: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-
-
-        // Test case 2: generator is null
-        try {
-            new ECParameterSpec(curve, null, order, 10);
-            fail("#2: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-
-
-        // Test case 3: order is null
-        try {
-            new ECParameterSpec(curve, generator, null, 10);
-            fail("#3: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-
-
-        // Test case 4: all above are null
-        try {
-            new ECParameterSpec(null, null, null, 10);
-            fail("#4: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-    }
-
-    /**
-     * Test #3 for <code>ECParameterSpec(EllipticCurve, ECPoint, BigInteger, int)</code> constructor<br> 
-     * Assertion: throws <code>IllegalArgumentException</code> if
-     * <code>order</code> or <code>cofactor</code> is not positive<br>
-     * Test preconditions: pass not positive as mentioned parameters<br>
-     * Expected: must throw <code>IllegalArgumentException</code>
-     */
-    public final void testECParameterSpec03() {
-        // Valid (see note below) parameters set
-        EllipticCurve curve =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-
-
-        // Test case 1: order is negative
-        try {
-            new ECParameterSpec(curve, generator, BigInteger.valueOf(-5L), 10);
-            fail("#1: Expected IAE not thrown");
-        } catch (IllegalArgumentException ok) {
-        }
-
-
-        // Test case 2: order == 0
-        try {
-            new ECParameterSpec(curve, generator, BigInteger.ZERO, 10);
-            fail("#2: Expected IAE not thrown");
-        } catch (IllegalArgumentException ok) {
-        }
-
-
-        // Test case 3: cofactor is negative
-        try {
-            new ECParameterSpec(curve, generator, BigInteger.valueOf(5L), -10);
-            fail("#3: Expected IAE not thrown");
-        } catch (IllegalArgumentException ok) {
-        }
-
-
-        // Test case 4: cofactor == 0
-        try {
-            new ECParameterSpec(curve, generator, BigInteger.valueOf(5L), 0);
-            fail("#4: Expected IAE not thrown");
-        } catch (IllegalArgumentException ok) {
-        }
-
-
-        // Test case 5: both order and cofactor are not positive
-        try {
-            new ECParameterSpec(curve, generator, BigInteger.valueOf(-5L), 0);
-            fail("#5: Expected IAE not thrown");
-        } catch (IllegalArgumentException ok) {
-        }
-    }
-
-    /**
-     * Test for <code>getCofactor()</code> method<br>
-     * Assertion: returns cofactor<br>
-     * Test preconditions: <code>ECParameterSpec</code> instance
-     * created using valid parameters<br>
-     * Expected: must return cofactor value which is equal
-     * to the one passed to the constructor
-     */
-    public final void testGetCofactor() {
-        // Valid (see note below) parameters set
-        EllipticCurve curve =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        BigInteger order = BigInteger.valueOf(5L);
-        int cofactor = 10;
-        ECParameterSpec ps = 
-            new ECParameterSpec(curve, generator, order, cofactor);
-        assertEquals(cofactor, ps.getCofactor());
-    }
-
-    /**
-     * Test for <code>getCurve()</code> method<br>
-     * Assertion: returns curve<br>
-     * Test preconditions: <code>ECParameterSpec</code> instance
-     * created using valid parameters<br>
-     * Expected: must return ref to the <code>EllipticCurve</code> object
-     * which is equal to the one passed to the constructor; (both must refer
-     * the same object)
-     */
-    public final void testGetCurve() {
-        // Valid (see note below) parameters set
-        EllipticCurve curve =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        BigInteger order = BigInteger.valueOf(5L);
-        int cofactor = 10;
-        ECParameterSpec ps = 
-            new ECParameterSpec(curve, generator, order, cofactor);
-        EllipticCurve curveRet = ps.getCurve();
-        assertEquals(curve, curveRet);
-        assertSame(curve, curveRet);
-    }
-
-    /**
-     * Test for <code>getGenerator()</code> method<br>
-     * Assertion: returns generator<br>
-     * Test preconditions: <code>ECParameterSpec</code> instance
-     * created using valid parameters<br>
-     * Expected: must return ref to the <code>ECPoint</code> object
-     * which is equal to the one passed to the constructor; (both must refer
-     * the same object)
-     */
-    public final void testGetGenerator() {
-        // Valid (see note below) parameters set
-        EllipticCurve curve =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        BigInteger order = BigInteger.valueOf(5L);
-        int cofactor = 10;
-        ECParameterSpec ps = 
-            new ECParameterSpec(curve, generator, order, cofactor);
-        ECPoint generatorRet = ps.getGenerator();
-        assertEquals(generator, generatorRet);
-        assertSame(generator, generatorRet);
-    }
-
-    /**
-     * Test for <code>getOrder()</code> method<br>
-     * Assertion: returns order<br>
-     * Test preconditions: <code>ECParameterSpec</code> instance
-     * created using valid parameters<br>
-     * Expected: must return ref to the <code>BigInteger</code> object
-     * which is equal to the one passed to the constructor; (both must refer
-     * the same object)
-     */
-    public final void testGetOrder() {
-        // Valid (see note below) parameters set
-        EllipticCurve curve =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        BigInteger order = BigInteger.valueOf(5L);
-        int cofactor = 10;
-        ECParameterSpec ps = 
-            new ECParameterSpec(curve, generator, order, cofactor);
-        BigInteger orderRet = ps.getOrder();
-        assertEquals(order, orderRet);
-        assertSame(order, orderRet);
-    }
-
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vladimir N. Molotkov
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.spec;
+
+import java.math.BigInteger;
+import java.security.spec.ECFieldFp;
+import java.security.spec.ECParameterSpec;
+import java.security.spec.ECPoint;
+import java.security.spec.EllipticCurve;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>ECParameterSpec</code> class fields and methods.
+ * 
+ */
+public class ECParameterSpec_ImplTest extends TestCase {
+
+    //
+    // Tests
+    //
+    // NOTE: the following tests use EC domain parameters
+    // which are invalid for real EC cryptography application
+    // but must be acceptable by the class under test according
+    // to the API specification
+    //
+
+    /**
+     * Test #1 for <code>ECParameterSpec(EllipticCurve, ECPoint, BigInteger, int)</code> constructor<br> 
+     * Assertion: creates <code>ECParameterSpec</code> instance<br>
+     * Test preconditions: valid parameters passed<br>
+     * Expected: must pass without any exceptions
+     */
+    public final void testECParameterSpec01() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);        
+    }
+
+    /**
+     * Test #2 for <code>ECParameterSpec(EllipticCurve, ECPoint, BigInteger, int)</code> constructor<br> 
+     * Assertion: throws <code>NullPointerException</code> if
+     * <code>curve</code>, <code>generator</code> or <code>order</code> is <code>null</code><br>
+     * Test preconditions: pass <code>null</code> as mentioned parameters<br>
+     * Expected: must throw <code>NullPointerException</code>
+     */
+    public final void testECParameterSpec02() {
+        // Valid (see note below) parameters set
+        EllipticCurve curve =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        BigInteger order = BigInteger.valueOf(5L);
+
+        // Test case 1: curve is null
+        try {
+            new ECParameterSpec(null, generator, order, 10);
+            fail("#1: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+
+
+        // Test case 2: generator is null
+        try {
+            new ECParameterSpec(curve, null, order, 10);
+            fail("#2: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+
+
+        // Test case 3: order is null
+        try {
+            new ECParameterSpec(curve, generator, null, 10);
+            fail("#3: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+
+
+        // Test case 4: all above are null
+        try {
+            new ECParameterSpec(null, null, null, 10);
+            fail("#4: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+    }
+
+    /**
+     * Test #3 for <code>ECParameterSpec(EllipticCurve, ECPoint, BigInteger, int)</code> constructor<br> 
+     * Assertion: throws <code>IllegalArgumentException</code> if
+     * <code>order</code> or <code>cofactor</code> is not positive<br>
+     * Test preconditions: pass not positive as mentioned parameters<br>
+     * Expected: must throw <code>IllegalArgumentException</code>
+     */
+    public final void testECParameterSpec03() {
+        // Valid (see note below) parameters set
+        EllipticCurve curve =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+
+
+        // Test case 1: order is negative
+        try {
+            new ECParameterSpec(curve, generator, BigInteger.valueOf(-5L), 10);
+            fail("#1: Expected IAE not thrown");
+        } catch (IllegalArgumentException ok) {
+        }
+
+
+        // Test case 2: order == 0
+        try {
+            new ECParameterSpec(curve, generator, BigInteger.ZERO, 10);
+            fail("#2: Expected IAE not thrown");
+        } catch (IllegalArgumentException ok) {
+        }
+
+
+        // Test case 3: cofactor is negative
+        try {
+            new ECParameterSpec(curve, generator, BigInteger.valueOf(5L), -10);
+            fail("#3: Expected IAE not thrown");
+        } catch (IllegalArgumentException ok) {
+        }
+
+
+        // Test case 4: cofactor == 0
+        try {
+            new ECParameterSpec(curve, generator, BigInteger.valueOf(5L), 0);
+            fail("#4: Expected IAE not thrown");
+        } catch (IllegalArgumentException ok) {
+        }
+
+
+        // Test case 5: both order and cofactor are not positive
+        try {
+            new ECParameterSpec(curve, generator, BigInteger.valueOf(-5L), 0);
+            fail("#5: Expected IAE not thrown");
+        } catch (IllegalArgumentException ok) {
+        }
+    }
+
+    /**
+     * Test for <code>getCofactor()</code> method<br>
+     * Assertion: returns cofactor<br>
+     * Test preconditions: <code>ECParameterSpec</code> instance
+     * created using valid parameters<br>
+     * Expected: must return cofactor value which is equal
+     * to the one passed to the constructor
+     */
+    public final void testGetCofactor() {
+        // Valid (see note below) parameters set
+        EllipticCurve curve =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        BigInteger order = BigInteger.valueOf(5L);
+        int cofactor = 10;
+        ECParameterSpec ps = 
+            new ECParameterSpec(curve, generator, order, cofactor);
+        assertEquals(cofactor, ps.getCofactor());
+    }
+
+    /**
+     * Test for <code>getCurve()</code> method<br>
+     * Assertion: returns curve<br>
+     * Test preconditions: <code>ECParameterSpec</code> instance
+     * created using valid parameters<br>
+     * Expected: must return ref to the <code>EllipticCurve</code> object
+     * which is equal to the one passed to the constructor; (both must refer
+     * the same object)
+     */
+    public final void testGetCurve() {
+        // Valid (see note below) parameters set
+        EllipticCurve curve =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        BigInteger order = BigInteger.valueOf(5L);
+        int cofactor = 10;
+        ECParameterSpec ps = 
+            new ECParameterSpec(curve, generator, order, cofactor);
+        EllipticCurve curveRet = ps.getCurve();
+        assertEquals(curve, curveRet);
+        assertSame(curve, curveRet);
+    }
+
+    /**
+     * Test for <code>getGenerator()</code> method<br>
+     * Assertion: returns generator<br>
+     * Test preconditions: <code>ECParameterSpec</code> instance
+     * created using valid parameters<br>
+     * Expected: must return ref to the <code>ECPoint</code> object
+     * which is equal to the one passed to the constructor; (both must refer
+     * the same object)
+     */
+    public final void testGetGenerator() {
+        // Valid (see note below) parameters set
+        EllipticCurve curve =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        BigInteger order = BigInteger.valueOf(5L);
+        int cofactor = 10;
+        ECParameterSpec ps = 
+            new ECParameterSpec(curve, generator, order, cofactor);
+        ECPoint generatorRet = ps.getGenerator();
+        assertEquals(generator, generatorRet);
+        assertSame(generator, generatorRet);
+    }
+
+    /**
+     * Test for <code>getOrder()</code> method<br>
+     * Assertion: returns order<br>
+     * Test preconditions: <code>ECParameterSpec</code> instance
+     * created using valid parameters<br>
+     * Expected: must return ref to the <code>BigInteger</code> object
+     * which is equal to the one passed to the constructor; (both must refer
+     * the same object)
+     */
+    public final void testGetOrder() {
+        // Valid (see note below) parameters set
+        EllipticCurve curve =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        BigInteger order = BigInteger.valueOf(5L);
+        int cofactor = 10;
+        ECParameterSpec ps = 
+            new ECParameterSpec(curve, generator, order, cofactor);
+        BigInteger orderRet = ps.getOrder();
+        assertEquals(order, orderRet);
+        assertSame(order, orderRet);
+    }
+
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECPrivateKeySpec_ImplTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECPrivateKeySpec_ImplTest.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECPrivateKeySpec_ImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECPrivateKeySpec_ImplTest.java Thu Sep 14 18:17:39 2006
@@ -1,158 +1,158 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Vladimir N. Molotkov
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.tests.java.security.spec;
-
-import java.math.BigInteger;
-import java.security.spec.ECFieldFp;
-import java.security.spec.ECParameterSpec;
-import java.security.spec.ECPoint;
-import java.security.spec.ECPrivateKeySpec;
-import java.security.spec.EllipticCurve;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>ECPrivateKeySpec</code> class fields and methods.
- * 
- */
-public class ECPrivateKeySpec_ImplTest extends TestCase {
-
-    //
-    // Tests
-    //
-    // NOTE: the following tests use EC domain parameters
-    // which are invalid for real EC cryptography application
-    // but must be acceptable by the class under test according
-    // to the API specification
-    //
-
-    /**
-     * Test #1 for <code>ECPrivateKeySpec(BigInteger, ECParameterSpec)</code> constructor<br> 
-     * Assertion: creates <code>ECPrivateKeySpec</code> instance<br>
-     * Test preconditions: valid parameters passed<br>
-     * Expected: must pass without any exceptions
-     */
-    public final void testECPrivateKeySpec01() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        new ECPrivateKeySpec(BigInteger.ZERO,
-                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
-        
-    }
-
-   /**
-     * Test #2 for <code>ECPrivateKeySpec(BigInteger, ECParameterSpec)</code> constructor<br> 
-     * Assertion: throws <code>NullPointerException</code> if
-     * <code>s</code> or <code>params</code> is <code>null</code><br>
-     * Test preconditions: pass <code>null</code> as mentioned parameters<br>
-     * Expected: must throw <code>NullPointerException</code>
-     */
-    public final void testECPrivateKeySpec02() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-
-        // Test case 1: s is null
-        try {
-            new ECPrivateKeySpec(null,
-                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
-            fail("#1: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-
-
-        // Test case 2: params is null
-        try {
-            new ECPrivateKeySpec(BigInteger.valueOf(0L), null);
-            fail("#2: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-
-
-        // Test case 3: both s and params are null
-        try {
-            new ECPrivateKeySpec(null, null);
-            fail("#3: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-    }
-
-    /**
-     * Test for <code>getParams()</code> method<br>
-     * Assertion: returns associated EC parameters<br>
-     * Test preconditions: <code>ECPrivateKeySpec</code> instance
-     * created using valid parameters<br>
-     * Expected: must return params value which is equal
-     * to the one passed to the constructor; (both must refer
-     * the same object)
-     */
-    public final void testGetParams() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        ECParameterSpec params =
-            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
-
-        ECPrivateKeySpec ks = new ECPrivateKeySpec(BigInteger.ZERO, params);
-        ECParameterSpec paramsRet = ks.getParams();
-        
-        assertEquals(params, paramsRet);
-        assertSame(params, paramsRet);
-    }
-
-    /**
-     * Test for <code>getS()</code> method<br>
-     * Assertion: returns associated private value<br>
-     * Test preconditions: <code>ECPrivateKeySpec</code> instance
-     * created using valid parameters<br>
-     * Expected: must return s value which is equal
-     * to the one passed to the constructor; (both must refer
-     * the same object)
-     */
-    public final void testGetS() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        ECParameterSpec params =
-            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
-        BigInteger s = BigInteger.valueOf(5L);
-
-        ECPrivateKeySpec ks = new ECPrivateKeySpec(s, params);
-        BigInteger sRet = ks.getS();
-
-        assertEquals(s, sRet);
-        assertSame(s, sRet);
-    }
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vladimir N. Molotkov
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.spec;
+
+import java.math.BigInteger;
+import java.security.spec.ECFieldFp;
+import java.security.spec.ECParameterSpec;
+import java.security.spec.ECPoint;
+import java.security.spec.ECPrivateKeySpec;
+import java.security.spec.EllipticCurve;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>ECPrivateKeySpec</code> class fields and methods.
+ * 
+ */
+public class ECPrivateKeySpec_ImplTest extends TestCase {
+
+    //
+    // Tests
+    //
+    // NOTE: the following tests use EC domain parameters
+    // which are invalid for real EC cryptography application
+    // but must be acceptable by the class under test according
+    // to the API specification
+    //
+
+    /**
+     * Test #1 for <code>ECPrivateKeySpec(BigInteger, ECParameterSpec)</code> constructor<br> 
+     * Assertion: creates <code>ECPrivateKeySpec</code> instance<br>
+     * Test preconditions: valid parameters passed<br>
+     * Expected: must pass without any exceptions
+     */
+    public final void testECPrivateKeySpec01() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        new ECPrivateKeySpec(BigInteger.ZERO,
+                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
+        
+    }
+
+   /**
+     * Test #2 for <code>ECPrivateKeySpec(BigInteger, ECParameterSpec)</code> constructor<br> 
+     * Assertion: throws <code>NullPointerException</code> if
+     * <code>s</code> or <code>params</code> is <code>null</code><br>
+     * Test preconditions: pass <code>null</code> as mentioned parameters<br>
+     * Expected: must throw <code>NullPointerException</code>
+     */
+    public final void testECPrivateKeySpec02() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+
+        // Test case 1: s is null
+        try {
+            new ECPrivateKeySpec(null,
+                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
+            fail("#1: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+
+
+        // Test case 2: params is null
+        try {
+            new ECPrivateKeySpec(BigInteger.valueOf(0L), null);
+            fail("#2: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+
+
+        // Test case 3: both s and params are null
+        try {
+            new ECPrivateKeySpec(null, null);
+            fail("#3: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+    }
+
+    /**
+     * Test for <code>getParams()</code> method<br>
+     * Assertion: returns associated EC parameters<br>
+     * Test preconditions: <code>ECPrivateKeySpec</code> instance
+     * created using valid parameters<br>
+     * Expected: must return params value which is equal
+     * to the one passed to the constructor; (both must refer
+     * the same object)
+     */
+    public final void testGetParams() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        ECParameterSpec params =
+            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
+
+        ECPrivateKeySpec ks = new ECPrivateKeySpec(BigInteger.ZERO, params);
+        ECParameterSpec paramsRet = ks.getParams();
+        
+        assertEquals(params, paramsRet);
+        assertSame(params, paramsRet);
+    }
+
+    /**
+     * Test for <code>getS()</code> method<br>
+     * Assertion: returns associated private value<br>
+     * Test preconditions: <code>ECPrivateKeySpec</code> instance
+     * created using valid parameters<br>
+     * Expected: must return s value which is equal
+     * to the one passed to the constructor; (both must refer
+     * the same object)
+     */
+    public final void testGetS() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        ECParameterSpec params =
+            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
+        BigInteger s = BigInteger.valueOf(5L);
+
+        ECPrivateKeySpec ks = new ECPrivateKeySpec(s, params);
+        BigInteger sRet = ks.getS();
+
+        assertEquals(s, sRet);
+        assertSame(s, sRet);
+    }
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECPublicKeySpec_ImplTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECPublicKeySpec_ImplTest.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECPublicKeySpec_ImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/ECPublicKeySpec_ImplTest.java Thu Sep 14 18:17:39 2006
@@ -1,181 +1,181 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Vladimir N. Molotkov
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.tests.java.security.spec;
-
-import java.math.BigInteger;
-import java.security.spec.ECFieldFp;
-import java.security.spec.ECParameterSpec;
-import java.security.spec.ECPoint;
-import java.security.spec.ECPublicKeySpec;
-import java.security.spec.EllipticCurve;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>ECPublicKeySpec</code> class fields and methods.
- * 
- */
-public class ECPublicKeySpec_ImplTest extends TestCase {
-
-    //
-    // Tests
-    //
-    // NOTE: the following tests use EC domain parameters
-    // which are invalid for real EC cryptography application
-    // but must be acceptable by the class under test according
-    // to the API specification
-    //
-
-    /**
-     * Test #1 for <code>ECPublicKeySpec(ECPoint, ECParameterSpec)</code> constructor<br> 
-     * Assertion: creates <code>ECPublicKeySpec</code> instance<br>
-     * Test preconditions: valid parameters passed<br>
-     * Expected: must pass without any exceptions
-     */
-    public final void testECPublicKeySpec01() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        new ECPublicKeySpec(g,
-                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
-        
-    }
-
-   /**
-     * Test #2 for <code>ECPublicKeySpec(ECPoint, ECParameterSpec)</code> constructor<br> 
-     * Assertion: throws <code>NullPointerException</code> if
-     * <code>w</code> or <code>params</code> is <code>null</code><br>
-     * Test preconditions: pass <code>null</code> as mentioned parameters<br>
-     * Expected: must throw <code>NullPointerException</code>
-     */
-    public final void testECPublicKeySpec02() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-
-        // Test case 1: w is null
-        try {
-            new ECPublicKeySpec(null,
-                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
-            fail("#1: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-
-
-        // Test case 2: params is null
-        try {
-            new ECPublicKeySpec(g, null);
-            fail("#2: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-
-
-        // Test case 3: both w and params are null
-        try {
-            new ECPublicKeySpec(null, null);
-            fail("#3: Expected NPE not thrown");
-        } catch (NullPointerException ok) {
-        }
-    }
-
-    /**
-      * Test #3 for <code>ECPublicKeySpec(ECPoint, ECParameterSpec)</code> constructor<br> 
-      * Assertion: throws <code>IllegalArgumentException</code> if
-      * <code>w</code> is point at infinity<br>
-      * Test preconditions: pass <code>ECPoint.POINT_INFINITY</code>
-      * as mentioned parameter value<br>
-      * Expected: must throw <code>IllegalArgumentException</code>
-      */
-     public final void testECPublicKeySpec03() {
-         // Valid (see note below) parameters set
-         EllipticCurve c =
-             new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                               BigInteger.ZERO,
-                               BigInteger.valueOf(4L));
-         ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-
-         try {
-             new ECPublicKeySpec(ECPoint.POINT_INFINITY,
-                     new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
-            fail("Expected IAE not thrown");
-         } catch (IllegalArgumentException ok) {
-         }
-     }
-
-     /**
-     * Test for <code>getParams()</code> method<br>
-     * Assertion: returns associated EC parameters<br>
-     * Test preconditions: <code>ECPublicKeySpec</code> instance
-     * created using valid parameters<br>
-     * Expected: must return params value which is equal
-     * to the one passed to the constructor; (both must refer
-     * the same object)
-     */
-    public final void testGetParams() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        ECParameterSpec params =
-            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
-
-        ECPublicKeySpec ks = new ECPublicKeySpec(g, params);
-        ECParameterSpec paramsRet = ks.getParams();
-        
-        assertEquals(params, paramsRet);
-        assertSame(params, paramsRet);
-    }
-
-    /**
-     * Test for <code>getW()</code> method<br>
-     * Assertion: returns associated public point<br>
-     * Test preconditions: <code>ECPublicKeySpec</code> instance
-     * created using valid parameters<br>
-     * Expected: must return w value which is equal
-     * to the one passed to the constructor; (both must refer
-     * the same object)
-     */
-    public final void testGetW() {
-        // Valid (see note below) parameters set
-        EllipticCurve c =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
-                              BigInteger.ZERO,
-                              BigInteger.valueOf(4L));
-        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
-        ECParameterSpec params =
-            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
-
-        ECPublicKeySpec ks = new ECPublicKeySpec(g, params);
-        ECPoint wRet = ks.getW();
-
-        assertEquals(g, wRet);
-        assertSame(g, wRet);
-    }
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vladimir N. Molotkov
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.spec;
+
+import java.math.BigInteger;
+import java.security.spec.ECFieldFp;
+import java.security.spec.ECParameterSpec;
+import java.security.spec.ECPoint;
+import java.security.spec.ECPublicKeySpec;
+import java.security.spec.EllipticCurve;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>ECPublicKeySpec</code> class fields and methods.
+ * 
+ */
+public class ECPublicKeySpec_ImplTest extends TestCase {
+
+    //
+    // Tests
+    //
+    // NOTE: the following tests use EC domain parameters
+    // which are invalid for real EC cryptography application
+    // but must be acceptable by the class under test according
+    // to the API specification
+    //
+
+    /**
+     * Test #1 for <code>ECPublicKeySpec(ECPoint, ECParameterSpec)</code> constructor<br> 
+     * Assertion: creates <code>ECPublicKeySpec</code> instance<br>
+     * Test preconditions: valid parameters passed<br>
+     * Expected: must pass without any exceptions
+     */
+    public final void testECPublicKeySpec01() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        new ECPublicKeySpec(g,
+                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
+        
+    }
+
+   /**
+     * Test #2 for <code>ECPublicKeySpec(ECPoint, ECParameterSpec)</code> constructor<br> 
+     * Assertion: throws <code>NullPointerException</code> if
+     * <code>w</code> or <code>params</code> is <code>null</code><br>
+     * Test preconditions: pass <code>null</code> as mentioned parameters<br>
+     * Expected: must throw <code>NullPointerException</code>
+     */
+    public final void testECPublicKeySpec02() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+
+        // Test case 1: w is null
+        try {
+            new ECPublicKeySpec(null,
+                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
+            fail("#1: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+
+
+        // Test case 2: params is null
+        try {
+            new ECPublicKeySpec(g, null);
+            fail("#2: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+
+
+        // Test case 3: both w and params are null
+        try {
+            new ECPublicKeySpec(null, null);
+            fail("#3: Expected NPE not thrown");
+        } catch (NullPointerException ok) {
+        }
+    }
+
+    /**
+      * Test #3 for <code>ECPublicKeySpec(ECPoint, ECParameterSpec)</code> constructor<br> 
+      * Assertion: throws <code>IllegalArgumentException</code> if
+      * <code>w</code> is point at infinity<br>
+      * Test preconditions: pass <code>ECPoint.POINT_INFINITY</code>
+      * as mentioned parameter value<br>
+      * Expected: must throw <code>IllegalArgumentException</code>
+      */
+     public final void testECPublicKeySpec03() {
+         // Valid (see note below) parameters set
+         EllipticCurve c =
+             new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                               BigInteger.ZERO,
+                               BigInteger.valueOf(4L));
+         ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+
+         try {
+             new ECPublicKeySpec(ECPoint.POINT_INFINITY,
+                     new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
+            fail("Expected IAE not thrown");
+         } catch (IllegalArgumentException ok) {
+         }
+     }
+
+     /**
+     * Test for <code>getParams()</code> method<br>
+     * Assertion: returns associated EC parameters<br>
+     * Test preconditions: <code>ECPublicKeySpec</code> instance
+     * created using valid parameters<br>
+     * Expected: must return params value which is equal
+     * to the one passed to the constructor; (both must refer
+     * the same object)
+     */
+    public final void testGetParams() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        ECParameterSpec params =
+            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
+
+        ECPublicKeySpec ks = new ECPublicKeySpec(g, params);
+        ECParameterSpec paramsRet = ks.getParams();
+        
+        assertEquals(params, paramsRet);
+        assertSame(params, paramsRet);
+    }
+
+    /**
+     * Test for <code>getW()</code> method<br>
+     * Assertion: returns associated public point<br>
+     * Test preconditions: <code>ECPublicKeySpec</code> instance
+     * created using valid parameters<br>
+     * Expected: must return w value which is equal
+     * to the one passed to the constructor; (both must refer
+     * the same object)
+     */
+    public final void testGetW() {
+        // Valid (see note below) parameters set
+        EllipticCurve c =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
+                              BigInteger.ZERO,
+                              BigInteger.valueOf(4L));
+        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
+        ECParameterSpec params =
+            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
+
+        ECPublicKeySpec ks = new ECPublicKeySpec(g, params);
+        ECPoint wRet = ks.getW();
+
+        assertEquals(g, wRet);
+        assertSame(g, wRet);
+    }
+}

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/EllipticCurve_ImplTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/EllipticCurve_ImplTest.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/EllipticCurve_ImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/spec/EllipticCurve_ImplTest.java Thu Sep 14 18:17:39 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 Vladimir N. Molotkov
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.tests.java.security.spec;
-
-import java.math.BigInteger;
-import java.security.spec.ECFieldF2m;
-import java.security.spec.ECFieldFp;
-import java.security.spec.EllipticCurve;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>EllipticCurve</code> class fields and methods.
- * 
- */
-public class EllipticCurve_ImplTest extends TestCase {
-
-    /**
-     * Test #2 for <code>equals(Object other)</code> method<br>
-     * Assertion: return false if this and other objects are not equal<br>
-     * Test preconditions: see test comments<br>
-     * Expected: all objects in this test must be NOT equal
-     */
-    public final void testEqualsObject02() {
-        // test case 1: must not be equal to null
-        EllipticCurve c2=null, c1 =
-            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                    BigInteger.ONE,
-                    BigInteger.valueOf(19L));
-        assertFalse(c1.equals(c2));
-
-        // test case 2: not equal objects - field
-        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.ONE,
-                BigInteger.valueOf(19L));
-        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(31L)),
-                BigInteger.valueOf(1L),
-                BigInteger.valueOf(19L));
-        assertFalse(c1.equals(c2) || c2.equals(c1));
-
-        // test case 3: not equal objects - a
-        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.ONE,
-                BigInteger.valueOf(19L));
-        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.ZERO,
-                BigInteger.valueOf(19L));
-        assertFalse(c1.equals(c2) || c2.equals(c1));
-
-        // test case 4: not equal objects - b
-        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.ONE,
-                BigInteger.valueOf(19L));
-        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.ONE,
-                BigInteger.valueOf(17L));
-        assertFalse(c1.equals(c2) || c2.equals(c1));
-
-        // test case 5: not equal objects - both seed not null
-        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.ONE,
-                BigInteger.valueOf(19L),
-                new byte[24]);
-        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.valueOf(1L),
-                BigInteger.valueOf(19L),
-                new byte[25]);
-        assertFalse(c1.equals(c2) || c2.equals(c1));
-
-        // test case 6: not equal objects - one seed is null
-        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.ONE,
-                BigInteger.valueOf(19L),
-                null);
-        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.valueOf(1L),
-                BigInteger.valueOf(19L),
-                new byte[24]);
-        assertFalse(c1.equals(c2) || c2.equals(c1));
-
-        // test case 7: not equal objects - field class
-        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
-                BigInteger.ONE,
-                BigInteger.valueOf(19L),
-                new byte[24]);
-        c2 = new EllipticCurve(new ECFieldF2m(5),
-                BigInteger.ONE,
-                BigInteger.valueOf(19L),
-                new byte[24]);
-        assertFalse(c1.equals(c2) || c2.equals(c1));
-    }
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vladimir N. Molotkov
+* @version $Revision$
+*/
+
+package org.apache.harmony.security.tests.java.security.spec;
+
+import java.math.BigInteger;
+import java.security.spec.ECFieldF2m;
+import java.security.spec.ECFieldFp;
+import java.security.spec.EllipticCurve;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>EllipticCurve</code> class fields and methods.
+ * 
+ */
+public class EllipticCurve_ImplTest extends TestCase {
+
+    /**
+     * Test #2 for <code>equals(Object other)</code> method<br>
+     * Assertion: return false if this and other objects are not equal<br>
+     * Test preconditions: see test comments<br>
+     * Expected: all objects in this test must be NOT equal
+     */
+    public final void testEqualsObject02() {
+        // test case 1: must not be equal to null
+        EllipticCurve c2=null, c1 =
+            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                    BigInteger.ONE,
+                    BigInteger.valueOf(19L));
+        assertFalse(c1.equals(c2));
+
+        // test case 2: not equal objects - field
+        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.ONE,
+                BigInteger.valueOf(19L));
+        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(31L)),
+                BigInteger.valueOf(1L),
+                BigInteger.valueOf(19L));
+        assertFalse(c1.equals(c2) || c2.equals(c1));
+
+        // test case 3: not equal objects - a
+        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.ONE,
+                BigInteger.valueOf(19L));
+        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.ZERO,
+                BigInteger.valueOf(19L));
+        assertFalse(c1.equals(c2) || c2.equals(c1));
+
+        // test case 4: not equal objects - b
+        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.ONE,
+                BigInteger.valueOf(19L));
+        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.ONE,
+                BigInteger.valueOf(17L));
+        assertFalse(c1.equals(c2) || c2.equals(c1));
+
+        // test case 5: not equal objects - both seed not null
+        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.ONE,
+                BigInteger.valueOf(19L),
+                new byte[24]);
+        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.valueOf(1L),
+                BigInteger.valueOf(19L),
+                new byte[25]);
+        assertFalse(c1.equals(c2) || c2.equals(c1));
+
+        // test case 6: not equal objects - one seed is null
+        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.ONE,
+                BigInteger.valueOf(19L),
+                null);
+        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.valueOf(1L),
+                BigInteger.valueOf(19L),
+                new byte[24]);
+        assertFalse(c1.equals(c2) || c2.equals(c1));
+
+        // test case 7: not equal objects - field class
+        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
+                BigInteger.ONE,
+                BigInteger.valueOf(19L),
+                new byte[24]);
+        c2 = new EllipticCurve(new ECFieldF2m(5),
+                BigInteger.ONE,
+                BigInteger.valueOf(19L),
+                new byte[24]);
+        assertFalse(c1.equals(c2) || c2.equals(c1));
+    }
+}

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

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/pkcs10/CertificationRequestTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/pkcs10/CertificationRequestTest.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/pkcs10/CertificationRequestTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/pkcs10/CertificationRequestTest.java Thu Sep 14 18:17:39 2006
@@ -1,86 +1,86 @@
-/*
- *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.security.tests.pkcs10;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.harmony.security.pkcs10.CertificationRequest;
-import org.apache.harmony.security.pkcs10.CertificationRequestInfo;
-import org.apache.harmony.security.x501.AttributeTypeAndValue;
-import org.apache.harmony.security.x501.AttributeValue;
-import org.apache.harmony.security.x501.Name;
-import org.apache.harmony.security.x509.AlgorithmIdentifier;
-import org.apache.harmony.security.x509.SubjectPublicKeyInfo;
-
-
-
-public class CertificationRequestTest extends TestCase {
-
-    /**
-     * Test method for 'com.openintel.drl.security.pkcs10.CertificationRequest'.
-     * Creates CertificationRequest, gets its values, encodes and decodes the
-     * encoded form.
-     * 
-     */
-    public void testCertificationRequest() throws IOException {
-        int version = 2;// v3
-        Name subject = new Name("O=subject");
-        SubjectPublicKeyInfo spki = new SubjectPublicKeyInfo(
-                new AlgorithmIdentifier("1.2.840.113549.1.1.2"), new byte[4]);
-        List attributes = new ArrayList();
-        // 1.2.840.113549.1.9.1 is OID of EMAILADDRESS
-        attributes.add(new AttributeTypeAndValue("1.2.840.113549.1.9.1",
-                new AttributeValue("a@b.com", false)));
-        CertificationRequestInfo certReqInfo = new CertificationRequestInfo(
-                version, subject, spki, attributes);
-        AlgorithmIdentifier signatureAlgId = new AlgorithmIdentifier(
-                "1.2.3.44.555");
-        byte[] signature = { (byte) 0x01, (byte) 0x02, (byte) 0x03,
-                (byte) 0x04, (byte) 0x05 };
-
-        CertificationRequest certReq = new CertificationRequest(certReqInfo,
-                signatureAlgId, signature);
-
-        // check what we have constructed
-        assertEquals(certReqInfo, certReq.getInfo());
-        assertEquals(signatureAlgId, certReq.getAlgId());
-        assertTrue(Arrays.equals(signature, certReq.getSignature()));
-
-        // decode the encoded CSR 
-        byte[] encoding = certReq.getEncoded();
-        CertificationRequest decoded = (CertificationRequest) CertificationRequest.ASN1
-                .decode(encoding);
-
-        // check what was decoded
-        CertificationRequestInfo decodedCRinfo = certReq.getInfo();
-        
-        assertEquals(certReqInfo.getSubject(), decodedCRinfo.getSubject());
-        assertEquals(certReqInfo.getSubjectPublicKeyInfo(), decodedCRinfo
-                .getSubjectPublicKeyInfo());
-        assertEquals(certReqInfo.getVersion(), decodedCRinfo.getVersion());
-        assertEquals(certReqInfo.getAttributes(), decodedCRinfo.getAttributes());
-        
-        assertEquals(certReq.getAlgId(), decoded.getAlgId());
-        assertTrue(Arrays.equals(certReq.getSignature(), decoded.getSignature()));
-    }
-}
-
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.harmony.security.tests.pkcs10;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.harmony.security.pkcs10.CertificationRequest;
+import org.apache.harmony.security.pkcs10.CertificationRequestInfo;
+import org.apache.harmony.security.x501.AttributeTypeAndValue;
+import org.apache.harmony.security.x501.AttributeValue;
+import org.apache.harmony.security.x501.Name;
+import org.apache.harmony.security.x509.AlgorithmIdentifier;
+import org.apache.harmony.security.x509.SubjectPublicKeyInfo;
+
+
+
+public class CertificationRequestTest extends TestCase {
+
+    /**
+     * Test method for 'com.openintel.drl.security.pkcs10.CertificationRequest'.
+     * Creates CertificationRequest, gets its values, encodes and decodes the
+     * encoded form.
+     * 
+     */
+    public void testCertificationRequest() throws IOException {
+        int version = 2;// v3
+        Name subject = new Name("O=subject");
+        SubjectPublicKeyInfo spki = new SubjectPublicKeyInfo(
+                new AlgorithmIdentifier("1.2.840.113549.1.1.2"), new byte[4]);
+        List attributes = new ArrayList();
+        // 1.2.840.113549.1.9.1 is OID of EMAILADDRESS
+        attributes.add(new AttributeTypeAndValue("1.2.840.113549.1.9.1",
+                new AttributeValue("a@b.com", false)));
+        CertificationRequestInfo certReqInfo = new CertificationRequestInfo(
+                version, subject, spki, attributes);
+        AlgorithmIdentifier signatureAlgId = new AlgorithmIdentifier(
+                "1.2.3.44.555");
+        byte[] signature = { (byte) 0x01, (byte) 0x02, (byte) 0x03,
+                (byte) 0x04, (byte) 0x05 };
+
+        CertificationRequest certReq = new CertificationRequest(certReqInfo,
+                signatureAlgId, signature);
+
+        // check what we have constructed
+        assertEquals(certReqInfo, certReq.getInfo());
+        assertEquals(signatureAlgId, certReq.getAlgId());
+        assertTrue(Arrays.equals(signature, certReq.getSignature()));
+
+        // decode the encoded CSR 
+        byte[] encoding = certReq.getEncoded();
+        CertificationRequest decoded = (CertificationRequest) CertificationRequest.ASN1
+                .decode(encoding);
+
+        // check what was decoded
+        CertificationRequestInfo decodedCRinfo = certReq.getInfo();
+        
+        assertEquals(certReqInfo.getSubject(), decodedCRinfo.getSubject());
+        assertEquals(certReqInfo.getSubjectPublicKeyInfo(), decodedCRinfo
+                .getSubjectPublicKeyInfo());
+        assertEquals(certReqInfo.getVersion(), decodedCRinfo.getVersion());
+        assertEquals(certReqInfo.getAttributes(), decodedCRinfo.getAttributes());
+        
+        assertEquals(certReq.getAlgId(), decoded.getAlgId());
+        assertTrue(Arrays.equals(certReq.getSignature(), decoded.getSignature()));
+    }
+}
+

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

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CRLEntryImplTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CRLEntryImplTest.java?view=diff&rev=443539&r1=443538&r2=443539
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CRLEntryImplTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CRLEntryImplTest.java Thu Sep 14 18:17:39 2006
@@ -1,81 +1,81 @@
-/*
- *  Copyright 2006 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 Alexander Y. Kleymenov
- * @version $Revision$
- */
-
-package org.apache.harmony.security.tests.provider.cert;
-
-import java.math.BigInteger;
-import java.util.Date;
-import javax.security.auth.x500.X500Principal;
-
-import org.apache.harmony.security.provider.cert.X509CRLEntryImpl;
-import org.apache.harmony.security.x509.Extension;
-import org.apache.harmony.security.x509.Extensions;
-import org.apache.harmony.security.x509.TBSCertList;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * X509CRLEntryImplTest test
- */
-public class X509CRLEntryImplTest extends TestCase {
-
-    /**
-     * getExtensionValue(String oid) method testing.
-     */
-    public void testGetExtensionValue() throws Exception {
-        // revoked certificate issuer
-        X500Principal issuer = 
-            new X500Principal("O=Certificate Issuer");
-        // revoked sertificate serial number
-        BigInteger serialNumber = BigInteger.valueOf(555);
-        // crl entry extensions
-        Extensions crlEntryExtensions = new Extensions();
-        // add reason code extension which OID is 2.5.29.21
-        // see RFC 3280 http://www.ietf.org/rfc/rfc3280.txt
-        crlEntryExtensions.addExtension(new Extension.ReasonCode(1));
-        // crl entry
-        X509CRLEntryImpl crlEntry = new X509CRLEntryImpl(
-                new TBSCertList.RevokedCertificate(
-                        serialNumber,
-                        new Date(),
-                        crlEntryExtensions
-                    ),
-                issuer
-            );
-        assertNotNull(crlEntry.getExtensionValue("2.5.29.21"));
-        assertNull("Null value should be returned in the case of "
-                + "nonexisting extension",
-                // demand absent Invalidity Date extension
-                // which OID is 2.5.29.24 (RFC 3280)
-                crlEntry.getExtensionValue("2.5.29.24"));
-    }
-
-    public static Test suite() {
-        return new TestSuite(X509CRLEntryImplTest.class);
-    }
-
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(suite());
-    }
-}
-
+/*
+ *  Copyright 2006 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 Alexander Y. Kleymenov
+ * @version $Revision$
+ */
+
+package org.apache.harmony.security.tests.provider.cert;
+
+import java.math.BigInteger;
+import java.util.Date;
+import javax.security.auth.x500.X500Principal;
+
+import org.apache.harmony.security.provider.cert.X509CRLEntryImpl;
+import org.apache.harmony.security.x509.Extension;
+import org.apache.harmony.security.x509.Extensions;
+import org.apache.harmony.security.x509.TBSCertList;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * X509CRLEntryImplTest test
+ */
+public class X509CRLEntryImplTest extends TestCase {
+
+    /**
+     * getExtensionValue(String oid) method testing.
+     */
+    public void testGetExtensionValue() throws Exception {
+        // revoked certificate issuer
+        X500Principal issuer = 
+            new X500Principal("O=Certificate Issuer");
+        // revoked sertificate serial number
+        BigInteger serialNumber = BigInteger.valueOf(555);
+        // crl entry extensions
+        Extensions crlEntryExtensions = new Extensions();
+        // add reason code extension which OID is 2.5.29.21
+        // see RFC 3280 http://www.ietf.org/rfc/rfc3280.txt
+        crlEntryExtensions.addExtension(new Extension.ReasonCode(1));
+        // crl entry
+        X509CRLEntryImpl crlEntry = new X509CRLEntryImpl(
+                new TBSCertList.RevokedCertificate(
+                        serialNumber,
+                        new Date(),
+                        crlEntryExtensions
+                    ),
+                issuer
+            );
+        assertNotNull(crlEntry.getExtensionValue("2.5.29.21"));
+        assertNull("Null value should be returned in the case of "
+                + "nonexisting extension",
+                // demand absent Invalidity Date extension
+                // which OID is 2.5.29.24 (RFC 3280)
+                crlEntry.getExtensionValue("2.5.29.24"));
+    }
+
+    public static Test suite() {
+        return new TestSuite(X509CRLEntryImplTest.class);
+    }
+
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(suite());
+    }
+}
+

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/TestUtils.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/MyCRL.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/MyCertPath.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message