harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r426423 - in /incubator/harmony/enhanced/classlib/trunk/modules/x-net: ./ make/ src/main/java/javax/net/ssl/ src/test/api/ src/test/api/java/ src/test/api/java/org/ src/test/api/java/org/apache/ src/test/api/java/org/apache/harmony/ src/tes...
Date Fri, 28 Jul 2006 07:59:03 GMT
Author: mloenko
Date: Fri Jul 28 00:59:01 2006
New Revision: 426423

URL: http://svn.apache.org/viewvc?rev=426423&view=rev
Log:
applied patch for HARMONY-959 ([classlib][x-net] split impl vs. api tests)
for now it's just putting things in order, it will be easy to adapt the structure to what we agree about dirs/testNG/etc

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/CertPathTrustManagerParametersTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyStoreBuilderParametersTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyStoreBuilderParametersTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineResultTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineResultTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLExceptionTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLHandshakeExceptionTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLHandshakeExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLKeyExceptionTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLKeyExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPermissionTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLProtocolExceptionTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLProtocolExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLServerSocketTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLServerSocketTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSessionBindingEventTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSessionBindingEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSocketTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSocketTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/X509ExtendedKeyManagerTest.java
      - copied, changed from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/X509ExtendedKeyManagerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ServerSocketFactoryTest.java
      - copied unchanged from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ServerSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/SocketFactoryTest.java
      - copied unchanged from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/SocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/DefaultSSLServerSocketFactoryTest.java
      - copied unchanged from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/DefaultSSLServerSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/DefaultSSLSocketFactoryTest.java
      - copied unchanged from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/DefaultSSLSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/HttpsURLConnection_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/SSLServerSocketFactoryTest.java
      - copied unchanged from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLServerSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/SSLSocketFactoryTest.java
      - copied unchanged from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSocketFactoryTest.java
Removed:
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ServerSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/SocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/CertPathTrustManagerParametersTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/DefaultSSLServerSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/DefaultSSLSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyStoreBuilderParametersTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineResultTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLHandshakeExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLKeyExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLProtocolExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLServerSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLServerSocketTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSessionBindingEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSocketFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSocketTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/X509ExtendedKeyManagerTest.java
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/make/hyproperties.xml
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/build.xml?rev=426423&r1=426422&r2=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/build.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/build.xml Fri Jul 28 00:59:01 2006
@@ -76,84 +76,74 @@
     </target>
 
     <target name="compile.tests">
-        <echo message="Compiling X-NET tests" />
-
-        <mkdir dir="${hy.x-net.bin.test}" />
-
-        <javac 	destdir="${hy.x-net.bin.test}"
-            source="${hy.javac.source}"
-            target="${hy.javac.target}"
-            debug="${hy.javac.debug}">
 
+        <compile-tests description="test support files" destdir="../../build/tests">
+            <javac-elements>
+                <src>
             <!-- FIXME: X-NET tests should not reach into security module code -->
-            <src>
-                <pathelement location="${hy.x-net.src.test.java}"/>
-                <pathelement location="${hy.x-net}/../security/src/test/support/common/java"/>
-            </src>
-
-            <include name="javax/net/**/*Test*.java" />
-            <include name="org/apache/harmony/security/test/**/*" />
-
-            <bootclasspath>
-                <fileset dir="${hy.jdk}/jre/lib/boot">
-                    <include name="**/*.jar" />
-                </fileset>
-            </bootclasspath>
-            <classpath location="${hy.hdk}/build/test/support.jar" />
-        </javac>
-    </target>
-
-    <target name="run.tests">
-
-        <mkdir dir="${hy.tests.reports}" />
-
-        <property name="test.jre.home" value="${hy.jdk}/jre" />
+                    <pathelement location="${hy.x-net}/../security/src/test/support/common/java"/>
+                </src>
 
-        <junit fork="yes"
-            forkmode="once"
-            printsummary="withOutAndErr"
-            errorproperty="test.errors"
-            failureproperty="test.failures"
-            showoutput="on"
-            dir="${hy.x-net.bin.test}"
-            jvm="${test.jre.home}/bin/java">
-
-            <jvmarg value="-showversion"/>
-
-            <!-- Required for running the serialization unit tests -->
-            <!-- Note: will be deleted after improving             -->
-            <!-- SerializationTest support class: all resource     -->
-            <!-- files will be placed on the classpath             -->
-            <jvmarg value="-DRESOURCE_DIR=${hy.x-net.src.test.java}"/>
+                <include name="**/*.java" />
+            </javac-elements>
+        </compile-tests>
+        
+        <compile-tests description="api tests" destdir="${hy.x-net.bin.test}/api">
+            <javac-elements>
+                <src path="${hy.x-net.src.test}/api/java"/>
+                <include name="**/*Test.java" />
+            </javac-elements>
+        </compile-tests>
+
+        <compile-tests description="impl injected tests" destdir="${hy.x-net.bin.test}/impl.injected">
+            <javac-elements>
+                <src path="${hy.x-net.src.test}/impl/java.injected"/>
+                <include name="**/*Test.java" />
+            </javac-elements>
+        </compile-tests>
+    </target>
 
