JBoss Remoting SVN: r3675 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-20 11:50:09 -0400 (Thu, 20 Mar 2008)
New Revision: 3675
Modified:
remoting2/branches/2.x/test.policy
Log:
JBREM-920 - one more property
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-20 15:41:51 UTC (rev 3674)
+++ remoting2/branches/2.x/test.policy 2008-03-20 15:50:09 UTC (rev 3675)
@@ -21,6 +21,7 @@
permission java.util.PropertyPermission "jboss.bind.address", "read";
permission java.util.PropertyPermission "remoting.bind_by_host", "read";
permission java.util.PropertyPermission "javax.net.ssl.trustStoreType", "read";
+ permission java.util.PropertyPermission "javax.net.ssl.trustStorePassword", "read";
// Permission to read the test keystore
permission java.io.FilePermission "${build.home}/output/tests/classes/-", "read";
18 years, 1 month
JBoss Remoting SVN: r3674 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-20 11:41:51 -0400 (Thu, 20 Mar 2008)
New Revision: 3674
Modified:
remoting2/branches/2.x/build.xml
remoting2/branches/2.x/test.policy
Log:
JBREM-920 - get it to work with codeBases (yay) - enough problems ironed out so I will commit - expect another commit as more tests are updated.
Modified: remoting2/branches/2.x/build.xml
===================================================================
--- remoting2/branches/2.x/build.xml 2008-03-20 06:03:36 UTC (rev 3673)
+++ remoting2/branches/2.x/build.xml 2008-03-20 15:41:51 UTC (rev 3674)
@@ -278,7 +278,7 @@
<pathelement path="${ant.library.dir}/ant-junit.jar"/>
<pathelement location="${tests.compile.dir}"/>
<path refid="library.classpath"/>
- <pathelement path="${output.lib.dir}/jboss-remoting.jar"/>
+ <!--<pathelement path="${output.lib.dir}/jboss-remoting.jar"/>-->
<pathelement path="${jdbc-driver-jar}"/>
</path>
@@ -936,6 +936,8 @@
</classpath>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
@@ -982,8 +984,10 @@
<path refid="tests.classpath"/>
<pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
- <!--sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
+ <sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
@@ -1038,6 +1042,8 @@
</classpath>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
@@ -1068,6 +1074,8 @@
</classpath>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
@@ -1102,6 +1110,8 @@
</classpath>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
@@ -1142,8 +1152,10 @@
<path refid="${classpath}"/>
<pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
- <!--sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
+ <sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
@@ -1192,6 +1204,8 @@
</classpath>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
@@ -1220,6 +1234,8 @@
</classpath>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
<sysproperty key="jrunit.mcast_port" value="${multicast.port}"/>
@@ -1283,6 +1299,8 @@
</classpath>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<!-- this is needed for the remoting.marshall.dynamic.remote.MarshallerLoadingServer -->
<jvmarg value="-Dloader.path=${output.lib.dir}/jboss-remoting-loading-tests.jar"/>
<formatter type="xml"/>
@@ -1311,6 +1329,8 @@
</classpath>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
+ <sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
<sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
<sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
<sysproperty key="jrunit.mcast_port" value="${multicast.port}"/>
@@ -1771,6 +1791,7 @@
<!--<jvmarg value="-Djboss.remoting.pre_2_0_compatible=${jboss.remoting.pre_2_0_compatible}"/>-->
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
@@ -1802,8 +1823,9 @@
<jvmarg value="-Dserver.pre_2_0_compatible=${server.pre_2_0_compatible}"/>
<jvmarg value="-Dremoting.metadata=check_connection=${check_connection}"/>
<jvmarg value="-Dcheck_content_type=${check_content_type}"/>
- <!--sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
+ <sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
@@ -1836,8 +1858,9 @@
<jvmarg value="-Dserver.pre_2_0_compatible=${server.pre_2_0_compatible}"/>
<jvmarg value="-Dremoting.metadata=check_connection=${check_connection}"/>
<jvmarg value="-Dcheck_content_type=${check_content_type}"/>
- <!--sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
+ <sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
@@ -1871,8 +1894,9 @@
<jvmarg value="-Dserver.pre_2_0_compatible=${server.pre_2_0_compatible}"/>
<jvmarg value="-Dremoting.metadata=check_connection=${check_connection}"/>
<jvmarg value="-Dcheck_content_type=${check_content_type}"/>
- <!--sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
+ <sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
@@ -1907,8 +1931,9 @@
<jvmarg value="-Dserver.pre_2_0_compatible=${server.pre_2_0_compatible}"/>
<jvmarg value="-Dcheck_content_type=${check_content_type}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
- <!--sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
+ <sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
<batchtest fork="yes" todir="${output.tests.results}"
@@ -2028,6 +2053,7 @@
<jvmarg value="-Dserver.check_connection=${server.check_connection}"/>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
@@ -2055,6 +2081,7 @@
<jvmarg value="-Djboss.remoting.pre_2_0_compatible=${jboss.remoting.pre_2_0_compatible}"/>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
@@ -2084,6 +2111,7 @@
<jvmarg value="-Djboss.remoting.pre_2_0_compatible=${jboss.remoting.pre_2_0_compatible}"/>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <sysproperty key="build.home" value="${basedir}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-20 06:03:36 UTC (rev 3673)
+++ remoting2/branches/2.x/test.policy 2008-03-20 15:41:51 UTC (rev 3674)
@@ -1,6 +1,6 @@
// Permissions to run Remoting itself
-grant {
+grant codeBase "file:${build.home}/output/classes/-" {
// Used by remote class loading system
permission java.lang.RuntimePermission "createClassLoader";
@@ -13,41 +13,38 @@
// Permission to create an MBean server
permission javax.management.MBeanServerPermission "createMBeanServer, releaseMBeanServer";
-};
-// Permissions for JBoss Serialization
-grant {
+ // System properties accessed by Remoting
+ permission java.util.PropertyPermission "jboss.remoting.pre_2_0_compatible", "read";
+ permission java.util.PropertyPermission "jboss.remoting.version", "read, write";
+ permission java.util.PropertyPermission "legacyParsing", "read";
+ permission java.util.PropertyPermission "jboss.bind.address", "read";
+ permission java.util.PropertyPermission "remoting.bind_by_host", "read";
+ permission java.util.PropertyPermission "javax.net.ssl.trustStoreType", "read";
+
+ // Permission to read the test keystore
+ permission java.io.FilePermission "${build.home}/output/tests/classes/-", "read";
+
+ // TODO - JBoss Serialization SHOULD be doing these operations in a privileged block - JBSER-105
permission java.lang.RuntimePermission "accessDeclaredMembers";
- permission java.io.SerializablePermission "enableSubstitution";
- permission java.io.SerializablePermission "enableSubclassImplementation";
+ permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
permission java.lang.RuntimePermission "reflectionFactoryAccess";
+ permission java.io.SerializablePermission "enableSubstitution"; // <- this one is a "maybe" :-)
};
-// Permissions for JGroups
-grant {
- // todo - need to find out exactly what jgroups is trying to do here in order to narrow this down
- permission java.io.FilePermission "-", "read, write, delete";
- permission java.io.FilePermission "/tmp/-", "read, write, delete";
+grant codeBase "file:${build.home}/lib/-" {
+ permission java.security.AllPermission;
};
-// Permissions to run the test suite
-grant {
- // Used by at least one test case
- permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
- permission java.lang.RuntimePermission "setContextClassLoader";
+grant codeBase "file:${build.home}/src/etc/-" {
+ permission java.security.AllPermission;
};
-// Permissions for JUnit itself to function
-grant {
- permission java.io.FilePermission "output/tests/-", "read, write, delete";
- permission java.io.FilePermission "<<ALL FILES>>", "execute";
- permission java.util.PropertyPermission "*", "read, write"; // todo - narrow this down a tad?
- permission java.lang.RuntimePermission "setIO";
+grant codeBase "file:${build.home}/output/tests/classes/-" {
+ permission java.security.AllPermission;
};
-// Uncomment for testing only
-grant {
-// permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete";
-// permission java.security.AllPermission;
-};
\ No newline at end of file
+grant codeBase "file:${ant.library.dir}/-" {
+ permission java.security.AllPermission;
+};
18 years, 1 month
JBoss Remoting SVN: r3673 - remoting2/tags.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 02:03:36 -0400 (Thu, 20 Mar 2008)
New Revision: 3673
Added:
remoting2/tags/2.4.0-CR1/
Log:
JBREM-935: Tagged 2.4.0.CR1.
Copied: remoting2/tags/2.4.0-CR1 (from rev 3672, remoting2/branches/2.x)
18 years, 1 month
JBoss Remoting SVN: r3672 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 01:58:21 -0400 (Thu, 20 Mar 2008)
New Revision: 3672
Modified:
remoting2/branches/2.x/.classpath
Log:
JBREM-935: (1) Deleted jgroups.jar; (2) Fixed reference to ant-junit.jar.
Modified: remoting2/branches/2.x/.classpath
===================================================================
--- remoting2/branches/2.x/.classpath 2008-03-20 05:54:03 UTC (rev 3671)
+++ remoting2/branches/2.x/.classpath 2008-03-20 05:58:21 UTC (rev 3672)
@@ -16,7 +16,6 @@
<classpathentry kind="lib" path="lib/jboss/jboss-serialization.jar"/>
<classpathentry kind="lib" path="lib/jboss/jnpserver.jar"/>
<classpathentry kind="lib" path="lib/jboss/jrunit.jar"/>
- <classpathentry kind="lib" path="lib/jgroups/lib/jgroups.jar"/>
<classpathentry kind="lib" path="lib/jrunit-libs/lib/jcommon-1.0.0-rc1.jar"/>
<classpathentry kind="lib" path="lib/jrunit-libs/lib/jfreechart-1.0.0-rc1.jar"/>
<classpathentry kind="lib" path="lib/junit/lib/junit.jar"/>
@@ -33,6 +32,7 @@
<classpathentry kind="lib" path="lib/spring/spring-web.jar"/>
<classpathentry kind="lib" path="lib/spring/spring-webmvc.jar"/>
<classpathentry kind="lib" path="lib/trove/lib/trove.jar"/>
- <classpathentry kind="var" path="ANT_HOME/ant-junit.jar"/>
+ <classpathentry kind="var" path="ANT_HOME/lib/ant-junit.jar"/>
+ <classpathentry kind="lib" path="lib/jgroups/lib/jgroups-all.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
18 years, 1 month
JBoss Remoting SVN: r3671 - remoting2/branches/2.x/docs.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 01:54:03 -0400 (Thu, 20 Mar 2008)
New Revision: 3671
Modified:
remoting2/branches/2.x/docs/README.txt
Log:
JBREM-935: Added 2.4.0.CR1 release notes.
Modified: remoting2/branches/2.x/docs/README.txt
===================================================================
--- remoting2/branches/2.x/docs/README.txt 2008-03-20 05:50:46 UTC (rev 3670)
+++ remoting2/branches/2.x/docs/README.txt 2008-03-20 05:54:03 UTC (rev 3671)
@@ -31,6 +31,41 @@
==========================================================================================================
+Release Notes - JBoss Remoting - Version 2.4.0.CR1 (Pinto)
+Bug
+
+ * [JBREM-167] - RMI Invoker does not use true remoting marshalling/unmarshalling
+ * [JBREM-677] - Compression marshalling fails intermittently.
+ * [JBREM-810] - coyote.RequestMap not storing all request properties in the Map.Entry set
+ * [JBREM-826] - JBoss Remoting logs at ERROR and WARN in many places
+ * [JBREM-844] - Put instance variable "isRemotingUserAgent" on stack in CoyoteInvoker
+ * [JBREM-898] - Fix encrypting marshaller/unmarshaller test cases
+ * [JBREM-901] - can't start NetworkRegistry if hostname is not resolvable
+ * [JBREM-924] - Compilation errors in non ISO-8859-1 systems
+ * [JBREM-927] - Adjust content length when CompressingUnMarshaller wraps HTTPUnMarshaller
+ * [JBREM-932] - Check remaining time in MicroSocketClientInvoker per invocation timeout facility
+ * [JBREM-933] - Fix memory leak in RemotingRMIClientSocketFactory
+
+Feature Request
+
+ * [JBREM-665] - Need better error reporting of response marshalling errors
+ * [JBREM-764] - Wire version should be configurable per client or server
+
+Release
+
+ * [JBREM-935] - Release 2.4.0.CR1
+
+Task
+
+ * [JBREM-698] - Update Remoting Marshaller/UnMarshallers to implement PreferredStreamMarshaller/PreferredStreamUnMarshaller interfaces.
+ * [JBREM-716] - Reduce log output from test suite
+ * [JBREM-825] - Verify that CoyoteInvoker works with Apache Portable Runtime
+ * [JBREM-876] - Get Remoting testsuite to run in hudson
+ * [JBREM-899] - Verify sslservlet transport works with jbossweb
+ * [JBREM-923] - Assure version compatibility with earlier versions of Remoting
+ * [JBREM-931] - Create and run soak test
+
+==========================================================================================================
Release Notes - JBoss Remoting - Version 2.4.0.Beta2 (Pinto)
Bug
18 years, 1 month
JBoss Remoting SVN: r3670 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 01:50:46 -0400 (Thu, 20 Mar 2008)
New Revision: 3670
Modified:
remoting2/branches/2.x/build.xml
Log:
(1) JBREM-935: Changed version to 2.4.0.CR1; (2) JBREM-167, JBREM-923: elaborated RMI version tests; (3) JBREM-920: disabled security manager for version tests.
Modified: remoting2/branches/2.x/build.xml
===================================================================
--- remoting2/branches/2.x/build.xml 2008-03-20 05:44:12 UTC (rev 3669)
+++ remoting2/branches/2.x/build.xml 2008-03-20 05:50:46 UTC (rev 3670)
@@ -215,9 +215,9 @@
<!-- Module name(s) & version -->
<property name="module.name" value="remoting"/>
<property name="module.Name" value="JBoss Remoting"/>
- <property name="module.version" value="2.4.0.Beta2"/>
+ <property name="module.version" value="2.4.0.CR1"/>
<!-- extension is for the file suffix to use for dtribution build -->
- <property name="module.version.extension" value="2_4_0_Beta2"/>
+ <property name="module.version.extension" value="2_4_0_CR1"/>
<property name="implementation.url" value="http://www.jboss.org/products/remoting"/>
<property name="root.dir" value="${basedir}"/>
@@ -1405,7 +1405,7 @@
<!-- ******************************************************************************** -->
<!-- Current <- -> 2.2.2.SP5 -->
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_SP5-client"/>
<param name="client.classpath" value="${etc.dir}/lib/remoting_2_2_2_SP5/jboss-remoting.jar"/>
<param name="server.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1415,7 +1415,7 @@
<param name="server.version" value="2"/>
<param name="check_connection" value="false"/>
</antcall>
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_SP5-server"/>
<param name="server.classpath" value="${etc.dir}/lib/remoting_2_2_2_SP5/jboss-remoting.jar"/>
<param name="client.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1429,7 +1429,7 @@
<!-- ******************************************************************************** -->
<!-- Current <- -> 2.2.2.SP4 -->
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_SP4-client"/>
<param name="client.classpath" value="${etc.dir}/lib/remoting_2_2_2_SP4/jboss-remoting.jar"/>
<param name="server.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1439,7 +1439,7 @@
<param name="server.version" value="2"/>
<param name="check_connection" value="false"/>
</antcall>
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_SP4-server"/>
<param name="server.classpath" value="${etc.dir}/lib/remoting_2_2_2_SP4/jboss-remoting.jar"/>
<param name="client.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1453,7 +1453,7 @@
<!-- ******************************************************************************** -->
<!-- Current <- -> 2.2.2.SP2 -->
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_SP2-client"/>
<param name="client.classpath" value="${etc.dir}/lib/remoting_2_2_2_SP2/jboss-remoting.jar"/>
<param name="server.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1463,7 +1463,7 @@
<param name="server.version" value="2"/>
<param name="check_connection" value="false"/>
</antcall>
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_SP2-server"/>
<param name="server.classpath" value="${etc.dir}/lib/remoting_2_2_2_SP2/jboss-remoting.jar"/>
<param name="client.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1477,7 +1477,7 @@
<!-- ******************************************************************************** -->
<!-- Current <- -> 2.2.2.SP1 -->
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_SP1-client"/>
<param name="client.classpath" value="${etc.dir}/lib/remoting_2_2_2_SP1/jboss-remoting.jar"/>
<param name="server.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1487,7 +1487,7 @@
<param name="server.version" value="2"/>
<param name="check_connection" value="false"/>
</antcall>
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_SP1-server"/>
<param name="server.classpath" value="${etc.dir}/lib/remoting_2_2_2_SP1/jboss-remoting.jar"/>
<param name="client.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1501,7 +1501,7 @@
<!-- ******************************************************************************** -->
<!-- Current <- -> 2.2.2.GA -->
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_GA-client"/>
<param name="client.classpath" value="${etc.dir}/lib/remoting_2_2_2_GA/jboss-remoting.jar"/>
<param name="server.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1511,7 +1511,7 @@
<param name="server.version" value="2"/>
<param name="check_connection" value="false"/>
</antcall>
- <antcall target="tests.versioning.all_transports" inheritrefs="true">
+ <antcall target="tests.versioning.all_transports_pre_2.4" inheritrefs="true">
<param name="jboss-junit-configuration" value="2_2_2_GA-server"/>
<param name="server.classpath" value="${etc.dir}/lib/remoting_2_2_2_GA/jboss-remoting.jar"/>
<param name="client.classpath" value="${output.lib.dir}/jboss-remoting.jar"/>
@@ -1700,9 +1700,9 @@
</antcall-->
<!-- 1.4.0.final does not allow turning off socket connection check -->
- <antcall target="tests.versioning.socket.1.4.0" inheritrefs="true">
+ <!--antcall target="tests.versioning.socket.1.4.0" inheritrefs="true">
<param name="version" value="1_4_0_final"/>
- </antcall>
+ </antcall-->
<!-- ******************************************************************************** -->
<!-- Current <- -> 1.2.1.final -->
@@ -1802,8 +1802,8 @@
<jvmarg value="-Dserver.pre_2_0_compatible=${server.pre_2_0_compatible}"/>
<jvmarg value="-Dremoting.metadata=check_connection=${check_connection}"/>
<jvmarg value="-Dcheck_content_type=${check_content_type}"/>
- <sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <!--sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
@@ -1817,6 +1817,41 @@
</junit>
</target>
+ <target name="tests.versioning.all_transports_pre_2.4"
+ description="Runs remoting fuctional tests with different remoting versions for client and server."
+ depends="jars, tests.jars">
+ <mkdir dir="${output.tests.results}"/>
+ <mkdir dir="${output.tests.tmp}"/>
+ <echo>Running: ${jboss-junit-configuration}</echo>
+ <junit printsummary="true" fork="yes" includeantruntime="true" tempdir="${output.tests.tmp}">
+ <classpath>
+ <path refid="third_party.classpath"/>
+ <path refid="tests.version.classpath"/>
+ </classpath>
+ <jvmarg value="-Dclient.path=${client.classpath}"/>
+ <jvmarg value="-Dserver.path=${server.classpath}"/>
+ <jvmarg value="-Dclient.version=${client.version}"/>
+ <jvmarg value="-Dserver.version=${server.version}"/>
+ <jvmarg value="-Dclient.pre_2_0_compatible=${client.pre_2_0_compatible}"/>
+ <jvmarg value="-Dserver.pre_2_0_compatible=${server.pre_2_0_compatible}"/>
+ <jvmarg value="-Dremoting.metadata=check_connection=${check_connection}"/>
+ <jvmarg value="-Dcheck_content_type=${check_content_type}"/>
+ <!--sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
+ <sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
+ <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
+ extension="-${jboss-junit-configuration}.xml"/>
+ <batchtest fork="yes" todir="${output.tests.results}"
+ haltonfailure="no">
+ <fileset dir="${tests.compile.dir}">
+ <include name="**/remoting/versioning/transport/**/*TestCase.class"/>
+ <exclude name="**/VersionRMISerializableMarshallerTestCase.class"/>
+ <exclude name="**/multiplex/**"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
<target name="tests.versioning.all_transports_but_bisocket"
description="Runs remoting fuctional tests with different remoting versions for client and server."
depends="jars, tests.jars">
@@ -1836,8 +1871,8 @@
<jvmarg value="-Dserver.pre_2_0_compatible=${server.pre_2_0_compatible}"/>
<jvmarg value="-Dremoting.metadata=check_connection=${check_connection}"/>
<jvmarg value="-Dcheck_content_type=${check_content_type}"/>
- <sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <!--sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
@@ -1846,6 +1881,7 @@
<fileset dir="${tests.compile.dir}">
<include name="**/remoting/versioning/transport/**/*TestCase.class"/>
<exclude name="**/bisocket/**"/>
+ <exclude name="**/VersionRMISerializableMarshallerTestCase.class"/>
<exclude name="**/multiplex/**"/>
</fileset>
</batchtest>
@@ -1871,8 +1907,8 @@
<jvmarg value="-Dserver.pre_2_0_compatible=${server.pre_2_0_compatible}"/>
<jvmarg value="-Dcheck_content_type=${check_content_type}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
- <sysproperty key="java.security.manager" value=""/>
- <sysproperty key="java.security.policy" value="${java.security.policy}"/>
+ <!--sysproperty key="java.security.manager" value=""/>
+ <sysproperty key="java.security.policy" value="${java.security.policy}"/-->
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
<batchtest fork="yes" todir="${output.tests.results}"
@@ -1881,6 +1917,7 @@
<include name="**/remoting/versioning/transport/**/*TestCase.class"/>
<exclude name="**/bisocket/**"/>
<exclude name="**/socket/**"/>
+ <exclude name="**/VersionRMISerializableMarshallerTestCase.class"/>
<exclude name="**/multiplex/**"/>
</fileset>
</batchtest>
18 years, 1 month
JBoss Remoting SVN: r3669 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 01:44:12 -0400 (Thu, 20 Mar 2008)
New Revision: 3669
Added:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMINativeMarshallerTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIOnewayNativeMarshallerTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIOnewaySerializableMarshallerTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMISerializableMarshallerTestCase.java
Removed:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIInvokerTestCase.java
Log:
JBREM-167, JBREM-923: Decomposed VersionRMIInvokerTestCase into four variations.
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIInvokerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIInvokerTestCase.java 2008-03-20 05:42:13 UTC (rev 3668)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIInvokerTestCase.java 2008-03-20 05:44:12 UTC (rev 3669)
@@ -1,17 +0,0 @@
-package org.jboss.test.remoting.versioning.transport.rmi;
-
-import org.jboss.test.remoting.versioning.transport.VersionInvokerTestCaseBase;
-
-/**
- * @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
- */
-public class VersionRMIInvokerTestCase extends VersionInvokerTestCaseBase
-{
- public void declareTestClasses()
- {
- addTestClasses("org.jboss.test.remoting.transport.rmi.RMIInvokerClientTest",
- 1,
- "org.jboss.test.remoting.transport.rmi.RMIInvokerServerTest");
- }
-
-}
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMINativeMarshallerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMINativeMarshallerTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMINativeMarshallerTestCase.java 2008-03-20 05:44:12 UTC (rev 3669)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.versioning.transport.rmi;
+
+import org.jboss.test.remoting.transport.InvokerTestDriver;
+import org.jboss.test.remoting.transport.rmi.RMIInvokerNativeMarshallerClientTest;
+import org.jboss.test.remoting.transport.rmi.RMIInvokerNativeMarshallerServerTest;
+import org.jboss.test.remoting.versioning.transport.VersionInvokerTestCaseBase;
+
+/**
+ * This should be used as the main test case for the invoker client/server.
+ * It will start one instance of the client and one of the server and will
+ * gather the test results and report them in standard JUnit format. When
+ * wanting to run JUnit test for invoker, this is the class to use.
+ *
+ * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
+ */
+public class VersionRMINativeMarshallerTestCase extends VersionInvokerTestCaseBase
+{
+ public void declareTestClasses()
+ {
+ addTestClasses(RMIInvokerNativeMarshallerClientTest.class.getName(),
+ 1,
+ RMIInvokerNativeMarshallerServerTest.class.getName());
+ }
+}
\ No newline at end of file
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIOnewayNativeMarshallerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIOnewayNativeMarshallerTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIOnewayNativeMarshallerTestCase.java 2008-03-20 05:44:12 UTC (rev 3669)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.versioning.transport.rmi;
+
+import org.jboss.test.remoting.transport.InvokerTestDriver;
+import org.jboss.test.remoting.transport.rmi.RMIInvokerOnewayNativeMarshallerClientTest;
+import org.jboss.test.remoting.transport.rmi.RMIInvokerOnewayNativeMarshallerServerTest;
+import org.jboss.test.remoting.versioning.transport.VersionInvokerTestCaseBase;
+
+/**
+ * Unit test for JBREM-167.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 12, 2008
+ * </p>
+ */
+public class VersionRMIOnewayNativeMarshallerTestCase extends VersionInvokerTestCaseBase
+{
+ public void declareTestClasses()
+ {
+ addTestClasses(RMIInvokerOnewayNativeMarshallerClientTest.class.getName(),
+ 1,
+ RMIInvokerOnewayNativeMarshallerServerTest.class.getName());
+ }
+}
\ No newline at end of file
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIOnewaySerializableMarshallerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIOnewaySerializableMarshallerTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMIOnewaySerializableMarshallerTestCase.java 2008-03-20 05:44:12 UTC (rev 3669)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.versioning.transport.rmi;
+
+import org.jboss.test.remoting.transport.InvokerTestDriver;
+import org.jboss.test.remoting.transport.rmi.RMIInvokerOnewaySerializableMarshallerClientTest;
+import org.jboss.test.remoting.transport.rmi.RMIInvokerOnewaySerializableMarshallerServerTest;
+import org.jboss.test.remoting.versioning.transport.VersionInvokerTestCaseBase;
+
+/**
+ * Unit test for JBREM-167.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 12, 2008
+ * </p>
+ */
+public class VersionRMIOnewaySerializableMarshallerTestCase extends VersionInvokerTestCaseBase
+{
+ public void declareTestClasses()
+ {
+ addTestClasses(RMIInvokerOnewaySerializableMarshallerClientTest.class.getName(),
+ 1,
+ RMIInvokerOnewaySerializableMarshallerServerTest.class.getName());
+ }
+}
\ No newline at end of file
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMISerializableMarshallerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMISerializableMarshallerTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/versioning/transport/rmi/VersionRMISerializableMarshallerTestCase.java 2008-03-20 05:44:12 UTC (rev 3669)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.versioning.transport.rmi;
+
+import org.jboss.test.remoting.transport.InvokerTestDriver;
+import org.jboss.test.remoting.transport.rmi.RMIInvokerSerializableMarshallerClientTest;
+import org.jboss.test.remoting.transport.rmi.RMIInvokerSerializableMarshallerServerTest;
+import org.jboss.test.remoting.versioning.transport.VersionInvokerTestCaseBase;
+
+/**
+ * This should be used as the main test case for the invoker client/server.
+ * It will start one instance of the client and one of the server and will
+ * gather the test results and report them in standard JUnit format. When
+ * wanting to run JUnit test for invoker, this is the class to use.
+ *
+ * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
+ */
+public class VersionRMISerializableMarshallerTestCase extends VersionInvokerTestCaseBase
+{
+ public void declareTestClasses()
+ {
+ addTestClasses(RMIInvokerSerializableMarshallerClientTest.class.getName(),
+ 1,
+ RMIInvokerSerializableMarshallerServerTest.class.getName());
+ }
+}
\ No newline at end of file
18 years, 1 month
JBoss Remoting SVN: r3668 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 01:42:13 -0400 (Thu, 20 Mar 2008)
New Revision: 3668
Added:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerClientTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerServerTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerClientTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerServerTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerTestCase.java
Removed:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerClientTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingClientTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingServerTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerServerTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerTestCase.java
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerNativeMarshallerClientTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerNativeMarshallerServerTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerSerializableMarshallerClientTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerSerializableMarshallerServerTest.java
Log:
JBREM-167, JBREM-923: Decomposed RMIInvokerTestCase into four variations.
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerClientTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerClientTest.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerClientTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -1,460 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.test.remoting.transport.rmi;
-
-import junit.framework.TestCase;
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.invocation.NameBasedInvocation;
-import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
-import org.jboss.remoting.transport.Connector;
-import org.jboss.remoting.transport.rmi.RMIServerInvoker;
-import org.jboss.test.remoting.ComplexReturn;
-import org.jboss.test.remoting.TestUtil;
-import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
-import org.jboss.test.remoting.performance.synchronous.PerformanceTestCase;
-import org.jboss.test.remoting.transport.mock.MockInvokerCallbackHandler;
-import org.jboss.test.remoting.transport.mock.MockTest;
-import org.w3c.dom.Document;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import java.io.ByteArrayInputStream;
-import java.rmi.MarshalledObject;
-import java.rmi.server.UID;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This is the actual concrete test for the invoker client.
- *
- * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
- */
-public class RMIInvokerClientTest extends TestCase
-{
-
- private String sessionId = new UID().toString();
- private Client client;
- private Connector connector;
- private InvokerLocator locator;
- private int port = RMIServerInvoker.DEFAULT_REGISTRY_PORT - 1;
- protected String transport = "rmi";
-
- private static final Logger log = Logger.getLogger(RMIInvokerClientTest.class);
-
- public void init(Map metadata)
- {
- try
- {
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metadata, this.port));
- //InvokerLocator locator = new InvokerLocator(getTransport() + "://localhost:" + port);
- System.out.println("client locator: " + locator);
- client = new Client(locator, "mock");
- client.connect();
- }
- catch(Exception e)
- {
- log.error(e.getMessage(), e);
- }
- }
-
- private String buildLocatorURI(Map metadata, int port)
- {
- if(metadata == null || metadata.size() == 0)
- {
- return transport + "://localhost:" + port;
- }
- else
- {
- StringBuffer uriBuffer = new StringBuffer(transport + "://localhost:" + port + "/?");
-
- Set keys = metadata.keySet();
- if(keys.size() > 0)
- {
- uriBuffer.append("/?");
- }
-
- Iterator itr = keys.iterator();
- while(itr.hasNext())
- {
- String key = (String) itr.next();
- String value = (String) metadata.get(key);
- uriBuffer.append(key + "=" + value + "&");
- }
- return uriBuffer.substring(0, uriBuffer.length() - 1);
- }
- }
-
- private InvokerLocator initServer(Map metadata, int serverPort) throws Exception
- {
- if(serverPort < 0)
- {
- serverPort = TestUtil.getRandomPort();
- }
- log.debug("port = " + serverPort);
-
-// InvokerRegistry.registerInvoker("mock", MockClientInvoker.class, MockServerInvoker.class);
- connector = new Connector();
-
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metadata, serverPort));
- System.out.println("Server locator: " + locator);
-
- //InvokerLocator locator = new InvokerLocator(transport + "://localhost:" + port);
- StringBuffer buf = new StringBuffer();
- buf.append("<?xml version=\"1.0\"?>\n");
- buf.append("<handlers>\n");
- buf.append(" <handler subsystem=\"mock\">org.jboss.test.remoting.transport.mock.MockServerInvocationHandler</handler>\n");
- buf.append("</handlers>\n");
- Document xml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(buf.toString().getBytes()));
- connector.setInvokerLocator(locator.getLocatorURI());
- connector.setConfiguration(xml.getDocumentElement());
- //connector.create();
- connector.start();
- return locator;
- }
-
-
- public void setUp(boolean withNativeMarshaller) throws Exception
- {
- Map metadata = new HashMap();
- String newMetadata = System.getProperty(PerformanceTestCase.REMOTING_METADATA);
- if(newMetadata != null && newMetadata.length() > 0)
- {
- metadata.putAll(PerformanceServerTest.parseMetadataString(newMetadata));
- }
-
- metadata.put(RMIServerInvoker.REGISTRY_PORT_KEY, String.valueOf(port + 1));
- locator = initServer(metadata, -1);
- if(!withNativeMarshaller)
- {
- metadata.put(InvokerLocator.DATATYPE, SerializableMarshaller.DATATYPE);
- }
- init(metadata);
- log.info("Using metadata: " + metadata);
- }
-
- public void tearDown() throws Exception
- {
- if(connector != null)
- {
- connector.stop();
- connector.destroy();
- connector = null;
- }
- locator = null;
- if(client != null)
- {
- client.disconnect();
- client = null;
- }
- }
-
- /**
- * Test simple invocation and adding of listener with push callback (meaning server
- * will send callback message when it gets it) to a local callback server
- *
- * @throws Throwable
- */
- public void testLocalPushCallback() throws Throwable
- {
- setUp(true);
- runLocalPushCallback();
- }
-
- public void testLocalPushCallbackWithDatatype() throws Throwable
- {
- setUp(false);
- runLocalPushCallback();
- }
-
- public void runLocalPushCallback() throws Throwable
- {
- log.debug("running testLocalPushCallback()");
-
- sessionId = new UID().toString();
-
- sessionId = client.getSessionId();
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- log.debug("client.getInvoker().getLocator()" + client.getInvoker().getLocator());
-
- // simple invoke, should return bar
- Object ret = makeInvocation("foo", "bar");
- assertTrue("Result of testLocalPushCallback() invocation of foo.", "bar".equals(ret));
- client.addListener(handler, locator);
- // invoke which should cause callback
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(3000);
- log.debug("done sleeping.");
- int callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbacksPerformed after adding listener is " + callbacksPerformed);
- assertTrue("Result of testLocalPushCallback() failed since did not get callback.",
- (callbacksPerformed == 1));
- // Can now call direct on client
- client.removeListener(handler);
- // shouldn't get callback now since removed listener
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- log.debug("done sleeping.");
- callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbackPerformed after removing listener is " + callbacksPerformed);
- assertTrue("Result of testLocalPushCallback() failed since did get callback " +
- "but have been removed as listener.",
- (callbacksPerformed == 1));
- }
-
- /**
- * Test simple invocation and adding of listener with push callback (meaning server
- * will send callback message when it gets it) to a remote callback server
- *
- * @throws Throwable
- */
- public void testRemotePushCallback() throws Throwable
- {
- setUp(true);
- runRemotePushCallback();
- }
-
- public void testRemotePushCallbackWithDataType() throws Throwable
- {
- setUp(false);
- runRemotePushCallback();
- }
-
- public void runRemotePushCallback() throws Throwable
- {
- log.debug("running testRemotePushCallback()");
-
- sessionId = new UID().toString();
- //InvokerLocator locator = client.getInvoker().getLocator();
- sessionId = client.getSessionId();
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- log.debug("client.getInvoker().getLocator()" + client.getInvoker().getLocator());
-
- // simple invoke, should return bar
- Object ret = makeInvocation("foo", "bar");
- assertTrue("Result of testRemotePushCallback() invocation of foo.", "bar".equals(ret));
- client.addListener(handler, locator);
- // invoke which should cause callback
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(3000);
- log.debug("done sleeping.");
- // TODO: No way to currently check the remote callback handler
- // to see if it got callback -TME
- /*
- int callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbacksPerformed after adding listener is " + callbacksPerformed);
- assertTrue("Result of testRemotePushCallback() failed since did not get callback.",
- (callbacksPerformed == 1));
- */
- // Can now call direct on client
- client.removeListener(handler);
- // shouldn't get callback now since removed listener
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- log.debug("done sleeping.");
- /*
- callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbackPerformed after removing listener is " + callbacksPerformed);
- assertTrue("Result of testRemotePushCallback() failed since did get callback " +
- "but have been removed as listener.",
- (callbacksPerformed == 1));
- */
- }
-
- /**
- * Tests simple invocation and pull callbacks. Meaning will add a listener and
- * will then have to get the callbacks from the server.
- *
- * @throws Throwable
- */
- public void testPullCallback() throws Throwable
- {
- setUp(true);
- runPullCallback();
- }
-
- public void testPullCallbackWithDataType() throws Throwable
- {
- setUp(false);
- runPullCallback();
- }
-
- public void runPullCallback() throws Throwable
- {
- log.debug("running testPullCallback()");
-
- // should be null by default, since don't have connector started, but setting anyway
- //client.setClientLocator(null);
-
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- // simple invoke, should return bar
- Object ret = makeInvocation("bar", "foo");
- assertTrue("Result of runPullCallbackTest() invocation of bar.", "foo".equals(ret));
- client.addListener(handler);
- // invoke which should cause callback on server side
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- ret = client.getCallbacks(handler);
- log.debug("getCallbacks returned " + ret);
- log.debug("should have something.");
- assertTrue("Result of runPullCallbackTest() getCallbacks() after add listener.",
- ret != null);
- // can now call directly on client
- //ret = makeInvocation("removeListener", null);
- client.removeListener(handler);
- ret = makeInvocation("getCallbacks", null);
- log.debug("getCallbacks returned " + ret);
- log.debug("should have been empty.");
- assertTrue("Result of runPullCallbackTest() getCallbacks() after remove listener.",
- ret == null);
- }
-
- /**
- * Tests complex invocation to get object containing array of complex objects.
- *
- * @throws Throwable
- */
- public void testArrayReturn() throws Throwable
- {
- setUp(true);
- runArrayReturn();
- }
-
- public void testArrayReturnWithDataType() throws Throwable
- {
- setUp(false);
- runArrayReturn();
- }
-
- public void runArrayReturn() throws Throwable
- {
- // simple invoke, should return bar
- Object ret = makeInvocation("testComplexReturn", null);
- ComplexReturn complexRet = (ComplexReturn) ret;
- MockTest[] mockTests = complexRet.getMockTests();
- assertTrue("ComplexReturn's array should contain 2 items",
- 2 == mockTests.length);
- for(int x = 0; x < mockTests.length; x++)
- {
- System.err.println(mockTests[x]);
- MockTest test = mockTests[x];
- assertNotNull("MockTest should not be null", test);
- }
-
-// assertTrue("Result of runPullCallbackTest() invocation of bar.",
-// "foo".equals(ret));
- }
-
- /**
- * Tests complex invocation to get marshalled object.
- *
- * @throws Throwable
- */
- public void testMarshalledObjectReturn() throws Throwable
- {
- setUp(true);
- runMarshalledObjectReturn();
- }
-
- public void testMarshalledObjectReturnWithDataType() throws Throwable
- {
- setUp(false);
- runMarshalledObjectReturn();
- }
-
- public void runMarshalledObjectReturn() throws Throwable
- {
- // simple invoke, should return bar
- Object ret = makeInvocation("testMarshalledObject", null);
- ret = ((MarshalledObject) ret).get();
- ComplexReturn complexRet = (ComplexReturn) ret;
- MockTest[] mockTests = complexRet.getMockTests();
- assertTrue("ComplexReturn's array should contain 2 items",
- 2 == mockTests.length);
- for(int x = 0; x < mockTests.length; x++)
- {
- System.err.println(mockTests[x]);
- MockTest test = mockTests[x];
- assertNotNull("MockTest should not be null", test);
- }
-
-// assertTrue("Result of runPullCallbackTest() invocation of bar.",
-// "foo".equals(ret));
- }
-
- private Object makeInvocation(String method, String param) throws Throwable
- {
- Object ret = client.invoke(new NameBasedInvocation(method,
- new Object[]{param},
- new String[]{String.class.getName()}),
- null);
-
- return ret;
- }
-
- public static void main(String[] args)
- {
- RMIInvokerClientTest client = new RMIInvokerClientTest();
- try
- {
- client.setUp();
- client.testArrayReturn();
- client.testArrayReturnWithDataType();
- client.testLocalPushCallback();
- client.testLocalPushCallbackWithDatatype();
- client.testMarshalledObjectReturn();
- client.testMarshalledObjectReturnWithDataType();
- client.testPullCallback();
- client.testPullCallbackWithDataType();
- client.testRemotePushCallback();
- client.testRemotePushCallbackWithDataType();
- }
- catch (Throwable throwable)
- {
- throwable.printStackTrace();
- }
- finally
- {
- try
- {
- client.tearDown();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- }
-
-}
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerNativeMarshallerClientTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerNativeMarshallerClientTest.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerNativeMarshallerClientTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -27,7 +27,6 @@
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.invocation.NameBasedInvocation;
-import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
import org.jboss.remoting.transport.Connector;
import org.jboss.remoting.transport.rmi.RMIServerInvoker;
import org.jboss.test.remoting.ComplexReturn;
@@ -119,7 +118,7 @@
connector = new Connector();
InvokerLocator locator = new InvokerLocator(buildLocatorURI(metadata, serverPort));
- System.out.println("Server locator: " + locator);
+ System.out.println("Callback locator: " + locator);
//InvokerLocator locator = new InvokerLocator(transport + "://localhost:" + port);
StringBuffer buf = new StringBuffer();
@@ -136,7 +135,7 @@
}
- public void setUp(boolean withNativeMarshaller) throws Exception
+ public void setUp() throws Exception
{
Map metadata = new HashMap();
String newMetadata = System.getProperty(PerformanceTestCase.REMOTING_METADATA);
@@ -146,11 +145,8 @@
}
metadata.put(RMIServerInvoker.REGISTRY_PORT_KEY, String.valueOf(port + 1));
+ addMetadata(metadata);
locator = initServer(metadata, -1);
- if(!withNativeMarshaller)
- {
- metadata.put(InvokerLocator.DATATYPE, SerializableMarshaller.DATATYPE);
- }
init(metadata);
log.info("Using metadata: " + metadata);
}
@@ -179,12 +175,6 @@
*/
public void testLocalPushCallback() throws Throwable
{
- setUp(true);
- runLocalPushCallback();
- }
-
- public void runLocalPushCallback() throws Throwable
- {
log.debug("running testLocalPushCallback()");
sessionId = new UID().toString();
@@ -229,12 +219,6 @@
*/
public void testRemotePushCallback() throws Throwable
{
- setUp(true);
- runRemotePushCallback();
- }
-
- public void runRemotePushCallback() throws Throwable
- {
log.debug("running testRemotePushCallback()");
sessionId = new UID().toString();
@@ -285,12 +269,6 @@
*/
public void testPullCallback() throws Throwable
{
- setUp(true);
- runPullCallback();
- }
-
- public void runPullCallback() throws Throwable
- {
log.debug("running testPullCallback()");
// should be null by default, since don't have connector started, but setting anyway
@@ -328,12 +306,6 @@
*/
public void testArrayReturn() throws Throwable
{
- setUp(true);
- runArrayReturn();
- }
-
- public void runArrayReturn() throws Throwable
- {
// simple invoke, should return bar
Object ret = makeInvocation("testComplexReturn", null);
ComplexReturn complexRet = (ComplexReturn) ret;
@@ -358,12 +330,6 @@
*/
public void testMarshalledObjectReturn() throws Throwable
{
- setUp(true);
- runMarshalledObjectReturn();
- }
-
- public void runMarshalledObjectReturn() throws Throwable
- {
// simple invoke, should return bar
Object ret = makeInvocation("testMarshalledObject", null);
ret = ((MarshalledObject) ret).get();
@@ -381,6 +347,10 @@
// assertTrue("Result of runPullCallbackTest() invocation of bar.",
// "foo".equals(ret));
}
+
+ protected void addMetadata(Map metadata)
+ {
+ }
private Object makeInvocation(String method, String param) throws Throwable
{
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerNativeMarshallerServerTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerNativeMarshallerServerTest.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerNativeMarshallerServerTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -30,7 +30,6 @@
import org.jboss.logging.Logger;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.ServerInvocationHandler;
-import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
import org.jboss.remoting.transport.Connector;
import org.jboss.remoting.transport.rmi.RMIServerInvoker;
import org.jboss.test.remoting.TestUtil;
@@ -76,7 +75,7 @@
}
else
{
- StringBuffer uriBuffer = new StringBuffer(transport + "://localhost:" + port + "/?");
+ StringBuffer uriBuffer = new StringBuffer(transport + "://localhost:" + port);
Set keys = metadata.keySet();
if(keys.size() > 0)
@@ -114,6 +113,7 @@
metadata.putAll(PerformanceServerTest.parseMetadataString(newMetadata));
}
metadata.put(RMIServerInvoker.REGISTRY_PORT_KEY, String.valueOf(port + 1));
+ addMetadata(metadata);
init(metadata);
}
@@ -125,6 +125,10 @@
connector.destroy();
}
}
+
+ protected void addMetadata(Map metadata)
+ {
+ }
public static void main(String[] args)
{
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingClientTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingClientTest.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingClientTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -1,433 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.test.remoting.transport.rmi;
-
-import junit.framework.TestCase;
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.invocation.NameBasedInvocation;
-import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
-import org.jboss.remoting.transport.Connector;
-import org.jboss.remoting.transport.rmi.RMIServerInvoker;
-import org.jboss.test.remoting.ComplexReturn;
-import org.jboss.test.remoting.TestUtil;
-import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
-import org.jboss.test.remoting.performance.synchronous.PerformanceTestCase;
-import org.jboss.test.remoting.transport.mock.MockInvokerCallbackHandler;
-import org.jboss.test.remoting.transport.mock.MockTest;
-import org.w3c.dom.Document;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import java.io.ByteArrayInputStream;
-import java.rmi.MarshalledObject;
-import java.rmi.server.UID;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Unit test for JBREM-167.
- *
- * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1 $
- * <p>
- * Copyright Mar 12, 2008
- * </p>
- */
-public class RMIInvokerOnewayMarshallingClientTest extends TestCase
-{
-
- private String sessionId = new UID().toString();
- private Client client;
- private Connector connector;
- private InvokerLocator locator;
- private int port = RMIServerInvoker.DEFAULT_REGISTRY_PORT - 1;
- protected String transport = "rmi";
-
- private static final Logger log = Logger.getLogger(RMIInvokerOnewayMarshallingClientTest.class);
-
- public void init(Map metadata)
- {
- try
- {
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metadata, this.port));
- //InvokerLocator locator = new InvokerLocator(getTransport() + "://localhost:" + port);
- System.out.println("client locator: " + locator);
- client = new Client(locator, "mock");
- client.connect();
- }
- catch(Exception e)
- {
- log.error(e.getMessage(), e);
- }
- }
-
- private String buildLocatorURI(Map metadata, int port)
- {
- if(metadata == null || metadata.size() == 0)
- {
- return transport + "://localhost:" + port;
- }
- else
- {
- StringBuffer uriBuffer = new StringBuffer(transport + "://localhost:" + port);
-
- Set keys = metadata.keySet();
- if(keys.size() > 0)
- {
- uriBuffer.append("/?");
- }
-
- Iterator itr = keys.iterator();
- while(itr.hasNext())
- {
- String key = (String) itr.next();
- String value = (String) metadata.get(key);
- uriBuffer.append(key + "=" + value + "&");
- }
- return uriBuffer.substring(0, uriBuffer.length() - 1);
- }
- }
-
- private InvokerLocator initServer(Map metadata, int serverPort) throws Exception
- {
- if(serverPort < 0)
- {
- serverPort = TestUtil.getRandomPort();
- }
- log.debug("port = " + serverPort);
-
-// InvokerRegistry.registerInvoker("mock", MockClientInvoker.class, MockServerInvoker.class);
- connector = new Connector();
-
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metadata, serverPort));
- System.out.println("Server locator: " + locator);
-
- //InvokerLocator locator = new InvokerLocator(transport + "://localhost:" + port);
- StringBuffer buf = new StringBuffer();
- buf.append("<?xml version=\"1.0\"?>\n");
- buf.append("<handlers>\n");
- buf.append(" <handler subsystem=\"mock\">org.jboss.test.remoting.transport.mock.MockServerInvocationHandler</handler>\n");
- buf.append("</handlers>\n");
- Document xml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(buf.toString().getBytes()));
- connector.setInvokerLocator(locator.getLocatorURI());
- connector.setConfiguration(xml.getDocumentElement());
- //connector.create();
- connector.start();
- return locator;
- }
-
-
- public void setUp() throws Exception
- {
- Map metadata = new HashMap();
- String newMetadata = System.getProperty(PerformanceTestCase.REMOTING_METADATA);
- if(newMetadata != null && newMetadata.length() > 0)
- {
- metadata.putAll(PerformanceServerTest.parseMetadataString(newMetadata));
- }
-
- metadata.put(RMIServerInvoker.REGISTRY_PORT_KEY, String.valueOf(port + 1));
- locator = initServer(metadata, -1);
- metadata.put(InvokerLocator.DATATYPE, SerializableMarshaller.DATATYPE);
- metadata.put(RMIServerInvoker.RMI_ONEWAY_MARSHALLING, "true");
- metadata.put("serializationtype", "jboss");
- init(metadata);
- log.info("Using metadata: " + metadata);
- }
-
- public void tearDown() throws Exception
- {
- if(connector != null)
- {
- connector.stop();
- connector.destroy();
- connector = null;
- }
- locator = null;
- if(client != null)
- {
- client.disconnect();
- client = null;
- }
- }
-
- /**
- * Test simple invocation and adding of listener with push callback (meaning server
- * will send callback message when it gets it) to a local callback server
- *
- * @throws Throwable
- */
- public void testLocalPushCallbackWithDatatype() throws Throwable
- {
- setUp();
- runLocalPushCallback();
- }
-
- public void runLocalPushCallback() throws Throwable
- {
- log.debug("running testLocalPushCallback()");
-
- sessionId = new UID().toString();
-
- sessionId = client.getSessionId();
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- log.debug("client.getInvoker().getLocator()" + client.getInvoker().getLocator());
-
- // simple invoke, should return bar
- Object ret = makeInvocation("foo", "bar");
- assertTrue("Result of testLocalPushCallback() invocation of foo.", "bar".equals(ret));
- client.addListener(handler, locator);
- // invoke which should cause callback
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(3000);
- log.debug("done sleeping.");
- int callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbacksPerformed after adding listener is " + callbacksPerformed);
- assertTrue("Result of testLocalPushCallback() failed since did not get callback.",
- (callbacksPerformed == 1));
- // Can now call direct on client
- client.removeListener(handler);
- // shouldn't get callback now since removed listener
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- log.debug("done sleeping.");
- callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbackPerformed after removing listener is " + callbacksPerformed);
- assertTrue("Result of testLocalPushCallback() failed since did get callback " +
- "but have been removed as listener.",
- (callbacksPerformed == 1));
- }
-
- /**
- * Test simple invocation and adding of listener with push callback (meaning server
- * will send callback message when it gets it) to a remote callback server
- *
- * @throws Throwable
- */
- public void testRemotePushCallbackWithDataType() throws Throwable
- {
- setUp();
- runRemotePushCallback();
- }
-
- public void runRemotePushCallback() throws Throwable
- {
- log.debug("running testRemotePushCallback()");
-
- sessionId = new UID().toString();
- //InvokerLocator locator = client.getInvoker().getLocator();
- sessionId = client.getSessionId();
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- log.debug("client.getInvoker().getLocator()" + client.getInvoker().getLocator());
-
- // simple invoke, should return bar
- Object ret = makeInvocation("foo", "bar");
- assertTrue("Result of testRemotePushCallback() invocation of foo.", "bar".equals(ret));
- client.addListener(handler, locator);
- // invoke which should cause callback
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(3000);
- log.debug("done sleeping.");
- // TODO: No way to currently check the remote callback handler
- // to see if it got callback -TME
- /*
- int callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbacksPerformed after adding listener is " + callbacksPerformed);
- assertTrue("Result of testRemotePushCallback() failed since did not get callback.",
- (callbacksPerformed == 1));
- */
- // Can now call direct on client
- client.removeListener(handler);
- // shouldn't get callback now since removed listener
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- log.debug("done sleeping.");
- /*
- callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbackPerformed after removing listener is " + callbacksPerformed);
- assertTrue("Result of testRemotePushCallback() failed since did get callback " +
- "but have been removed as listener.",
- (callbacksPerformed == 1));
- */
- }
-
- /**
- * Tests simple invocation and pull callbacks. Meaning will add a listener and
- * will then have to get the callbacks from the server.
- *
- * @throws Throwable
- */
- public void testPullCallbackWithDataType() throws Throwable
- {
- setUp();
- runPullCallback();
- }
-
- public void runPullCallback() throws Throwable
- {
- log.debug("running testPullCallback()");
-
- // should be null by default, since don't have connector started, but setting anyway
- //client.setClientLocator(null);
-
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- // simple invoke, should return bar
- Object ret = makeInvocation("bar", "foo");
- assertTrue("Result of runPullCallbackTest() invocation of bar.", "foo".equals(ret));
- client.addListener(handler);
- // invoke which should cause callback on server side
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- ret = client.getCallbacks(handler);
- log.debug("getCallbacks returned " + ret);
- log.debug("should have something.");
- assertTrue("Result of runPullCallbackTest() getCallbacks() after add listener.",
- ret != null);
- // can now call directly on client
- //ret = makeInvocation("removeListener", null);
- client.removeListener(handler);
- ret = makeInvocation("getCallbacks", null);
- log.debug("getCallbacks returned " + ret);
- log.debug("should have been empty.");
- assertTrue("Result of runPullCallbackTest() getCallbacks() after remove listener.",
- ret == null);
- }
-
- /**
- * Tests complex invocation to get object containing array of complex objects.
- *
- * @throws Throwable
- */
- public void testArrayReturnWithDataType() throws Throwable
- {
- setUp();
- runArrayReturn();
- }
-
- public void runArrayReturn() throws Throwable
- {
- // simple invoke, should return bar
- Object ret = makeInvocation("testComplexReturn", null);
- ComplexReturn complexRet = (ComplexReturn) ret;
- MockTest[] mockTests = complexRet.getMockTests();
- assertTrue("ComplexReturn's array should contain 2 items",
- 2 == mockTests.length);
- for(int x = 0; x < mockTests.length; x++)
- {
- System.err.println(mockTests[x]);
- MockTest test = mockTests[x];
- assertNotNull("MockTest should not be null", test);
- }
-
-// assertTrue("Result of runPullCallbackTest() invocation of bar.",
-// "foo".equals(ret));
- }
-
- /**
- * Tests complex invocation to get marshalled object.
- *
- * @throws Throwable
- */
- public void testMarshalledObjectReturnWithDataType() throws Throwable
- {
- setUp();
- runMarshalledObjectReturn();
- }
-
- public void runMarshalledObjectReturn() throws Throwable
- {
- // simple invoke, should return bar
- Object ret = makeInvocation("testMarshalledObject", null);
- ret = ((MarshalledObject) ret).get();
- ComplexReturn complexRet = (ComplexReturn) ret;
- MockTest[] mockTests = complexRet.getMockTests();
- assertTrue("ComplexReturn's array should contain 2 items",
- 2 == mockTests.length);
- for(int x = 0; x < mockTests.length; x++)
- {
- System.err.println(mockTests[x]);
- MockTest test = mockTests[x];
- assertNotNull("MockTest should not be null", test);
- }
-
-// assertTrue("Result of runPullCallbackTest() invocation of bar.",
-// "foo".equals(ret));
- }
-
- private Object makeInvocation(String method, String param) throws Throwable
- {
- Object ret = client.invoke(new NameBasedInvocation(method,
- new Object[]{param},
- new String[]{String.class.getName()}),
- null);
-
- return ret;
- }
-
-// public static void main(String[] args)
-// {
-// RMIInvokerClientTest client = new RMIInvokerClientTest();
-// try
-// {
-// client.setUp();
-// client.testArrayReturn();
-// client.testArrayReturnWithDataType();
-// client.testLocalPushCallback();
-// client.testLocalPushCallbackWithDatatype();
-// client.testMarshalledObjectReturn();
-// client.testMarshalledObjectReturnWithDataType();
-// client.testPullCallback();
-// client.testPullCallbackWithDataType();
-// client.testRemotePushCallback();
-// client.testRemotePushCallbackWithDataType();
-// }
-// catch (Throwable throwable)
-// {
-// throwable.printStackTrace();
-// }
-// finally
-// {
-// try
-// {
-// client.tearDown();
-// }
-// catch (Exception e)
-// {
-// e.printStackTrace();
-// }
-// }
-//
-// }
-
-}
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingServerTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingServerTest.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingServerTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -1,151 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.test.remoting.transport.rmi;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.jboss.jrunit.extensions.ServerTestCase;
-import org.jboss.logging.Logger;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.ServerInvocationHandler;
-import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
-import org.jboss.remoting.transport.Connector;
-import org.jboss.remoting.transport.rmi.RMIServerInvoker;
-import org.jboss.test.remoting.TestUtil;
-import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
-import org.jboss.test.remoting.performance.synchronous.PerformanceTestCase;
-import org.jboss.test.remoting.transport.mock.MockServerInvocationHandler;
-
-
-/**
- * Unit test for JBREM-167.
- *
- * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1 $
- * <p>
- * Copyright Mar 12, 2008
- * </p>
- */
-public class RMIInvokerOnewayMarshallingServerTest extends ServerTestCase
-{
- private int port = RMIServerInvoker.DEFAULT_REGISTRY_PORT - 1;
- protected String transport = "rmi";
- private Connector connector;
-
- private static final Logger log = Logger.getLogger(RMIInvokerOnewayMarshallingServerTest.class);
-
- public void init(Map metatdata) throws Exception
- {
- if(port < 0)
- {
- port = TestUtil.getRandomPort();
- }
- log.debug("port = " + port);
-
- connector = new Connector();
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metatdata));
- System.out.println("server locator: " + locator);
- connector.setInvokerLocator(locator.getLocatorURI());
- connector.start();
- connector.addInvocationHandler(getSubsystem(), getServerInvocationHandler());
- }
-
- private String buildLocatorURI(Map metadata)
- {
- if(metadata == null || metadata.size() == 0)
- {
- return transport + "://localhost:" + port;
- }
- else
- {
- StringBuffer uriBuffer = new StringBuffer(transport + "://localhost:" + port);
-
- Set keys = metadata.keySet();
- if(keys.size() > 0)
- {
- uriBuffer.append("/?");
- }
-
- Iterator itr = keys.iterator();
- while(itr.hasNext())
- {
- String key = (String) itr.next();
- String value = (String) metadata.get(key);
- uriBuffer.append(key + "=" + value + "&");
- }
- return uriBuffer.substring(0, uriBuffer.length() - 1);
- }
- }
-
- protected String getSubsystem()
- {
- return "mock";
- }
-
- protected ServerInvocationHandler getServerInvocationHandler()
- {
- return new MockServerInvocationHandler();
- }
-
- public void setUp() throws Exception
- {
- Map metadata = new HashMap();
- String newMetadata = System.getProperty(PerformanceTestCase.REMOTING_METADATA);
- if(newMetadata != null && newMetadata.length() > 0)
- {
- metadata.putAll(PerformanceServerTest.parseMetadataString(newMetadata));
- }
- metadata.put(RMIServerInvoker.REGISTRY_PORT_KEY, String.valueOf(port + 1));
- metadata.put(InvokerLocator.DATATYPE, SerializableMarshaller.DATATYPE);
- metadata.put(RMIServerInvoker.RMI_ONEWAY_MARSHALLING, "true");
- metadata.put("serializationtype", "jboss");
- init(metadata);
- }
-
- public void tearDown() throws Exception
- {
- if(connector != null)
- {
- connector.stop();
- connector.destroy();
- }
- }
-
- public static void main(String[] args)
- {
- RMIInvokerOnewayMarshallingServerTest server = new RMIInvokerOnewayMarshallingServerTest();
- try
- {
- server.setUp();
- Thread.currentThread().sleep(6000000);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
-
-
-}
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingTestCase.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingTestCase.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -1,44 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.test.remoting.transport.rmi;
-
-import org.jboss.test.remoting.transport.InvokerTestDriver;
-
-/**
- * Unit test for JBREM-167.
- *
- * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1 $
- * <p>
- * Copyright Mar 12, 2008
- * </p>
- */
-public class RMIInvokerOnewayMarshallingTestCase extends InvokerTestDriver
-{
- public void declareTestClasses()
- {
- addTestClasses(RMIInvokerOnewayMarshallingClientTest.class.getName(),
- 1,
- RMIInvokerOnewayMarshallingServerTest.class.getName());
- }
-}
\ No newline at end of file
Copied: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerClientTest.java (from rev 3661, remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingClientTest.java)
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerClientTest.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerClientTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.transport.rmi;
+
+import java.util.Map;
+
+import org.jboss.remoting.transport.rmi.RMIServerInvoker;
+
+/**
+ * Unit test for JBREM-167.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 12, 2008
+ * </p>
+ */
+public class RMIInvokerOnewayNativeMarshallerClientTest
+extends RMIInvokerNativeMarshallerClientTest
+{
+ protected void addMetadata(Map metadata)
+ {
+ try
+ {
+ metadata.put(RMIServerInvoker.RMI_ONEWAY_MARSHALLING, "true");
+ }
+ catch (NoSuchFieldError e)
+ {
+ // For versioning tests.
+ System.out.println(e);
+ }
+ }
+}
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerServerTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerServerTest.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerServerTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.transport.rmi;
+
+import java.util.Map;
+
+import org.jboss.remoting.transport.rmi.RMIServerInvoker;
+
+
+/**
+ * Unit test for JBREM-167.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 12, 2008
+ * </p>
+ */
+public class RMIInvokerOnewayNativeMarshallerServerTest
+extends RMIInvokerNativeMarshallerServerTest
+{
+ protected void addMetadata(Map metadata)
+ {
+ try
+ {
+ metadata.put(RMIServerInvoker.RMI_ONEWAY_MARSHALLING, "true");
+ }
+ catch (NoSuchFieldError e)
+ {
+ // For versioning tests.
+ System.out.println(e);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ RMIInvokerOnewayNativeMarshallerServerTest server = new RMIInvokerOnewayNativeMarshallerServerTest();
+ try
+ {
+ server.setUp();
+ Thread.currentThread().sleep(6000000);
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayNativeMarshallerTestCase.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.transport.rmi;
+
+import org.jboss.test.remoting.transport.InvokerTestDriver;
+
+/**
+ * Unit test for JBREM-167.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 12, 2008
+ * </p>
+ */
+public class RMIInvokerOnewayNativeMarshallerTestCase extends InvokerTestDriver
+{
+ public void declareTestClasses()
+ {
+ addTestClasses(RMIInvokerOnewayNativeMarshallerClientTest.class.getName(),
+ 1,
+ RMIInvokerOnewayNativeMarshallerServerTest.class.getName());
+ }
+}
\ No newline at end of file
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerClientTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerClientTest.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerClientTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.transport.rmi;
+
+import java.util.Map;
+
+import org.jboss.remoting.transport.rmi.RMIServerInvoker;
+
+/**
+ * This is the actual concrete test for the invoker client.
+ *
+ * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
+ */
+public class RMIInvokerOnewaySerializableMarshallerClientTest
+extends RMIInvokerSerializableMarshallerClientTest
+{
+ protected void addMetadata(Map metadata)
+ {
+ super.addMetadata(metadata);
+ try
+ {
+ metadata.put(RMIServerInvoker.RMI_ONEWAY_MARSHALLING, "true");
+ }
+ catch (NoSuchFieldError e)
+ {
+ // For versioning tests.
+ System.out.println(e);
+ }
+ }
+}
Copied: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerServerTest.java (from rev 3661, remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingServerTest.java)
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerServerTest.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerServerTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.transport.rmi;
+
+import java.util.Map;
+
+import org.jboss.remoting.transport.rmi.RMIServerInvoker;
+
+
+/**
+ * Unit test for JBREM-167.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 12, 2008
+ * </p>
+ */
+public class RMIInvokerOnewaySerializableMarshallerServerTest
+extends RMIInvokerSerializableMarshallerServerTest
+{
+ protected void addMetadata(Map metadata)
+ {
+ super.addMetadata(metadata);
+ try
+ {
+ metadata.put(RMIServerInvoker.RMI_ONEWAY_MARSHALLING, "true");
+ }
+ catch (NoSuchFieldError e)
+ {
+ // For versioning tests.
+ System.out.println(e);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ RMIInvokerOnewaySerializableMarshallerServerTest server = new RMIInvokerOnewaySerializableMarshallerServerTest();
+ try
+ {
+ server.setUp();
+ Thread.currentThread().sleep(6000000);
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
Copied: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerTestCase.java (from rev 3661, remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewayMarshallingTestCase.java)
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerOnewaySerializableMarshallerTestCase.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.transport.rmi;
+
+import org.jboss.test.remoting.transport.InvokerTestDriver;
+
+/**
+ * Unit test for JBREM-167.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 12, 2008
+ * </p>
+ */
+public class RMIInvokerOnewaySerializableMarshallerTestCase extends InvokerTestDriver
+{
+ public void declareTestClasses()
+ {
+ addTestClasses(RMIInvokerOnewaySerializableMarshallerClientTest.class.getName(),
+ 1,
+ RMIInvokerOnewaySerializableMarshallerServerTest.class.getName());
+ }
+}
\ No newline at end of file
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerSerializableMarshallerClientTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerSerializableMarshallerClientTest.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerSerializableMarshallerClientTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -22,409 +22,21 @@
package org.jboss.test.remoting.transport.rmi;
-import junit.framework.TestCase;
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
+import java.util.Map;
+
import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.invocation.NameBasedInvocation;
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
-import org.jboss.remoting.transport.Connector;
-import org.jboss.remoting.transport.rmi.RMIServerInvoker;
-import org.jboss.test.remoting.ComplexReturn;
-import org.jboss.test.remoting.TestUtil;
-import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
-import org.jboss.test.remoting.performance.synchronous.PerformanceTestCase;
-import org.jboss.test.remoting.transport.mock.MockInvokerCallbackHandler;
-import org.jboss.test.remoting.transport.mock.MockTest;
-import org.w3c.dom.Document;
-import javax.xml.parsers.DocumentBuilderFactory;
-import java.io.ByteArrayInputStream;
-import java.rmi.MarshalledObject;
-import java.rmi.server.UID;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
/**
* This is the actual concrete test for the invoker client.
*
* @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
*/
-public class RMIInvokerSerializableMarshallerClientTest extends TestCase
+public class RMIInvokerSerializableMarshallerClientTest
+extends RMIInvokerNativeMarshallerClientTest
{
-
- private String sessionId = new UID().toString();
- private Client client;
- private Connector connector;
- private InvokerLocator locator;
- private int port = RMIServerInvoker.DEFAULT_REGISTRY_PORT - 1;
- protected String transport = "rmi";
-
- private static final Logger log = Logger.getLogger(RMIInvokerSerializableMarshallerClientTest.class);
-
- public void init(Map metadata)
+ protected void addMetadata(Map metadata)
{
- try
- {
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metadata, this.port));
- //InvokerLocator locator = new InvokerLocator(getTransport() + "://localhost:" + port);
- System.out.println("client locator: " + locator);
- client = new Client(locator, "mock");
- client.connect();
- }
- catch(Exception e)
- {
- log.error(e.getMessage(), e);
- }
+ metadata.put(InvokerLocator.DATATYPE, SerializableMarshaller.DATATYPE);
}
-
- private String buildLocatorURI(Map metadata, int port)
- {
- if(metadata == null || metadata.size() == 0)
- {
- return transport + "://localhost:" + port;
- }
- else
- {
- StringBuffer uriBuffer = new StringBuffer(transport + "://localhost:" + port);
-
- Set keys = metadata.keySet();
- if(keys.size() > 0)
- {
- uriBuffer.append("/?");
- }
-
- Iterator itr = keys.iterator();
- while(itr.hasNext())
- {
- String key = (String) itr.next();
- String value = (String) metadata.get(key);
- uriBuffer.append(key + "=" + value + "&");
- }
- return uriBuffer.substring(0, uriBuffer.length() - 1);
- }
- }
-
- private InvokerLocator initServer(Map metadata, int serverPort) throws Exception
- {
- if(serverPort < 0)
- {
- serverPort = TestUtil.getRandomPort();
- }
- log.debug("port = " + serverPort);
-
-// InvokerRegistry.registerInvoker("mock", MockClientInvoker.class, MockServerInvoker.class);
- connector = new Connector();
-
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metadata, serverPort));
- System.out.println("Server locator: " + locator);
-
- //InvokerLocator locator = new InvokerLocator(transport + "://localhost:" + port);
- StringBuffer buf = new StringBuffer();
- buf.append("<?xml version=\"1.0\"?>\n");
- buf.append("<handlers>\n");
- buf.append(" <handler subsystem=\"mock\">org.jboss.test.remoting.transport.mock.MockServerInvocationHandler</handler>\n");
- buf.append("</handlers>\n");
- Document xml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(buf.toString().getBytes()));
- connector.setInvokerLocator(locator.getLocatorURI());
- connector.setConfiguration(xml.getDocumentElement());
- //connector.create();
- connector.start();
- return locator;
- }
-
-
- public void setUp(boolean withNativeMarshaller) throws Exception
- {
- Map metadata = new HashMap();
- String newMetadata = System.getProperty(PerformanceTestCase.REMOTING_METADATA);
- if(newMetadata != null && newMetadata.length() > 0)
- {
- metadata.putAll(PerformanceServerTest.parseMetadataString(newMetadata));
- }
-
- metadata.put(RMIServerInvoker.REGISTRY_PORT_KEY, String.valueOf(port + 1));
- locator = initServer(metadata, -1);
- if(!withNativeMarshaller)
- {
- metadata.put(InvokerLocator.DATATYPE, SerializableMarshaller.DATATYPE);
- }
- init(metadata);
- log.info("Using metadata: " + metadata);
- }
-
- public void tearDown() throws Exception
- {
- if(connector != null)
- {
- connector.stop();
- connector.destroy();
- connector = null;
- }
- locator = null;
- if(client != null)
- {
- client.disconnect();
- client = null;
- }
- }
-
- /**
- * Test simple invocation and adding of listener with push callback (meaning server
- * will send callback message when it gets it) to a local callback server
- *
- * @throws Throwable
- */
- public void testLocalPushCallbackWithDatatype() throws Throwable
- {
- setUp(false);
- runLocalPushCallback();
- }
-
- public void runLocalPushCallback() throws Throwable
- {
- log.debug("running testLocalPushCallback()");
-
- sessionId = new UID().toString();
-
- sessionId = client.getSessionId();
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- log.debug("client.getInvoker().getLocator()" + client.getInvoker().getLocator());
-
- // simple invoke, should return bar
- Object ret = makeInvocation("foo", "bar");
- assertTrue("Result of testLocalPushCallback() invocation of foo.", "bar".equals(ret));
- client.addListener(handler, locator);
- // invoke which should cause callback
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(3000);
- log.debug("done sleeping.");
- int callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbacksPerformed after adding listener is " + callbacksPerformed);
- assertTrue("Result of testLocalPushCallback() failed since did not get callback.",
- (callbacksPerformed == 1));
- // Can now call direct on client
- client.removeListener(handler);
- // shouldn't get callback now since removed listener
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- log.debug("done sleeping.");
- callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbackPerformed after removing listener is " + callbacksPerformed);
- assertTrue("Result of testLocalPushCallback() failed since did get callback " +
- "but have been removed as listener.",
- (callbacksPerformed == 1));
- }
-
- /**
- * Test simple invocation and adding of listener with push callback (meaning server
- * will send callback message when it gets it) to a remote callback server
- *
- * @throws Throwable
- */
- public void testRemotePushCallbackWithDataType() throws Throwable
- {
- setUp(false);
- runRemotePushCallback();
- }
-
- public void runRemotePushCallback() throws Throwable
- {
- log.debug("running testRemotePushCallback()");
-
- sessionId = new UID().toString();
- //InvokerLocator locator = client.getInvoker().getLocator();
- sessionId = client.getSessionId();
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- log.debug("client.getInvoker().getLocator()" + client.getInvoker().getLocator());
-
- // simple invoke, should return bar
- Object ret = makeInvocation("foo", "bar");
- assertTrue("Result of testRemotePushCallback() invocation of foo.", "bar".equals(ret));
- client.addListener(handler, locator);
- // invoke which should cause callback
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(3000);
- log.debug("done sleeping.");
- // TODO: No way to currently check the remote callback handler
- // to see if it got callback -TME
- /*
- int callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbacksPerformed after adding listener is " + callbacksPerformed);
- assertTrue("Result of testRemotePushCallback() failed since did not get callback.",
- (callbacksPerformed == 1));
- */
- // Can now call direct on client
- client.removeListener(handler);
- // shouldn't get callback now since removed listener
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- log.debug("done sleeping.");
- /*
- callbacksPerformed = handler.isCallbackReceived();
- log.debug("callbackPerformed after removing listener is " + callbacksPerformed);
- assertTrue("Result of testRemotePushCallback() failed since did get callback " +
- "but have been removed as listener.",
- (callbacksPerformed == 1));
- */
- }
-
- /**
- * Tests simple invocation and pull callbacks. Meaning will add a listener and
- * will then have to get the callbacks from the server.
- *
- * @throws Throwable
- */
- public void testPullCallbackWithDataType() throws Throwable
- {
- setUp(false);
- runPullCallback();
- }
-
- public void runPullCallback() throws Throwable
- {
- log.debug("running testPullCallback()");
-
- // should be null by default, since don't have connector started, but setting anyway
- //client.setClientLocator(null);
-
- MockInvokerCallbackHandler handler = new MockInvokerCallbackHandler(sessionId);
-
- // simple invoke, should return bar
- Object ret = makeInvocation("bar", "foo");
- assertTrue("Result of runPullCallbackTest() invocation of bar.", "foo".equals(ret));
- client.addListener(handler);
- // invoke which should cause callback on server side
- ret = makeInvocation("test", "test");
- // allow time for callback
- Thread.sleep(2000);
- ret = client.getCallbacks(handler);
- log.debug("getCallbacks returned " + ret);
- log.debug("should have something.");
- assertTrue("Result of runPullCallbackTest() getCallbacks() after add listener.",
- ret != null);
- // can now call directly on client
- //ret = makeInvocation("removeListener", null);
- client.removeListener(handler);
- ret = makeInvocation("getCallbacks", null);
- log.debug("getCallbacks returned " + ret);
- log.debug("should have been empty.");
- assertTrue("Result of runPullCallbackTest() getCallbacks() after remove listener.",
- ret == null);
- }
-
- /**
- * Tests complex invocation to get object containing array of complex objects.
- *
- * @throws Throwable
- */
- public void testArrayReturnWithDataType() throws Throwable
- {
- setUp(false);
- runArrayReturn();
- }
-
- public void runArrayReturn() throws Throwable
- {
- // simple invoke, should return bar
- Object ret = makeInvocation("testComplexReturn", null);
- ComplexReturn complexRet = (ComplexReturn) ret;
- MockTest[] mockTests = complexRet.getMockTests();
- assertTrue("ComplexReturn's array should contain 2 items",
- 2 == mockTests.length);
- for(int x = 0; x < mockTests.length; x++)
- {
- System.err.println(mockTests[x]);
- MockTest test = mockTests[x];
- assertNotNull("MockTest should not be null", test);
- }
-
-// assertTrue("Result of runPullCallbackTest() invocation of bar.",
-// "foo".equals(ret));
- }
-
- /**
- * Tests complex invocation to get marshalled object.
- *
- * @throws Throwable
- */
- public void testMarshalledObjectReturnWithDataType() throws Throwable
- {
- setUp(false);
- runMarshalledObjectReturn();
- }
-
- public void runMarshalledObjectReturn() throws Throwable
- {
- // simple invoke, should return bar
- Object ret = makeInvocation("testMarshalledObject", null);
- ret = ((MarshalledObject) ret).get();
- ComplexReturn complexRet = (ComplexReturn) ret;
- MockTest[] mockTests = complexRet.getMockTests();
- assertTrue("ComplexReturn's array should contain 2 items",
- 2 == mockTests.length);
- for(int x = 0; x < mockTests.length; x++)
- {
- System.err.println(mockTests[x]);
- MockTest test = mockTests[x];
- assertNotNull("MockTest should not be null", test);
- }
-
-// assertTrue("Result of runPullCallbackTest() invocation of bar.",
-// "foo".equals(ret));
- }
-
- private Object makeInvocation(String method, String param) throws Throwable
- {
- Object ret = client.invoke(new NameBasedInvocation(method,
- new Object[]{param},
- new String[]{String.class.getName()}),
- null);
-
- return ret;
- }
-
-// public static void main(String[] args)
-// {
-// RMIInvokerClientTest client = new RMIInvokerClientTest();
-// try
-// {
-// client.setUp();
-// client.testArrayReturn();
-// client.testArrayReturnWithDataType();
-// client.testLocalPushCallback();
-// client.testLocalPushCallbackWithDatatype();
-// client.testMarshalledObjectReturn();
-// client.testMarshalledObjectReturnWithDataType();
-// client.testPullCallback();
-// client.testPullCallbackWithDataType();
-// client.testRemotePushCallback();
-// client.testRemotePushCallbackWithDataType();
-// }
-// catch (Throwable throwable)
-// {
-// throwable.printStackTrace();
-// }
-// finally
-// {
-// try
-// {
-// client.tearDown();
-// }
-// catch (Exception e)
-// {
-// e.printStackTrace();
-// }
-// }
-//
-// }
-
}
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerSerializableMarshallerServerTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerSerializableMarshallerServerTest.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerSerializableMarshallerServerTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -22,21 +22,10 @@
package org.jboss.test.remoting.transport.rmi;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
-import java.util.Set;
-import org.jboss.jrunit.extensions.ServerTestCase;
-import org.jboss.logging.Logger;
+
import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.ServerInvocationHandler;
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
-import org.jboss.remoting.transport.Connector;
-import org.jboss.remoting.transport.rmi.RMIServerInvoker;
-import org.jboss.test.remoting.TestUtil;
-import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
-import org.jboss.test.remoting.performance.synchronous.PerformanceTestCase;
-import org.jboss.test.remoting.transport.mock.MockServerInvocationHandler;
/**
@@ -44,89 +33,14 @@
*
* @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
*/
-public class RMIInvokerSerializableMarshallerServerTest extends ServerTestCase
+public class RMIInvokerSerializableMarshallerServerTest extends RMIInvokerNativeMarshallerServerTest
{
- private int port = RMIServerInvoker.DEFAULT_REGISTRY_PORT - 1;
- protected String transport = "rmi";
- private Connector connector;
-
- private static final Logger log = Logger.getLogger(RMIInvokerSerializableMarshallerServerTest.class);
-
- public void init(Map metatdata) throws Exception
+ protected void addMetadata(Map metadata)
{
- if(port < 0)
- {
- port = TestUtil.getRandomPort();
- }
- log.debug("port = " + port);
-
- connector = new Connector();
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metatdata));
- System.out.println("server locator: " + locator);
- connector.setInvokerLocator(locator.getLocatorURI());
- connector.start();
- connector.addInvocationHandler(getSubsystem(), getServerInvocationHandler());
- }
-
- private String buildLocatorURI(Map metadata)
- {
- if(metadata == null || metadata.size() == 0)
- {
- return transport + "://localhost:" + port;
- }
- else
- {
- StringBuffer uriBuffer = new StringBuffer(transport + "://localhost:" + port);
-
- Set keys = metadata.keySet();
- if(keys.size() > 0)
- {
- uriBuffer.append("/?");
- }
-
- Iterator itr = keys.iterator();
- while(itr.hasNext())
- {
- String key = (String) itr.next();
- String value = (String) metadata.get(key);
- uriBuffer.append(key + "=" + value + "&");
- }
- return uriBuffer.substring(0, uriBuffer.length() - 1);
- }
- }
-
- protected String getSubsystem()
- {
- return "mock";
- }
-
- protected ServerInvocationHandler getServerInvocationHandler()
- {
- return new MockServerInvocationHandler();
- }
-
- public void setUp() throws Exception
- {
- Map metadata = new HashMap();
- String newMetadata = System.getProperty(PerformanceTestCase.REMOTING_METADATA);
- if(newMetadata != null && newMetadata.length() > 0)
- {
- metadata.putAll(PerformanceServerTest.parseMetadataString(newMetadata));
- }
- metadata.put(RMIServerInvoker.REGISTRY_PORT_KEY, String.valueOf(port + 1));
metadata.put(InvokerLocator.DATATYPE, SerializableMarshaller.DATATYPE);
- init(metadata);
}
+
- public void tearDown() throws Exception
- {
- if(connector != null)
- {
- connector.stop();
- connector.destroy();
- }
- }
-
public static void main(String[] args)
{
RMIInvokerSerializableMarshallerServerTest server = new RMIInvokerSerializableMarshallerServerTest();
@@ -140,6 +54,4 @@
e.printStackTrace();
}
}
-
-
}
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerServerTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerServerTest.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerServerTest.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -1,145 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.test.remoting.transport.rmi;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.jboss.jrunit.extensions.ServerTestCase;
-import org.jboss.logging.Logger;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.ServerInvocationHandler;
-import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
-import org.jboss.remoting.transport.Connector;
-import org.jboss.remoting.transport.rmi.RMIServerInvoker;
-import org.jboss.test.remoting.TestUtil;
-import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
-import org.jboss.test.remoting.performance.synchronous.PerformanceTestCase;
-import org.jboss.test.remoting.transport.mock.MockServerInvocationHandler;
-
-
-/**
- * This is the concrete test for invoker server.
- *
- * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
- */
-public class RMIInvokerServerTest extends ServerTestCase
-{
- private int port = RMIServerInvoker.DEFAULT_REGISTRY_PORT - 1;
- protected String transport = "rmi";
- private Connector connector;
-
- private static final Logger log = Logger.getLogger(RMIInvokerServerTest.class);
-
- public void init(Map metatdata) throws Exception
- {
- if(port < 0)
- {
- port = TestUtil.getRandomPort();
- }
- log.debug("port = " + port);
-
- connector = new Connector();
- InvokerLocator locator = new InvokerLocator(buildLocatorURI(metatdata));
- System.out.println("server locator: " + locator);
- connector.setInvokerLocator(locator.getLocatorURI());
- connector.start();
- connector.addInvocationHandler(getSubsystem(), getServerInvocationHandler());
- }
-
- private String buildLocatorURI(Map metadata)
- {
- if(metadata == null || metadata.size() == 0)
- {
- return transport + "://localhost:" + port;
- }
- else
- {
- StringBuffer uriBuffer = new StringBuffer(transport + "://localhost:" + port + "/?");
-
- Set keys = metadata.keySet();
- if(keys.size() > 0)
- {
- uriBuffer.append("/?");
- }
-
- Iterator itr = keys.iterator();
- while(itr.hasNext())
- {
- String key = (String) itr.next();
- String value = (String) metadata.get(key);
- uriBuffer.append(key + "=" + value + "&");
- }
- return uriBuffer.substring(0, uriBuffer.length() - 1);
- }
- }
-
- protected String getSubsystem()
- {
- return "mock";
- }
-
- protected ServerInvocationHandler getServerInvocationHandler()
- {
- return new MockServerInvocationHandler();
- }
-
- public void setUp() throws Exception
- {
- Map metadata = new HashMap();
- String newMetadata = System.getProperty(PerformanceTestCase.REMOTING_METADATA);
- if(newMetadata != null && newMetadata.length() > 0)
- {
- metadata.putAll(PerformanceServerTest.parseMetadataString(newMetadata));
- }
- metadata.put(RMIServerInvoker.REGISTRY_PORT_KEY, String.valueOf(port + 1));
- metadata.put(InvokerLocator.DATATYPE, SerializableMarshaller.DATATYPE);
- init(metadata);
- }
-
- public void tearDown() throws Exception
- {
- if(connector != null)
- {
- connector.stop();
- connector.destroy();
- }
- }
-
- public static void main(String[] args)
- {
- RMIInvokerServerTest server = new RMIInvokerServerTest();
- try
- {
- server.setUp();
- Thread.currentThread().sleep(6000000);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
-
-
-}
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerTestCase.java 2008-03-20 04:31:28 UTC (rev 3667)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/RMIInvokerTestCase.java 2008-03-20 05:42:13 UTC (rev 3668)
@@ -1,43 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.test.remoting.transport.rmi;
-
-import org.jboss.test.remoting.transport.InvokerTestDriver;
-
-/**
- * This should be used as the main test case for the invoker client/server.
- * It will start one instance of the client and one of the server and will
- * gather the test results and report them in standard JUnit format. When
- * wanting to run JUnit test for invoker, this is the class to use.
- *
- * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
- */
-public class RMIInvokerTestCase extends InvokerTestDriver
-{
- public void declareTestClasses()
- {
- addTestClasses(RMIInvokerClientTest.class.getName(),
- 1,
- RMIInvokerServerTest.class.getName());
- }
-}
\ No newline at end of file
18 years, 1 month
JBoss Remoting SVN: r3667 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 00:31:28 -0400 (Thu, 20 Mar 2008)
New Revision: 3667
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java
Log:
JBREM-935: Changed version to 2.4.0.CR1.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-03-19 21:10:28 UTC (rev 3666)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-03-20 04:31:28 UTC (rev 3667)
@@ -32,7 +32,7 @@
public static final byte VERSION_2 = 2;
public static final byte VERSION_2_2 = 22;
- public static final String VERSION = "2.4.0.Beta2 (Pinto)";
+ public static final String VERSION = "2.4.0.CR1 (Pinto)";
private static final byte byteVersion = VERSION_2_2;
private static byte defaultByteVersion = byteVersion;
private static boolean performVersioning = true;
18 years, 1 month
JBoss Remoting SVN: r3666 - in remoting3/trunk: api/src/main/java/org/jboss/cx/remoting/spi/wrapper and 3 other directories.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-19 17:10:28 -0400 (Wed, 19 Mar 2008)
New Revision: 3666
Modified:
remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Endpoint.java
remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/wrapper/EndpointWrapper.java
remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/AbstractRealContext.java
remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreEndpoint.java
remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreOutboundContext.java
remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreSession.java
remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/protocol/LocalProtocolHandler.java
remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/protocol/LocalProtocolHandlerFactory.java
remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting.java
Log:
Get sessions to connect again
Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Endpoint.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Endpoint.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Endpoint.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -32,13 +32,12 @@
*
* @param remoteUri the URI of the server to connect to
* @param attributeMap the attribute map to use to configure this session
- * @param rootContext the (local side of the) root context for the new session
* @return a new session
*
* @throws RemotingException if there is a problem creating the session, or if the request or reply type does not
* match the remote service
*/
- <I, O> Session openSession(URI remoteUri, AttributeMap attributeMap, Context<I, O> rootContext) throws RemotingException;
+ Session openSession(URI remoteUri, AttributeMap attributeMap) throws RemotingException;
/**
* Open an inbound session from another endpoint. Used by protocol handlers.
@@ -46,10 +45,9 @@
* You must have the TODO permission to invoke this method.
*
* @param handler the protocol handler to use
- * @param rootContext the (local side of the) root context for this session
* @return the protocol context
*/
- <I, O> ProtocolContext openIncomingSession(ProtocolHandler handler, Context<I, O> rootContext) throws RemotingException;
+ ProtocolContext openIncomingSession(ProtocolHandler handler) throws RemotingException;
/**
* Get the name of this endpoint.
Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/wrapper/EndpointWrapper.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/wrapper/EndpointWrapper.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/wrapper/EndpointWrapper.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -29,12 +29,12 @@
return delegate.getAttributes();
}
- public <I, O> Session openSession(final URI remoteUri, final AttributeMap attributeMap, final Context<I, O> rootContext) throws RemotingException {
- return delegate.openSession(remoteUri, attributeMap, rootContext);
+ public Session openSession(final URI remoteUri, final AttributeMap attributeMap) throws RemotingException {
+ return delegate.openSession(remoteUri, attributeMap);
}
- public <I, O> ProtocolContext openIncomingSession(final ProtocolHandler handler, final Context<I, O> rootContext) throws RemotingException {
- return delegate.openIncomingSession(handler, rootContext);
+ public ProtocolContext openIncomingSession(final ProtocolHandler handler) throws RemotingException {
+ return delegate.openIncomingSession(handler);
}
public String getName() {
Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/AbstractRealContext.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/AbstractRealContext.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/AbstractRealContext.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -12,6 +12,9 @@
private ContextServer<I,O> contextServer;
protected AbstractRealContext(final ContextServer<I, O> contextServer) {
+ if (contextServer == null) {
+ throw new NullPointerException("contextServer is null");
+ }
this.contextServer = contextServer;
}
Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreEndpoint.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreEndpoint.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreEndpoint.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -38,6 +38,7 @@
public final class CoreEndpoint {
private final String name;
+ private final RequestListener<?, ?> rootListener;
private final Endpoint userEndpoint = new UserEndpoint();
private final AtomicStateMachine<State> state = AtomicStateMachine.start(State.INITIAL);
@@ -54,8 +55,9 @@
DOWN,
}
- public CoreEndpoint(final String name) {
+ public CoreEndpoint(final String name, final RequestListener<?, ?> rootListener) {
this.name = name;
+ this.rootListener = rootListener;
}
private final ConcurrentMap<Object, Object> endpointMap = CollectionUtil.concurrentMap();
@@ -155,7 +157,7 @@
return endpointMap;
}
- public <I, O> Session openSession(final URI uri, final AttributeMap attributeMap, final Context<I, O> rootContext) throws RemotingException {
+ public Session openSession(final URI uri, final AttributeMap attributeMap) throws RemotingException {
final String scheme = uri.getScheme();
if (scheme == null) {
throw new RemotingException("No scheme on remote endpoint URI");
@@ -169,7 +171,7 @@
final ProtocolHandlerFactory factory = registration.getProtocolHandlerFactory();
try {
final CoreSession session = new CoreSession(CoreEndpoint.this);
- session.initializeClient(factory, uri, attributeMap, rootContext);
+ session.initializeClient(factory, uri, attributeMap, createContext(rootListener));
sessions.add(session);
return session.getUserSession();
} catch (IOException e) {
@@ -182,8 +184,16 @@
}
}
- public <I, O> ProtocolContext openIncomingSession(final ProtocolHandler handler, final Context<I, O> rootContext) throws RemotingException {
- return null;
+ public ProtocolContext openIncomingSession(final ProtocolHandler handler) throws RemotingException {
+ state.requireHold(State.UP);
+ try {
+ final CoreSession session = new CoreSession(CoreEndpoint.this);
+ session.initializeServer(handler, createContext(rootListener));
+ sessions.add(session);
+ return session.getProtocolContext();
+ } finally {
+ state.release();
+ }
}
public String getName() {
Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreOutboundContext.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreOutboundContext.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreOutboundContext.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -22,10 +22,10 @@
private final ConcurrentMap<Object, Object> contextMap = CollectionUtil.concurrentMap();
private final AtomicStateMachine<State> state = AtomicStateMachine.start(State.INITIAL);
- private final Context<I, O> userContext = new UserContext();
private final ContextClient contextClient = new ContextClientImpl();
private final Executor executor;
+ private Context<I, O> userContext;
private ContextServer<I, O> contextServer;
public CoreOutboundContext(final Executor executor) {
@@ -35,6 +35,7 @@
public void initialize(final ContextServer<I, O> contextServer) {
state.requireTransitionExclusive(State.INITIAL, State.UP);
this.contextServer = contextServer;
+ userContext = new UserContext();
state.releaseExclusive();
}
@@ -67,10 +68,11 @@
}
@SuppressWarnings ({"SerializableInnerClassWithNonSerializableOuterClass"})
- public final class UserContext implements Context<I, O>, Serializable {
+ public final class UserContext extends AbstractRealContext<I, O> implements Serializable {
private static final long serialVersionUID = 1L;
private UserContext() {
+ super(contextServer);
}
private Object writeReplace() {
Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreSession.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreSession.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreSession.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -103,21 +103,32 @@
// Initializers
private <I, O> void doInitialize(final ProtocolHandler protocolHandler, final Context<I, O> rootContext) {
+ if (protocolHandler == null) {
+ throw new NullPointerException("protocolHandler is null");
+ }
this.protocolHandler = protocolHandler;
if (rootContext instanceof AbstractRealContext) {
final AbstractRealContext<I, O> abstractRealContext = (AbstractRealContext<I, O>) rootContext;
// Forward local context
final ContextIdentifier localIdentifier = protocolHandler.getLocalRootContextIdentifier();
+ if (localIdentifier == null) {
+ throw new NullPointerException("localIdentifier is null");
+ }
final ProtocolContextClientImpl<I, O> contextClient = new ProtocolContextClientImpl<I, O>(localIdentifier);
serverContexts.put(localIdentifier, new ClientContextPair<I, O>(contextClient, abstractRealContext.getContextServer()));
+ log.trace("Initialized session with local context %s", localIdentifier);
}
// Forward remote context
final ContextIdentifier remoteIdentifier = protocolHandler.getRemoteRootContextIdentifier();
+ if (remoteIdentifier == null) {
+ throw new NullPointerException("remoteIdentifier is null");
+ }
final ProtocolContextServerImpl<I, O> contextServer = new ProtocolContextServerImpl<I,O>(remoteIdentifier);
clientContexts.put(remoteIdentifier, new WeakReference<ServerContextPair>(new ServerContextPair<I, O>(new BaseContextClient(), contextServer)));
final CoreOutboundContext<I, O> coreOutboundContext = new CoreOutboundContext<I, O>(executor);
coreOutboundContext.initialize(contextServer);
this.rootContext = coreOutboundContext.getUserContext();
+ log.trace("Initialized session with remote context %s", remoteIdentifier);
}
<I, O> void initializeServer(final ProtocolHandler protocolHandler, final Context<I, O> rootContext) {
@@ -172,12 +183,7 @@
private final ConcurrentMap<Object, Object> sessionMap = CollectionUtil.concurrentMap();
public void close() throws RemotingException {
- // todo -
- try {
- protocolHandler.closeSession();
- } catch (IOException e) {
- throw new RemotingException("Unable to close session: " + e.toString());
- }
+ shutdown();
// todo - should this be non-blocking?
state.waitFor(State.DOWN);
}
@@ -215,21 +221,49 @@
requestClient.handleReply((O)data);
}
+ // Lifecycle
+
+ private void shutdown() {
+ if (state.transition(State.UP, State.STOPPING)) {
+ try {
+ log.trace("Initiating session shutdown");
+ protocolHandler.closeSession();
+ } catch (IOException e) {
+ log.trace(e, "Protocol handler session close failed");
+ }
+ }
+ }
+
public final class ProtocolContextImpl implements ProtocolContext {
public void closeSession() {
- // todo ...
+ shutdown();
+ if (state.transition(State.STOPPING, State.DOWN)) {
+ log.trace("Session shut down");
+ }
}
public ObjectMessageOutput getMessageOutput(ByteMessageOutput target) throws IOException {
+ if (target == null) {
+ throw new NullPointerException("target is null");
+ }
return new ObjectMessageOutputImpl(target, streamDetectors, endpoint.getOrderedExecutor());
}
public ObjectMessageOutput getMessageOutput(ByteMessageOutput target, Executor streamExecutor) throws IOException {
+ if (target == null) {
+ throw new NullPointerException("target is null");
+ }
+ if (streamExecutor == null) {
+ throw new NullPointerException("streamExecutor is null");
+ }
return new ObjectMessageOutputImpl(target, streamDetectors, streamExecutor);
}
public ObjectMessageInput getMessageInput(ByteMessageInput source) throws IOException {
+ if (source == null) {
+ throw new NullPointerException("source is null");
+ }
return new ObjectMessageInputImpl(source);
}
@@ -238,6 +272,9 @@
}
public void receiveContextClose(ContextIdentifier remoteContextIdentifier, final boolean immediate, final boolean cancel, final boolean interrupt) {
+ if (remoteContextIdentifier == null) {
+ throw new NullPointerException("remoteContextIdentifier is null");
+ }
final ClientContextPair contextPair = serverContexts.remove(remoteContextIdentifier);
// todo - do the whole close operation
try {
@@ -248,11 +285,17 @@
}
public void closeStream(StreamIdentifier streamIdentifier) {
+ if (streamIdentifier == null) {
+ throw new NullPointerException("streamIdentifier is null");
+ }
final CoreStream coreStream = streams.remove(streamIdentifier);
// todo - shut down stream
}
public void receiveServiceClose(ServiceIdentifier serviceIdentifier) {
+ if (serviceIdentifier == null) {
+ throw new NullPointerException("serviceIdentifier is null");
+ }
final ClientServicePair servicePair = serverServices.remove(serviceIdentifier);
try {
servicePair.serviceServer.handleClose();
@@ -263,6 +306,12 @@
@SuppressWarnings ({"unchecked"})
public void receiveOpenedContext(ServiceIdentifier remoteServiceIdentifier, ContextIdentifier remoteContextIdentifier) {
+ if (remoteServiceIdentifier == null) {
+ throw new NullPointerException("remoteServiceIdentifier is null");
+ }
+ if (remoteContextIdentifier == null) {
+ throw new NullPointerException("remoteContextIdentifier is null");
+ }
try {
final ClientServicePair servicePair = serverServices.get(remoteServiceIdentifier);
final ProtocolContextClientImpl contextClient = new ProtocolContextClientImpl(remoteContextIdentifier);
@@ -275,6 +324,9 @@
}
public void receiveServiceClosing(ServiceIdentifier serviceIdentifier) {
+ if (serviceIdentifier == null) {
+ throw new NullPointerException("serviceIdentifier is null");
+ }
final WeakReference<ServerServicePair> ref = clientServices.get(serviceIdentifier);
final ServerServicePair servicePair = ref.get();
try {
@@ -285,6 +337,9 @@
}
public void receiveContextClosing(ContextIdentifier contextIdentifier, boolean done) {
+ if (contextIdentifier == null) {
+ throw new NullPointerException("contextIdentifier is null");
+ }
final WeakReference<ServerContextPair> ref = clientContexts.get(contextIdentifier);
final ServerContextPair contextPair = ref.get();
try {
@@ -295,6 +350,12 @@
}
public void receiveReply(ContextIdentifier contextIdentifier, RequestIdentifier requestIdentifier, Object reply) {
+ if (contextIdentifier == null) {
+ throw new NullPointerException("contextIdentifier is null");
+ }
+ if (requestIdentifier == null) {
+ throw new NullPointerException("requestIdentifier is null");
+ }
final WeakReference<ServerContextPair> ref = clientContexts.get(contextIdentifier);
final ServerContextPair contextPair = ref.get();
final RequestClient<?> requestClient = (RequestClient<?>) contextPair.contextServer.requests.get(requestIdentifier);
@@ -306,6 +367,15 @@
}
public void receiveException(ContextIdentifier contextIdentifier, RequestIdentifier requestIdentifier, RemoteExecutionException exception) {
+ if (contextIdentifier == null) {
+ throw new NullPointerException("contextIdentifier is null");
+ }
+ if (requestIdentifier == null) {
+ throw new NullPointerException("requestIdentifier is null");
+ }
+ if (exception == null) {
+ throw new NullPointerException("exception is null");
+ }
final WeakReference<ServerContextPair> ref = clientContexts.get(contextIdentifier);
final ServerContextPair contextPair = ref.get();
final RequestClient<?> requestClient = (RequestClient<?>) contextPair.contextServer.requests.get(requestIdentifier);
@@ -317,6 +387,12 @@
}
public void receiveCancelAcknowledge(ContextIdentifier contextIdentifier, RequestIdentifier requestIdentifier) {
+ if (contextIdentifier == null) {
+ throw new NullPointerException("contextIdentifier is null");
+ }
+ if (requestIdentifier == null) {
+ throw new NullPointerException("requestIdentifier is null");
+ }
final WeakReference<ServerContextPair> ref = clientContexts.get(contextIdentifier);
final ServerContextPair contextPair = ref.get();
final RequestClient<?> requestClient = (RequestClient<?>) contextPair.contextServer.requests.get(requestIdentifier);
@@ -328,6 +404,12 @@
}
public void receiveCancelRequest(ContextIdentifier remoteContextIdentifier, RequestIdentifier requestIdentifier, boolean mayInterrupt) {
+ if (remoteContextIdentifier == null) {
+ throw new NullPointerException("remoteContextIdentifier is null");
+ }
+ if (requestIdentifier == null) {
+ throw new NullPointerException("requestIdentifier is null");
+ }
final ClientContextPair contextPair = serverContexts.get(remoteContextIdentifier);
final RequestServer<?> requestServer = (RequestServer<?>) contextPair.contextClient.requests.get(requestIdentifier);
try {
@@ -338,6 +420,12 @@
}
public void receiveStreamData(StreamIdentifier streamIdentifier, ObjectMessageInput data) {
+ if (streamIdentifier == null) {
+ throw new NullPointerException("streamIdentifier is null");
+ }
+ if (data == null) {
+ throw new NullPointerException("data is null");
+ }
final CoreStream coreStream = streams.get(streamIdentifier);
coreStream.receiveStreamData(data);
}
@@ -355,19 +443,21 @@
@SuppressWarnings ({"unchecked"})
public void receiveRequest(final ContextIdentifier remoteContextIdentifier, final RequestIdentifier requestIdentifier, final Object request) {
+ if (remoteContextIdentifier == null) {
+ throw new NullPointerException("remoteContextIdentifier is null");
+ }
+ if (requestIdentifier == null) {
+ throw new NullPointerException("requestIdentifier is null");
+ }
final ClientContextPair contextPair = serverContexts.get(remoteContextIdentifier);
- final RequestServer requestServer = (RequestServer) contextPair.contextClient.requests.get(requestIdentifier);
+ if (contextPair == null) {
+ log.trace("Received a request on an unknown context %s", remoteContextIdentifier);
+ return;
+ }
try {
- if (requestServer != null) {
- requestServer.handleRequest(request, executor);
- } else {
- log.trace("Got a request on an unknown context identifier (%s)", remoteContextIdentifier);
- try {
- protocolHandler.sendException(remoteContextIdentifier, requestIdentifier, new RemoteExecutionException("Received a request on an invalid context"));
- } catch (IOException e) {
- log.trace("Failed to send exception: %s", e.getMessage());
- }
- }
+ final RequestClient client = contextPair.contextClient.addClient(requestIdentifier);
+ final RequestServer requestServer = contextPair.contextServer.createNewRequest(client);
+ requestServer.handleRequest(request, executor);
} catch (RemotingException e) {
e.printStackTrace();
}
@@ -447,6 +537,9 @@
final StreamSerializerFactory factory = detector.detectStream(testObject);
if (factory != null) {
final StreamIdentifier streamIdentifier = protocolHandler.openStream();
+ if (streamIdentifier == null) {
+ throw new NullPointerException("streamIdentifier is null");
+ }
final CoreStream stream = new CoreStream(CoreSession.this, streamExecutor, streamIdentifier, factory, testObject);
if (streams.putIfAbsent(streamIdentifier, stream) != null) {
throw new IOException("Duplicate stream identifier encountered: " + streamIdentifier);
@@ -587,6 +680,12 @@
private final ContextServer<I, O> contextServer;
private ClientContextPair(final ProtocolContextClientImpl<I, O> contextClient, final ContextServer<I, O> contextServer) {
+ if (contextClient == null) {
+ throw new NullPointerException("contextClient is null");
+ }
+ if (contextServer == null) {
+ throw new NullPointerException("contextServer is null");
+ }
this.contextClient = contextClient;
this.contextServer = contextServer;
}
@@ -597,6 +696,12 @@
private final ProtocolServiceServerImpl<I, O> serviceServer;
private ServerServicePair(final ServiceClient serviceClient, final ProtocolServiceServerImpl<I, O> serviceServer) {
+ if (serviceClient == null) {
+ throw new NullPointerException("serviceClient is null");
+ }
+ if (serviceServer == null) {
+ throw new NullPointerException("serviceServer is null");
+ }
this.serviceClient = serviceClient;
this.serviceServer = serviceServer;
}
@@ -607,6 +712,12 @@
private final ServiceServer<I, O> serviceServer;
private ClientServicePair(final ProtocolServiceClientImpl serviceClient, final ServiceServer<I, O> serviceServer) {
+ if (serviceClient == null) {
+ throw new NullPointerException("serviceClient is null");
+ }
+ if (serviceServer == null) {
+ throw new NullPointerException("serviceServer is null");
+ }
this.serviceClient = serviceClient;
this.serviceServer = serviceServer;
}
@@ -616,6 +727,9 @@
private final ServiceIdentifier serviceIdentifier;
public ProtocolServiceClientImpl(final ServiceIdentifier serviceIdentifier) {
+ if (serviceIdentifier == null) {
+ throw new NullPointerException("serviceIdentifier is null");
+ }
this.serviceIdentifier = serviceIdentifier;
}
@@ -650,6 +764,9 @@
public ContextServer<I, O> createNewContext(final ContextClient client) throws RemotingException {
try {
final ContextIdentifier contextIdentifier = protocolHandler.openContext(serviceIdentifier);
+ if (contextIdentifier == null) {
+ throw new NullPointerException("contextIdentifier is null");
+ }
clientContexts.put(contextIdentifier, new WeakReference<ServerContextPair>(new ServerContextPair<I, O>(client, new ProtocolContextServerImpl<I, O>(contextIdentifier))));
return new ProtocolContextServerImpl<I, O>(contextIdentifier);
} catch (RemotingException e) {
@@ -742,6 +859,9 @@
public RequestServer<I> createNewRequest(final RequestClient<O> requestClient) throws RemotingException {
try {
final RequestIdentifier requestIdentifier = protocolHandler.openRequest(contextIdentifier);
+ if (requestIdentifier == null) {
+ throw new NullPointerException("requestIdentifier is null");
+ }
requests.put(requestIdentifier, requestClient);
return new ProtocolRequestServerImpl(requestIdentifier);
} catch (RemotingException e) {
Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/protocol/LocalProtocolHandler.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/protocol/LocalProtocolHandler.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/protocol/LocalProtocolHandler.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -6,6 +6,8 @@
import org.jboss.cx.remoting.spi.protocol.RequestIdentifier;
import org.jboss.cx.remoting.spi.protocol.ServiceIdentifier;
import org.jboss.cx.remoting.spi.protocol.StreamIdentifier;
+import org.jboss.cx.remoting.spi.protocol.SimpleContextIdentifier;
+import org.jboss.cx.remoting.spi.protocol.SimpleRequestIdentifier;
import org.jboss.cx.remoting.spi.ObjectMessageOutput;
import org.jboss.cx.remoting.util.AttributeMap;
import org.jboss.cx.remoting.RemoteExecutionException;
@@ -17,31 +19,41 @@
*
*/
public final class LocalProtocolHandler implements ProtocolHandler {
- public LocalProtocolHandler(final ProtocolContext context, final URI remoteUri, final AttributeMap attributeMap) {
+ private final ProtocolContext target;
+ private String remoteEndpointName;
+ private static final ContextIdentifier ROOT_IDENTIFIER = new SimpleContextIdentifier();
+ public LocalProtocolHandler(final ProtocolContext target, final String remoteEndpointName) {
+ this.target = target;
+ this.remoteEndpointName = remoteEndpointName;
}
public void sendReply(final ContextIdentifier remoteContextIdentifier, final RequestIdentifier requestIdentifier, final Object reply) throws IOException {
+ target.receiveReply(remoteContextIdentifier, requestIdentifier, reply);
}
public void sendException(final ContextIdentifier remoteContextIdentifier, final RequestIdentifier requestIdentifier, final RemoteExecutionException exception) throws IOException {
+ target.receiveException(remoteContextIdentifier, requestIdentifier, exception);
}
public void sendCancelAcknowledge(final ContextIdentifier remoteContextIdentifier, final RequestIdentifier requestIdentifier) throws IOException {
+ target.receiveCancelAcknowledge(remoteContextIdentifier, requestIdentifier);
}
public void sendServiceClosing(final ServiceIdentifier remoteServiceIdentifier) throws IOException {
+ target.receiveServiceClosing(remoteServiceIdentifier);
}
public void sendContextClosing(final ContextIdentifier remoteContextIdentifier, final boolean done) throws IOException {
+ target.receiveContextClosing(remoteContextIdentifier, done);
}
public ContextIdentifier getLocalRootContextIdentifier() {
- return null;
+ return ROOT_IDENTIFIER;
}
public ContextIdentifier getRemoteRootContextIdentifier() {
- return null;
+ return ROOT_IDENTIFIER;
}
public ContextIdentifier openContext(final ServiceIdentifier serviceIdentifier) throws IOException {
@@ -49,19 +61,23 @@
}
public void sendContextClose(final ContextIdentifier contextIdentifier, final boolean immediate, final boolean cancel, final boolean interrupt) throws IOException {
+ target.receiveContextClose(contextIdentifier, immediate, cancel, interrupt);
}
public RequestIdentifier openRequest(final ContextIdentifier contextIdentifier) throws IOException {
- return null;
+ return new SimpleRequestIdentifier();
}
public void sendServiceClose(final ServiceIdentifier serviceIdentifier) throws IOException {
+ target.receiveServiceClose(serviceIdentifier);
}
public void sendRequest(final ContextIdentifier contextIdentifier, final RequestIdentifier requestIdentifier, final Object request, final Executor streamExecutor) throws IOException {
+ target.receiveRequest(contextIdentifier, requestIdentifier, request);
}
public void sendCancelRequest(final ContextIdentifier contextIdentifier, final RequestIdentifier requestIdentifier, final boolean mayInterrupt) throws IOException {
+ target.receiveCancelRequest(contextIdentifier, requestIdentifier, mayInterrupt);
}
public ContextIdentifier openContext() throws IOException {
@@ -77,16 +93,19 @@
}
public void closeStream(final StreamIdentifier streamIdentifier) throws IOException {
+ // N/A
}
public ObjectMessageOutput sendStreamData(final StreamIdentifier streamIdentifier, final Executor streamExecutor) throws IOException {
+ // N/A
return null;
}
public void closeSession() throws IOException {
+ target.closeSession();
}
public String getRemoteEndpointName() {
- return null;
+ return remoteEndpointName;
}
}
Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/protocol/LocalProtocolHandlerFactory.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/protocol/LocalProtocolHandlerFactory.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/protocol/LocalProtocolHandlerFactory.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -18,20 +18,38 @@
public final class LocalProtocolHandlerFactory implements ProtocolHandlerFactory {
@SuppressWarnings ({"UnusedDeclaration"})
private final Endpoint endpoint;
+ private final String endpointName;
public LocalProtocolHandlerFactory(final Endpoint endpoint) {
this.endpoint = endpoint;
+ endpointName = endpoint.getName();
}
- private static final ConcurrentMap<String, LocalProtocolHandlerFactory> endpoints = CollectionUtil.concurrentMap();
+ private static final ConcurrentMap<String, Endpoint> endpoints = CollectionUtil.concurrentMap();
public boolean isLocal(final URI uri) {
return true;
}
- public ProtocolHandler createHandler(final ProtocolContext context, final URI remoteUri, final AttributeMap attributeMap) throws IOException {
-
- return new LocalProtocolHandler(context, remoteUri, attributeMap);
+ public ProtocolHandler createHandler(final ProtocolContext ourProtocolContext, final URI remoteUri, final AttributeMap attributeMap) throws IOException {
+ final String part = remoteUri.getSchemeSpecificPart();
+ final int index = part.indexOf(':');
+ final String otherEndpointName;
+ if (index == -1) {
+ otherEndpointName = part;
+ } else {
+ otherEndpointName = part.substring(0, index);
+ }
+ final Endpoint otherEndpoint = endpoints.get(otherEndpointName);
+ if (otherEndpoint == null) {
+ throw new RemotingException("No such local endpoint '" + otherEndpoint + "'");
+ }
+ final LocalProtocolHandler otherProtocolHandler = new LocalProtocolHandler(ourProtocolContext, otherEndpointName);
+ final ProtocolContext otherProtocolContext = otherEndpoint.openIncomingSession(otherProtocolHandler);
+ final LocalProtocolHandler ourProtocolHandler = new LocalProtocolHandler(otherProtocolContext, endpointName);
+ otherProtocolContext.openSession(endpointName);
+ ourProtocolContext.openSession(otherEndpointName);
+ return ourProtocolHandler;
}
public void close() {
@@ -43,6 +61,6 @@
final LocalProtocolHandlerFactory handlerFactory = new LocalProtocolHandlerFactory(endpoint);
final Registration registration = endpoint.registerProtocol("local", handlerFactory);
registration.start();
- endpoints.putIfAbsent(name, handlerFactory);
+ endpoints.putIfAbsent(name, endpoint);
}
}
Modified: remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting.java
===================================================================
--- remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting.java 2008-03-19 07:40:40 UTC (rev 3665)
+++ remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting.java 2008-03-19 21:10:28 UTC (rev 3666)
@@ -13,8 +13,8 @@
public final class Remoting {
private static final Logger log = Logger.getLogger(Remoting.class);
- public static Endpoint createEndpoint(String name) throws RemotingException {
- final CoreEndpoint coreEndpoint = new CoreEndpoint(name);
+ public static <I, O> Endpoint createEndpoint(String name, RequestListener<I, O> listener) throws RemotingException {
+ final CoreEndpoint coreEndpoint = new CoreEndpoint(name, listener);
final ExecutorService executorService = Executors.newCachedThreadPool();
coreEndpoint.setExecutor(executorService);
coreEndpoint.start();
18 years, 1 month