harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r726245 - in /harmony/enhanced/classlib/trunk/modules/x-net: ./ src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/ src/test/support/common/java/org/apache/harmony/xnet/tests/support/
Date Sat, 13 Dec 2008 18:02:57 GMT
Author: ndbeyer
Date: Sat Dec 13 10:02:57 2008
New Revision: 726245

URL: http://svn.apache.org/viewvc?rev=726245&view=rev
Log:
rework tests to remove external dependency on security tests

Added:
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/SpiEngUtils.java
  (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/x-net/build.xml
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext1Test.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext2Test.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory1Test.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory2Test.java

Modified: harmony/enhanced/classlib/trunk/modules/x-net/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/build.xml?rev=726245&r1=726244&r2=726245&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/build.xml Sat Dec 13 10:02:57 2008
@@ -127,8 +127,6 @@
             <javac-elements>
                 <src>
                     <pathelement location="${hy.x-net.src.test}/support/common/java" />
-                    <!-- FIXME: X-NET tests should not reach into security module code
-->
-                    <pathelement location="${hy.x-net}/../security/src/test/support/common/java"/>
                 </src>
 
                 <include name="**/*.java" />

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java?rev=726245&r1=726244&r2=726245&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java
Sat Dec 13 10:02:57 2008
@@ -31,7 +31,7 @@
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.KeyManagerFactorySpi;
 
-import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.xnet.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MyKeyManagerFactorySpi;
 import junit.framework.TestCase;
 

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java?rev=726245&r1=726244&r2=726245&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java
Sat Dec 13 10:02:57 2008
@@ -29,7 +29,7 @@
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.ManagerFactoryParameters;
 
-import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.xnet.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MyKeyManagerFactorySpi;
 import junit.framework.TestCase;
 

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext1Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext1Test.java?rev=726245&r1=726244&r2=726245&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext1Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext1Test.java
Sat Dec 13 10:02:57 2008
@@ -37,7 +37,7 @@
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 
-import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.xnet.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MySSLContextSpi;
 import junit.framework.TestCase;
 

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext2Test.java?rev=726245&r1=726244&r2=726245&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext2Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext2Test.java
Sat Dec 13 10:02:57 2008
@@ -29,7 +29,7 @@
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.TrustManager;
 
-import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.xnet.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MySSLContextSpi;
 import junit.framework.TestCase;
 

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory1Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory1Test.java?rev=726245&r1=726244&r2=726245&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory1Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory1Test.java
Sat Dec 13 10:02:57 2008
@@ -30,7 +30,7 @@
 import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.TrustManagerFactorySpi;
 
-import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.xnet.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi;
 import junit.framework.TestCase;
 

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory2Test.java?rev=726245&r1=726244&r2=726245&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory2Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory2Test.java
Sat Dec 13 10:02:57 2008
@@ -28,7 +28,7 @@
 import javax.net.ssl.ManagerFactoryParameters;
 import javax.net.ssl.TrustManagerFactory;
 
-import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.xnet.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi;
 import junit.framework.TestCase;
 

Added: harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/SpiEngUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/SpiEngUtils.java?rev=726245&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/SpiEngUtils.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/SpiEngUtils.java
Sat Dec 13 10:02:57 2008
@@ -0,0 +1,69 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Vera Y. Petrashkova
+* @version $Revision$
+*/
+
+package org.apache.harmony.xnet.tests.support;
+
+import java.security.Provider;
+import java.security.Security;
+
+/**
+ * Additional class for verification spi-engine classes
+ * 
+ */
+
+public class SpiEngUtils {
+
+    public static final String[] invalidValues = {
+            "",
+            "BadAlgorithm",
+            "Long message Long message Long message Long message Long message Long message
Long message Long message Long message Long message Long message Long message Long message"
};
+
+    /**
+     * Verification: is algorithm supported or not
+     * 
+     * @param algorithm
+     * @param service
+     * @return
+     */
+    public static Provider isSupport(String algorithm, String service) {
+        try {
+            Provider[] provs = Security.getProviders(service.concat(".")
+                    .concat(algorithm));
+            if (provs == null) {
+                return null;
+            }
+            return (provs.length == 0 ? null : provs[0]);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    public class MyProvider extends Provider {
+
+        public MyProvider(String name, String info, String key, String clName) {
+            super(name, 1.0, info);
+            put(key, clName);
+        }
+
+    }
+
+}
\ No newline at end of file

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



Mime
View raw message