-            <!--  run tests via bootclasspath  --> 
-            <jvmarg value="-Xbootclasspath/a:${hy.x-net.bin.test}${path.separator}../../../../${junit.jar}${path.separator}../../../../build/tests${path.separator}${hy.hdk}/build/test/support.jar" /> 
+    <target name="run.tests" depends="run.tests.api, run.tests.impl" />
 
-    		<env key="JAVA_HOME" value="${test.jre.home}"/>
+    <target name="run.tests.api">
 
-            <!--classpath-->
-                <!--pathelement path="${hy.x-net.bin.test}"/-->
-            <!--/classpath-->
+        <run-tests description="api tests">
+            <junit-elements>
 
-            <formatter type="xml" />
+                <classpath>
+                    <pathelement path="${hy.x-net.bin.test}/api"/>
+                    <pathelement path="${hy.hdk}/build/test/support.jar" />
+                    <pathelement path="../../build/tests" />
+                </classpath>
+
+                <batchtest todir="${hy.tests.reports}" haltonfailure="no" unless="test.case">
+                    <fileset dir="${hy.x-net.src.test}/api/java">
+                        <include name="**/*Test.java"/>
+                    </fileset>
+                </batchtest>
 
-            <test name="${test.case}" todir="${hy.tests.reports}"
-                 if="test.case" />
+            </junit-elements>
+        </run-tests>
 
-            <batchtest todir="${hy.tests.reports}" haltonfailure="no"
-                unless="test.case">
+        <antcall target="touch-failures-file" />
+        <antcall target="touch-errors-file" />
+    </target>
 
-                <fileset dir="${hy.x-net.src.test.java}">
-                    <include name="**/*Test.java"/>
+    <target name="run.tests.impl" unless="test.noimpl">
+        <run-tests description="impl injected tests">
+            <junit-elements>
+                <!-- to pick up junit.jar               -->
+                <jvmarg value="-Xbootclasspath/a:${hy.x-net.bin.test}/impl.injected${path.separator}../../../../${junit.jar}${path.separator}../../../../build/tests"/>
+
+                <batchtest todir="${hy.tests.reports}" haltonfailure="no" unless="test.case">
+                    <fileset dir="${hy.x-net.src.test}/impl/java.injected">
+                        <include name="**/*Test.java"/>
+                    </fileset>
+                </batchtest>
 
-                    <!-- Harmony exclude list -->
-                    <!-- FIXME: The following tests require JSSE provider -->
-                    <exclude name="javax/net/ssl/serialization/HandshakeCompletedEventTest.java"/>
-                    <exclude name="javax/net/ssl/serialization/SSLSessionBindingEventTest.java"/>
+            </junit-elements>
+        </run-tests>
 
-                </fileset>
-            </batchtest>
-        </junit>
         <antcall target="touch-failures-file" />
         <antcall target="touch-errors-file" />
     </target>
@@ -167,5 +157,69 @@
         <echo file="${hy.tests.reports}/test.errors"
             append="true">x-net${line.separator}</echo>
     </target>
+    
+    <macrodef name="compile-tests">
+        <attribute name="description" default="" />
+        <attribute name="destdir"  />
+        <element name="javac-elements" />
+        <sequential>
+            <echo message="Compiling X-NET @{description}" />
+            
+            <mkdir dir="@{destdir}" />
+            
+            <javac destdir="@{destdir}"
+                   source="${hy.javac.source}"
+                   target="${hy.javac.target}"
+                   debug="${hy.javac.debug}">
+
+                <javac-elements />
+
+                <bootclasspath>
+                    <fileset dir="${hy.jdk}/jre/lib/boot">
+                        <include name="**/*.jar" />
+                    </fileset>
+                </bootclasspath>
+                <classpath location="../../build/tests" />
+                <classpath location="${hy.hdk}/build/test/support.jar" />
+            </javac>
+        </sequential>
+    </macrodef>
+    
+    <macrodef name="run-tests">
+        <attribute name="description" default="" />
+        <element name="junit-elements" />
+        <sequential>
+            <echo message="Running X-NET @{description}" />
+
+            <mkdir dir="${hy.tests.reports}" />
+
+            <property name="test.jre.home" value="${hy.jdk}/jre" />
+
+            <junit fork="yes"
+                   forkmode="once"
+                   printsummary="withOutAndErr"
+                   errorproperty="test.errors"
+                   failureproperty="test.failures"
+                   showoutput="on"
+                   dir="${hy.x-net.bin.test}"
+                   jvm="${test.jre.home}/bin/java">
+
+                <jvmarg value="-showversion"/>
+
+                <env key="JAVA_HOME" value="${test.jre.home}"/>
+                <junit-elements />
+
+                <classpath>
+                    <pathelement path="${hy.x-net.src.test.resources}"/>
+                    <pathelement path="../../build/tests" />
+                </classpath>
+
+                <formatter type="xml" />
+
+                <test name="${test.case}" todir="${hy.tests.reports}" if="test.c
+ase" />
+            </junit>
+        </sequential>
+    </macrodef>
 
 </project>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/make/hyproperties.xml?rev=426423&r1=426422&r2=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/make/hyproperties.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/make/hyproperties.xml Fri Jul 28 00:59:01 2006
