harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r487506 - in /harmony/enhanced/classlib/trunk/modules/security/src/test: api/java/org/apache/harmony/security/tests/java/security/ support/common/java/org/apache/harmony/security/tests/support/
Date Fri, 15 Dec 2006 10:01:32 GMT
Author: smishura
Date: Fri Dec 15 02:01:31 2006
New Revision: 487506

URL: http://svn.apache.org/viewvc?view=rev&rev=487506
Log:
Move MyAlgorithmParameters class from 'support' to unit test

Removed:
    harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyAlgorithmParameters.java
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=487506&r1=487505&r2=487506
==============================================================================
--- 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 02:01:31 2006
@@ -22,16 +22,16 @@
 
 package org.apache.harmony.security.tests.java.security;
 
+import java.io.IOException;
 import java.security.AlgorithmParameters;
 import java.security.AlgorithmParametersSpi;
 import java.security.Provider;
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
+import java.security.spec.InvalidParameterSpecException;
 
 import junit.framework.TestCase;
 
-import org.apache.harmony.security.tests.support.MyAlgorithmParameters;
-
 /**
  * Tests for <code>AlgorithmParameters</code> class constructors and
  * methods.
@@ -217,7 +217,7 @@
 	private class MyProvider extends Provider {
 		MyProvider() {
 			super("MyProvider", 1.0, "Provider for testing");
-			put("AlgorithmParameters.ABC", "org.apache.harmony.security.tests.support.MyAlgorithmParameters");
+            put("AlgorithmParameters.ABC", MyAlgorithmParameters.class.getName());
 		}
 		
 		MyProvider(String name, double version, String info) {
@@ -234,4 +234,56 @@
 			super(paramSpi, provider, algorithm);
 		}
 	}
+    
+    public static class MyAlgorithmParameters extends AlgorithmParametersSpi {
+
+        public static boolean runEngineInit1 = false;
+
+        public static boolean runEngineInit2 = false;
+
+        public static boolean runEngineInit3 = false;
+
+        public static boolean runEngineGetParameterSpec = false;
+
+        public static boolean runEngineGetEncoded1 = false;
+
+        public static boolean runEngineGetEncoded2 = false;
+
+        public static boolean runEngineToString = false;
+
+        protected void engineInit(AlgorithmParameterSpec paramSpec)
+                throws InvalidParameterSpecException {
+            runEngineInit1 = true;
+        }
+
+        protected void engineInit(byte[] params) throws IOException {
+            runEngineInit2 = true;
+        }
+
+        protected void engineInit(byte[] params, String format)
+                throws IOException {
+            runEngineInit3 = true;
+        }
+
+        protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
+                throws InvalidParameterSpecException {
+            runEngineGetParameterSpec = true;
+            return null;
+        }
+
+        protected byte[] engineGetEncoded() throws IOException {
+            runEngineGetEncoded1 = true;
+            return null;
+        }
+
+        protected byte[] engineGetEncoded(String format) throws IOException {
+            runEngineGetEncoded2 = true;
+            return null;
+        }
+
+        protected String engineToString() {
+            runEngineToString = true;
+            return "AlgorithmParameters";
+        }
+    }
 }



Mime
View raw message