harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r487518 - /harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
Date Fri, 15 Dec 2006 11:24:54 GMT
Author: smishura
Date: Fri Dec 15 03:24:50 2006
New Revision: 487518

URL: http://svn.apache.org/viewvc?view=rev&rev=487518
Log:
Evaluation for HARMONY-2680:
[classlib][security]AlgorithmParameters.getEncoded(null) throws NullPointerException on Harmony
but not on RI

Added test for AlgorithmParameters.getEncoded(null).
It verifies that null value is passed to spi-provider

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java?view=diff&rev=487518&r1=487517&r2=487518
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
Fri Dec 15 03:24:50 2006
@@ -144,6 +144,20 @@
         //
         params.init(new MyAlgorithmParameterSpec());
         assertSame(enc, params.getEncoded(strFormatParam));
+        
+        //
+        // test: if format param is null
+        //
+        paramSpi = new MyAlgorithmParameters() {
+            protected byte[] engineGetEncoded(String format) throws IOException {
+                assertNull(format); // null is passed to spi-provider
+                return enc;
+            }
+        };
+
+        params = new DummyAlgorithmParameters(paramSpi, p, "algorithm");
+        params.init(new MyAlgorithmParameterSpec());
+        assertSame(enc, params.getEncoded(null));
     }
 
 	/**



Mime
View raw message