@@ -22,8 +22,7 @@
             <java location="src/main/java" />
         	<resources location="src/main/resources" />
          </main>
-         <test>
-            <java location="src/test/java" />
+         <test location="src/test">
             <resources location="src/test/resources" />
          </test>
          <natives location="src/natives" />

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java?rev=426423&r1=426422&r2=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java Fri Jul 28 00:59:01 2006
@@ -14,11 +14,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
 package javax.net.ssl;
 
 import java.util.ArrayList;
@@ -28,30 +23,29 @@
 
 /**
  * @com.intel.drl.spec_ref
- * 
+ *  
  */
 public class KeyStoreBuilderParameters implements ManagerFactoryParameters {
-    
+
     private List ksbuilders;
+
     public KeyStoreBuilderParameters(KeyStore.Builder builder) {
-    	if (builder == null) {
-    		throw new NullPointerException("builder parameter is null");
-    	}
-        //      FIXME for 1.5 classes
-        //      new ArrayList() -> Collections.emptyList();
         ksbuilders = new ArrayList();
-        ksbuilders.add(builder);         
+        if (builder != null) {
+            ksbuilders.add(builder);
+        }
     }
+
     public KeyStoreBuilderParameters(List parameters) {
-    	if (parameters == null) {
-    		throw new NullPointerException("Builders list is null");
-    	}
-    	if (parameters.isEmpty()) {
-    		throw new IllegalArgumentException("Builders list is empty");
-    	}
+        if (parameters == null) {
+            throw new NullPointerException("Builders list is null");
+        }
+        if (parameters.isEmpty()) {
+            throw new IllegalArgumentException("Builders list is empty");
+        }
         ksbuilders = new ArrayList(parameters);
     }
-    
+
     public List getParameters() {
         return Collections.unmodifiableList(ksbuilders);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java?rev=426423&r1=426422&r2=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java Fri Jul 28 00:59:01 2006
@@ -218,49 +218,55 @@
             int length, ByteBuffer dst) throws SSLException;
 
     /**
-     * @com.intel.drl.spec_ref
+     * implementation behavior follows RI:
+     * jdk 1.5 does not throw IllegalArgumentException when parameters are null
+     * and does not throw ReadOnlyBufferException if dst is read only byte buffer
      *  
      */
     public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst)
             throws SSLException {
-        if (src == null) {
-            throw new IllegalArgumentException("Byte buffer src is null");
-        }
-        if (dst == null) {
-            throw new IllegalArgumentException("Byte buffer dst is null");
-        }
-        if (dst.isReadOnly()) {
-            throw new ReadOnlyBufferException();
-        }
+//        if (src == null) {
+//            throw new IllegalArgumentException("Byte buffer src is null");
+//        }
+//        if (dst == null) {
+//            throw new IllegalArgumentException("Byte buffer dst is null");
+//        }
+//        if (dst.isReadOnly()) {
+//            throw new ReadOnlyBufferException();
+//        }
         return unwrap(src, new ByteBuffer[] { dst }, 0, 1);
     }
 
     /**
-     * @com.intel.drl.spec_ref
-     *  
+     * implementation behavior follows RI:
+     * jdk 1.5 does not throw IllegalArgumentException when src is null or if
+     * dsts contains null elements
+     * It does not throw ReadOnlyBufferException when dsts contains read only elements
      */
     public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts)
             throws SSLException {
-        if (src == null) {
-            throw new IllegalArgumentException("Byte buffer src is null");
-        }
+//        if (src == null) {
+//            throw new IllegalArgumentException("Byte buffer src is null");
+//        }
         if (dsts == null) {
             throw new IllegalArgumentException("Byte buffer array dsts is null");
         }
-        for (int i = 0; i < dsts.length; i++) {
-            if (dsts[i] == null) {
-                throw new IllegalArgumentException("Byte buffer dsts[" + i
-                        + "]  is null");
-            }
-            if (dsts[i].isReadOnly()) {
-                throw new ReadOnlyBufferException();
-            }
-        }
+//        for (int i = 0; i < dsts.length; i++) {
+//            if (dsts[i] == null) {
+//                throw new IllegalArgumentException("Byte buffer dsts[" + i
+//                        + "]  is null");
+//            }
+//            if (dsts[i].isReadOnly()) {
+//                throw new ReadOnlyBufferException();
+//            }
+//        }
         return unwrap(src, dsts, 0, dsts.length);
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * implementation behavior follows RI: jdk 1.5 does not throw
+     * IllegalArgumentException when dst is null or if srcs contains null
+     * elements It does not throw ReadOnlyBufferException for read only dst
      *  
      */
     public SSLEngineResult wrap(ByteBuffer[] srcs, ByteBuffer dst)
@@ -268,36 +274,38 @@
         if (srcs == null) {
             throw new IllegalArgumentException("Byte buffer array srcs is null");
         }
-        for (int i = 0; i < srcs.length; i++) {
-            if (srcs[i] == null) {
-                throw new IllegalArgumentException("Byte buffer srcs[" + i
-                        + "]  is null");
-            }
-        }
-        if (dst == null) {
-            throw new IllegalArgumentException("Byte buffer array dst is null");
-        }
-        if (dst.isReadOnly()) {
-            throw new ReadOnlyBufferException();
-        }
+//        for (int i = 0; i < srcs.length; i++) {
+//            if (srcs[i] == null) {
+//                throw new IllegalArgumentException("Byte buffer srcs[" + i
+//                        + "]  is null");
+//            }
+//        }
+//        if (dst == null) {
+//            throw new IllegalArgumentException("Byte buffer array dst is null");
+//        }
+//        if (dst.isReadOnly()) {
+//            throw new ReadOnlyBufferException();
+//        }
         return wrap(srcs, 0, srcs.length, dst);
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * implementation behavior follows RI:
+     * jdk 1.5 does not throw IllegalArgumentException when parameters are null
+     * and does not throw ReadOnlyBufferException if dst is read only byte buffer
      *  
      */
     public SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst)
             throws SSLException {
-        if (src == null) {
-            throw new IllegalArgumentException("Byte buffer src is null");
-        }
-        if (dst == null) {
-            throw new IllegalArgumentException("Byte buffer dst is null");
-        }
-        if (dst.isReadOnly()) {
-            throw new ReadOnlyBufferException();
-        }
+//        if (src == null) {
+//            throw new IllegalArgumentException("Byte buffer src is null");
+//        }
+//        if (dst == null) {
+//            throw new IllegalArgumentException("Byte buffer dst is null");
+//        }
+//        if (dst.isReadOnly()) {
+//            throw new ReadOnlyBufferException();
+//        }
         return wrap(new ByteBuffer[] { src }, 0, 1, dst);
     }
 }

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/CertPathTrustManagerParametersTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/CertPathTrustManagerParametersTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/CertPathTrustManagerParametersTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java Fri Jul 28 00:59:01 2006
@@ -14,16 +14,12 @@
  *  limitations under the License.
  */
 
