harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r490444 - in /harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security: AlgorithmParameters2Test.java AlgorithmParametersTest.java
Date Wed, 27 Dec 2006 06:24:59 GMT
Author: smishura
Date: Tue Dec 26 22:24:59 2006
New Revision: 490444

URL: http://svn.apache.org/viewvc?view=rev&rev=490444
Log:
Refactor test_toString()

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParameters2Test.java
    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/AlgorithmParameters2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParameters2Test.java?view=diff&rev=490444&r1=490443&r2=490444
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParameters2Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParameters2Test.java
Tue Dec 26 22:24:59 2006
@@ -106,15 +106,4 @@
         params.init(new DSAParameterSpec(BigInteger.ONE, BigInteger.ONE,
                 BigInteger.ONE));
 	}
-
-	/**
-	 * @tests java.security.AlgorithmParameters#toString()
-	 */
-	public void test_toString() throws Exception {
-		// Test for method java.lang.String
-		// java.security.AlgorithmParameters.toString()
-        String str = AlgorithmParameters.getInstance("DSA").toString();
-        assertNull("toString should be null", str);
-
-	}
 }

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=490444&r1=490443&r2=490444
==============================================================================
--- 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
Tue Dec 26 22:24:59 2006
@@ -489,6 +489,29 @@
         assertTrue(paramSpi.runEngineInitB$String);
     }
 
+    /**
+     * @tests java.security.AlgorithmParameters#toString()
+     */
+    public void test_toString() throws Exception {
+
+        final String str = "AlgorithmParameters";
+
+        MyAlgorithmParameters paramSpi = new MyAlgorithmParameters() {
+            protected String engineToString() {
+                return str;
+            }
+        };
+
+        AlgorithmParameters params = new DummyAlgorithmParameters(paramSpi, p,
+                "algorithm");
+
+        assertNull("unititialized", params.toString());
+
+        params.init(new byte[0]);
+
+        assertSame(str, params.toString());
+    }
+
 	private void checkUnititialized(AlgorithmParameters ap) {
         assertNull("Unititialized: toString() failed", ap.toString());
 	}



Mime
View raw message