-/**
- * @author Boris V. Kuznetsov
- * @version $Revision$
- */
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import java.security.cert.CertPathParameters;
+import javax.net.ssl.CertPathTrustManagerParameters;
 
 import junit.framework.TestCase;
-
 
 /**
  * Tests for <code>CertPathTrustManagerParameters</code> class constructors

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HandshakeCompletedEventTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java Fri Jul 28 00:59:01 2006
@@ -14,16 +14,17 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.security.cert.Certificate;
+
+import javax.net.ssl.HandshakeCompletedEvent;
+import javax.net.ssl.SSLPeerUnverifiedException;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
 
 import junit.framework.TestCase;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/HttpsURLConnectionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java Fri Jul 28 00:59:01 2006
@@ -14,16 +14,17 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
 
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import java.io.IOException;
-import java.security.cert.Certificate;
 import java.net.URL;
+import java.security.cert.Certificate;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLPeerUnverifiedException;
+import javax.net.ssl.SSLSocketFactory;
 
 import junit.framework.TestCase;
 
@@ -34,8 +35,9 @@
  */
 public class HttpsURLConnectionTest extends TestCase {
 
-    public final void testGetPeerPrincipal() {
-        HttpsURLConnection con = new MyHttpsURLConnection(null);
+    public final void testGetPeerPrincipal() throws Exception {
+        HttpsURLConnection con = new MyHttpsURLConnection(new URL(
+                "http://foo.com"));
         try {
             con.getPeerPrincipal();
             fail("No expected SSLPeerUnverifiedException");
@@ -47,27 +49,6 @@
         HttpsURLConnection con = new MyHttpsURLConnection(null);
         if (con.getLocalPrincipal() != null) {
             fail("Non null result");
-        }
-    }
-
-    public final void testGetDefaultHostnameVerifier() {
-        HostnameVerifier ver = HttpsURLConnection.getDefaultHostnameVerifier();
-        if (!(ver instanceof DefaultHostnameVerifier)) {
-            fail("Incorrect instance");
-        }
-        if (ver.verify("localhost", null)) {
-            fail("connection should not be permitted");
-        }
-    }
-
-    public final void testGetHostnameVerifier() {
-        HttpsURLConnection con = new MyHttpsURLConnection(null);
-        HostnameVerifier ver = con.getHostnameVerifier();
-        if (!(ver instanceof DefaultHostnameVerifier)) {
-            fail("Incorrect instance");
-        }
-        if (ver.verify("localhost", null)) {
-            fail("connection should not be permitted");
         }
     }
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyStoreBuilderParametersTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyStoreBuilderParametersTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyStoreBuilderParametersTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyStoreBuilderParametersTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyStoreBuilderParametersTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/KeyStoreBuilderParametersTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyStoreBuilderParametersTest.java Fri Jul 28 00:59:01 2006
@@ -14,17 +14,14 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.net.ssl.KeyStoreBuilderParameters;
 
 import junit.framework.TestCase;
 
@@ -40,11 +37,8 @@
      * Class under test for void KeyStoreBuilderParameters(KeyStore.Builder)
      */
     public final void testKeyStoreBuilderParametersBuilder() {
-        try {
-            new KeyStoreBuilderParameters((KeyStore.Builder) null);
-            fail("No expected NullPointerException");
-        } catch (NullPointerException e) {
-        }
+        // should not throw NullPointerException
+        new KeyStoreBuilderParameters((KeyStore.Builder) null);
     }
 
     /*

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineResultTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineResultTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineResultTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineResultTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineResultTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineResultTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineResultTest.java Fri Jul 28 00:59:01 2006
@@ -14,33 +14,18 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
-package javax.net.ssl;
+import javax.net.ssl.SSLEngineResult;
 
 import junit.framework.TestCase;
 
 /**
- * Template tests for SSLEngineResult class
- * FIXME: uncommente these tests  
+ * Tests for SSLEngineResult class
  * 
  */
 public class SSLEngineResultTest extends TestCase {
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(SSLEngineResultTest.class);
-    }
-    
-    /**
-     * Constructor for SSLEngineResult.
-     * @param arg0
-     */
-    public SSLEngineResultTest(String arg0) {
-        super(arg0);
-    }
     /**
      * Test for <code>SSLEngineResult(SSLEngineResult.Status status,
      *              SSLEngineResult.HandshakeStatus handshakeStatus,
@@ -57,10 +42,9 @@
      * or bytesProduced is negative or when status or handshakeStatus
      * is null  
      *
-     * FIXME: this test should be added for 1.5 release
      */
     public void testSSLEngineResultConstructor() {
-/*    
+    
         int[] neg = { -1, -10, -1000, Integer.MIN_VALUE,
                 (Integer.MIN_VALUE + 1) };
         int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) };
@@ -118,13 +102,12 @@
                 }
             }
         }
-*/        
+        
     }
     /**
      * Test for <code>SSLEngineResult.Status.values()</code> method
-     * FIXME: this test should be added for 1.5 release
      */
-/*
+
     public void testStatus01() {
         SSLEngineResult.Status [] enS = SSLEngineResult.Status.values();
         assertTrue("Incorrect array of Status objects", enS.length > 0);
@@ -137,15 +120,14 @@
         assertTrue("BUFFER_UNDERFLOW object does not define", findEl(enS,
                 SSLEngineResult.Status.BUFFER_UNDERFLOW));
     }
-*/    
+    
     /**
      * Test for <code>SSLEngineResult.Status.valueOf(String name)</code> method
      * Assertion: 
      * throws IllegalArgumentException when there is no constan with specified
      * name 
-     * FIXME: this test should be added for 1.5 release
      */
-/*
+
     public void testStatus02() {
         String [] invalid = {"", "OK1", "BUFFER_overflow", "BUFFER_UND",
                 "CLOSED_CLOSED", "Bad string for verification valueOf method"
@@ -166,12 +148,11 @@
             }
         }                 
     }
-*/    
+    
     /**
      * Test for <code>SSLEngineResult.HandshakeStatus.values()</code> method
-     * FIXME: this test should be added for 1.5 release
      */
-/*
+
     public void testHandshakeStatus01() {
         SSLEngineResult.HandshakeStatus [] enHS = SSLEngineResult.HandshakeStatus
                 .values();
@@ -188,15 +169,14 @@
         assertTrue("NOT_HANDSHAKING object does not define", findEl(enHS,
                 SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING));
     }
-*/    
+    
     /**
      * Test for <code>SSLEngineResult.HandshakeStatus.valueOf(String name)</code> method
      * Assertion: 
      * throws IllegalArgumentException when there is no constan with specified
      * name 
-     * FIXME: this test should be added for 1.5 release
      */
-/*
+
     public void testHandshakeStatus02() {
         String [] invalid = {"", "FINISHED1", "NEED_task", "NEED_UN",
                 "NEED_WRAP_WRAP", "not_HANDSHAKING", "Bad string for verification valueOf method"
@@ -230,5 +210,5 @@
         }
         return ok;
     }
-*/
+
 }

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLEngineTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineTest.java Fri Jul 28 00:59:01 2006
@@ -14,16 +14,17 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import java.nio.ByteBuffer;
 import java.nio.ReadOnlyBufferException;
 
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLEngineResult.HandshakeStatus;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLEngineResult;
+
 import junit.framework.TestCase;
 
 /**
@@ -86,7 +87,7 @@
      * throws IllegalArgumentException when src or dst is null 
      * throws ReadOnlyBufferException when dst is ReadOnly byte buffer
      * 
-     * TODO:
+     * Check that implementation behavior follows RI:
      * jdk 1.5 does not throw IllegalArgumentException when parameters are null
      * and does not throw ReadOnlyBufferException if dst is read only byte buffer
      */
@@ -96,37 +97,27 @@
         ByteBuffer bbN = null;
         ByteBuffer bb = ByteBuffer.allocate(10);
         SSLEngine e = new mySSLEngine(host, port);
-        try {
-            e.wrap(bbN, bb);
-            fail("IllegalArgumentException must be thrown for null src byte buffer");
-        } catch (IllegalArgumentException ex) {
-        }
-        try {
-            e.wrap(bb, bbN);
-            fail("IllegalArgumentException must be thrown for null dst byte buffer");
-        } catch (IllegalArgumentException ex) {
-        }
+
+        e.wrap(bbN, bb);
+        e.wrap(bb, bbN);
+
         ByteBuffer roBb = bb.asReadOnlyBuffer();
         assertTrue("Not read only byte buffer", roBb.isReadOnly());
-        try {
-            e.wrap(bb, roBb);
-            fail("ReadOnlyBufferException must be thrown for read only dst");
-        } catch (ReadOnlyBufferException ex) {
-        }
+        e.wrap(bb, roBb);
+
     }
 
     /**
      * Test for <code>wrap(ByteBuffer[] srcs, ByteBuffer dst)</code> method
      * 
-     * Assertions: 
-     * throws IllegalArgumentException when srcs or dst is null or
-     * srcs contains null byte buffer;
-     * throws ReadOnlyBufferException when dst is read only byte buffer
+     * Assertions: throws IllegalArgumentException when srcs or dst is null or
+     * srcs contains null byte buffer; throws ReadOnlyBufferException when dst
+     * is read only byte buffer
      * 
-     * TODO: 
+     * Check that implementation behavior follows RI:
      * jdk 1.5 does not throw IllegalArgumentException when dst is null or
-     * if srcs contains null elements
-     * It does not throw  ReadOnlyBufferException for read only dst
+     * if srcs contains null elements It does not throw ReadOnlyBufferException
+     * for read only dst
      */
     public void testWrap02() throws SSLException {
         String host = "new host";
@@ -142,27 +133,17 @@
             fail("IllegalArgumentException must be thrown for null srcs byte buffer array");
         } catch (IllegalArgumentException ex) {
         }
-        try {
-            e.wrap(bbA, bb);
-            fail("IllegalArgumentException must be thrown for srcs byte buffer array"
-                    + " which contains null elements");
-        } catch (IllegalArgumentException ex) {
-        }
 
-        try {
-            e.wrap(bbA, bbN);
-            fail("IllegalArgumentException must be thrown for null dst byte buffer");
-        } catch (IllegalArgumentException ex) {
-        }
+        e.wrap(bbA, bb);
+        e.wrap(bbA, bbN);
+
         ByteBuffer roBb = bb.asReadOnlyBuffer();
         bbA[0] = ByteBuffer.allocate(100);
         bbA[2] = ByteBuffer.allocate(20);
         assertTrue("Not read only byte buffer", roBb.isReadOnly());
-        try {
-            e.wrap(bbA, roBb);
-            fail("ReadOnlyBufferException must be thrown for read only dst");
-         } catch (ReadOnlyBufferException ex) {
-         }
+
+        e.wrap(bbA, roBb);
+
     }
 
     /**
@@ -239,7 +220,7 @@
      * throws IllegalArgumentException when src or dst is null
      * throws ReadOnlyBufferException when dst is read only byte buffer
      * 
-     * TODO:
+     * Check that implementation behavior follows RI:
      * jdk 1.5 does not throw IllegalArgumentException when parameters are null
      * and does not throw ReadOnlyBufferException if dst is read only byte buffer
      */
@@ -249,37 +230,27 @@
         ByteBuffer bbN = null;
         ByteBuffer bb = ByteBuffer.allocate(10);
         SSLEngine e = new mySSLEngine(host, port);
-        try {
-            e.unwrap(bbN, bb);
-            fail("IllegalArgumentException must be thrown for null src byte buffer");
-        } catch (IllegalArgumentException ex) {
-        }
-        try {
-            e.unwrap(bb, bbN);
-            fail("IllegalArgumentException must be thrown for null dst byte buffer");
-        } catch (IllegalArgumentException ex) {
-        }
+
+        e.unwrap(bbN, bb);
+        e.unwrap(bb, bbN);
+
         ByteBuffer roBb = bb.asReadOnlyBuffer();
         assertTrue("Not read only byte buffer", roBb.isReadOnly());
-        try {
-            e.unwrap(bb, roBb);
-            fail("ReadOnlyBufferException must be thrown for read only dst");
-        } catch (ReadOnlyBufferException ex) {
-        }
+
+        e.unwrap(bb, roBb);
     }
 
     /**
      * Test for <code>unwrap(ByteBuffer src, ByteBuffer[] dsts)</code> method
      * 
-     * Assertions: 
-     * throws IllegalArgumentException if parameters are null or when dsts 
-     * contains null elements
-     * throws ReadOnlyBufferException when dsts contains read only elements
+     * Assertions: throws IllegalArgumentException if parameters are null or
+     * when dsts contains null elements throws ReadOnlyBufferException when dsts
+     * contains read only elements
      * 
-     * TODO:
-     * jdk 1.5 does not throw IllegalArgumentException when src is null or if
-     * dsts contains null elements
-     * It does not throw ReadOnlyBufferException when dsts contains read only elements
+     * Check that implementation behavior follows RI:
+     * jdk 1.5 does not throw IllegalArgumentException when src is null or
+     * if dsts contains null elements It does not throw ReadOnlyBufferException
+     * when dsts contains read only elements
      */
     public void testUnwrap02() throws SSLException {
         String host = "new host";
@@ -295,29 +266,18 @@
             fail("IllegalArgumentException must be thrown for null dsts byte buffer array");
         } catch (IllegalArgumentException ex) {
         }
-        try {
-            e.unwrap(bb, bbA);
-            fail("IllegalArgumentException must be thrown for dsts byte buffer array"
-                    + " which contains null elements");
-        } catch (IllegalArgumentException ex) {
-        }
 
-        try {
-            e.unwrap(bbN, bbA);
-            fail("IllegalArgumentException must be thrown for null src byte buffer");
-        } catch (IllegalArgumentException ex) {
-        }
+        e.unwrap(bb, bbA);
+        e.unwrap(bbN, bbA);
 
         ByteBuffer bb1 = ByteBuffer.allocate(100);
         ByteBuffer roBb = bb1.asReadOnlyBuffer();
         bbA[0] = bb1;
         bbA[2] = roBb;
         assertTrue("Not read only byte buffer", bbA[2].isReadOnly());
-        try {
-            e.unwrap(bb, bbA);
-            fail("ReadOnlyBufferException must be thrown because dsts contains read only buffer");
-        } catch (ReadOnlyBufferException ex) {
-        }
+
+        e.unwrap(bb, bbA);
+
     }
 
     /**

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLExceptionTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLExceptionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLExceptionTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLExceptionTest.java Fri Jul 28 00:59:01 2006
@@ -14,12 +14,7 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import javax.net.ssl.SSLException;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLHandshakeExceptionTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLHandshakeExceptionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLHandshakeExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLHandshakeExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLHandshakeExceptionTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLHandshakeExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLHandshakeExceptionTest.java Fri Jul 28 00:59:01 2006
@@ -14,12 +14,7 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import javax.net.ssl.SSLHandshakeException;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLKeyExceptionTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLKeyExceptionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLKeyExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLKeyExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLKeyExceptionTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLKeyExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLKeyExceptionTest.java Fri Jul 28 00:59:01 2006
@@ -14,12 +14,7 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import javax.net.ssl.SSLKeyException;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java Fri Jul 28 00:59:01 2006
@@ -14,12 +14,7 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import javax.net.ssl.SSLPeerUnverifiedException;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPermissionTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPermissionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPermissionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPermissionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPermissionTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLPermissionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPermissionTest.java Fri Jul 28 00:59:01 2006
@@ -14,11 +14,9 @@
  *  limitations under the License.
  */
 
-/**
- * @author Boris V. Kuznetsov
- * @version $Revision$
- */
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
+
+import javax.net.ssl.SSLPermission;
 
 import junit.framework.TestCase;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLProtocolExceptionTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLProtocolExceptionTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLProtocolExceptionTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLProtocolExceptionTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLProtocolExceptionTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLProtocolExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLProtocolExceptionTest.java Fri Jul 28 00:59:01 2006
@@ -14,12 +14,7 @@
  *  limitations under the License.
  */
 
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import javax.net.ssl.SSLProtocolException;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLServerSocketTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLServerSocketTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLServerSocketTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLServerSocketTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLServerSocketTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLServerSocketTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLServerSocketTest.java Fri Jul 28 00:59:01 2006
@@ -14,14 +14,12 @@
  *  limitations under the License.
  */
 
-/**
- * @author Boris V. Kuznetsov
- * @version $Revision$
- */
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import java.io.IOException;
 import java.net.InetAddress;
+
+import javax.net.ssl.SSLServerSocket;
 
 import junit.framework.TestCase;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSessionBindingEventTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSessionBindingEventTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSessionBindingEventTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSessionBindingEventTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSessionBindingEventTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSessionBindingEventTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSessionBindingEventTest.java Fri Jul 28 00:59:01 2006
@@ -14,16 +14,15 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import java.security.Principal;
 import java.security.cert.Certificate;
 
+import javax.net.ssl.SSLPeerUnverifiedException;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSessionContext;
+import javax.net.ssl.SSLSessionBindingEvent;
 import javax.security.cert.X509Certificate;
 
 import junit.framework.TestCase;

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSocketTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSocketTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSocketTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSocketTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSocketTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/SSLSocketTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSocketTest.java Fri Jul 28 00:59:01 2006
@@ -14,16 +14,16 @@
  *  limitations under the License.
  */
 
-/**
- * @author Boris V. Kuznetsov
- * @version $Revision$
- */
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.UnknownHostException;
+
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.HandshakeCompletedListener;
 
 import junit.framework.TestCase;
 

Copied: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/X509ExtendedKeyManagerTest.java (from r426381, incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/X509ExtendedKeyManagerTest.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/X509ExtendedKeyManagerTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/X509ExtendedKeyManagerTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/X509ExtendedKeyManagerTest.java&r1=426381&r2=426423&rev=426423&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/X509ExtendedKeyManagerTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/X509ExtendedKeyManagerTest.java Fri Jul 28 00:59:01 2006
@@ -14,12 +14,7 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package javax.net.ssl;
+package org.apache.harmony.xnet.tests.javax.net.ssl;
 
 import java.net.Socket;
 import java.security.Principal;

Added: incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/HttpsURLConnection_ImplTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/HttpsURLConnection_ImplTest.java?rev=426423&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/HttpsURLConnection_ImplTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/HttpsURLConnection_ImplTest.java Fri Jul 28 00:59:01 2006
@@ -0,0 +1,101 @@
+/*
+ *  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.
+ */
+
+package javax.net.ssl;
+
+import java.io.IOException;
+import java.net.URL;
+import java.security.cert.Certificate;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>HttpsURLConnection</code> class constructors and methods.
+ * 
+ */
+public class HttpsURLConnection_ImplTest extends TestCase {
+
+    public final void testGetDefaultHostnameVerifier() {
+        
+        HostnameVerifier ver = HttpsURLConnection.getDefaultHostnameVerifier();
+        if (!(ver instanceof DefaultHostnameVerifier)) {
+            fail("Incorrect instance");
+        }
+        if (ver.verify("localhost", null)) {
+            fail("connection should not be permitted");
+        }
+    }
+
+    public final void testGetHostnameVerifier() {
+        
+        HttpsURLConnection con = new MyHttpsURLConnection(null);
+        HostnameVerifier ver = con.getHostnameVerifier();
+        if (!(ver instanceof DefaultHostnameVerifier)) {
+            fail("Incorrect instance");
+        }
+        if (ver.verify("localhost", null)) {
+            fail("connection should not be permitted");
+        }
+    }
+}
+
+class MyHttpsURLConnection extends HttpsURLConnection {
+
+    public MyHttpsURLConnection(URL url) {
+        super(url);
+    }
+
+    /*
+     * @see javax.net.ssl.HttpsURLConnection#getCipherSuite()
+     */
+    public String getCipherSuite() {
+        return null;
+    }
+
+    /*
+     * @see javax.net.ssl.HttpsURLConnection#getLocalCertificates()
+     */
+    public Certificate[] getLocalCertificates() {
+        return null;
+    }
+
+    /*
+     * @see javax.net.ssl.HttpsURLConnection#getServerCertificates()
+     */
+    public Certificate[] getServerCertificates()
+            throws SSLPeerUnverifiedException {
+        return null;
+    }
+
+    /*
+     * @see java.net.HttpURLConnection#disconnect()
+     */
+    public void disconnect() {
+    }
+
+    /*
+     * @see java.net.HttpURLConnection#usingProxy()
+     */
+    public boolean usingProxy() {
+        return false;
+    }
+
+    /*
+     * @see java.net.URLConnection#connect()
+     */
+    public void connect() throws IOException {
+    }
+}



Mime
View raw message