JBoss Remoting SVN: r5256 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 20:39:21 -0400 (Sat, 16 May 2009)
New Revision: 5256
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java
Log:
JBREM-1102: Uses passConfigMapToMarshalFactory variable.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java 2009-05-17 00:39:00 UTC (rev 5255)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java 2009-05-17 00:39:21 UTC (rev 5256)
@@ -999,9 +999,24 @@
configMap = invoker.getConfiguration();
}
+ boolean passConfigMapToMarshalFactory = false;
+ if (configMap != null)
+ {
+ Object o = configMap.get(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY);
+ if (o instanceof String)
+ {
+ passConfigMapToMarshalFactory = Boolean.valueOf((String) o).booleanValue();
+ }
+ else if (o != null)
+ {
+ log.warn("Value of " + Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY + " should be of type String: " + o);
+ }
+ }
+
+ Map map = passConfigMapToMarshalFactory ? configMap : null;
if (unmarshaller == null)
{
- unmarshaller = MarshalFactory.getUnMarshaller(locator, classLoader, configMap);
+ unmarshaller = MarshalFactory.getUnMarshaller(locator, classLoader, map);
}
if (unmarshaller == null)
{
@@ -1010,7 +1025,7 @@
if (marshaller == null)
{
- marshaller = MarshalFactory.getMarshaller(locator, classLoader, configMap);
+ marshaller = MarshalFactory.getMarshaller(locator, classLoader, map);
}
if (marshaller == null)
{
13 years, 10 months
JBoss Remoting SVN: r5255 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 20:39:00 -0400 (Sat, 16 May 2009)
New Revision: 5255
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
Log:
JBREM-1102: Uses passConfigMapToMarshalFactory variable.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2009-05-17 00:38:33 UTC (rev 5254)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2009-05-17 00:39:00 UTC (rev 5255)
@@ -206,8 +206,9 @@
log.debug("Binding server to \"remoting/RMIServerInvoker/" + bindPort + "\" in registry");
rebind(registry, "remoting/RMIServerInvoker/" + bindPort, this);
ClassLoader classLoader = getClassLoader(RMIServerInvoker.class);
- unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), classLoader, configuration);
- marshaller = MarshalFactory.getMarshaller(getLocator(), classLoader, configuration);
+ Map map = passConfigMapToMarshalFactory ? configuration : null;
+ unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), classLoader, map);
+ marshaller = MarshalFactory.getMarshaller(getLocator(), classLoader, map);
}
13 years, 10 months
JBoss Remoting SVN: r5254 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 20:38:33 -0400 (Sat, 16 May 2009)
New Revision: 5254
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java
Log:
JBREM-1102: Added "passConfigMapToMarshalFactory" key.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java 2009-05-17 00:38:01 UTC (rev 5253)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java 2009-05-17 00:38:33 UTC (rev 5254)
@@ -120,4 +120,12 @@
*/
public static final String USE_CLIENT_CONNECTION_IDENTITY = "useClientConnectionIdentity";
// public static final String USE_SERVER_CONNECTION_IDENTITY = "useServerConnectionIdentity";
+
+ /**
+ * A flag for indicating that the Client configuration map should be used to configure
+ * marshallers and unmarshallers. If set to false (the default value), then parameters
+ * will be taken only from the InvokerLocator.
+ */
+ public static final String PASS_CONFIG_MAP_TO_MARSHAL_FACTORY = "passConfigMapToMarshalFactory";
}
+
13 years, 10 months
JBoss Remoting SVN: r5253 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 20:38:01 -0400 (Sat, 16 May 2009)
New Revision: 5253
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
Log:
JBREM-1102: Uses passConfigMapToMarshalFactory variable.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2009-05-17 00:23:16 UTC (rev 5252)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2009-05-17 00:38:01 UTC (rev 5253)
@@ -86,7 +86,8 @@
if (marshaller == null)
{
// try by locator (in case marshaller class name specified)
- marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader(), configuration);
+ Map map = passConfigMapToMarshalFactory ? configuration : null;
+ marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader(), map);
if (marshaller == null)
{
// need to have a marshaller, so create a default one
@@ -105,7 +106,8 @@
if (unmarshaller == null)
{
// try by locator (in case unmarshaller class name specified)
- unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), getClassLoader(), configuration);
+ Map map = passConfigMapToMarshalFactory ? configuration : null;
+ unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), getClassLoader(), map);
if (unmarshaller == null)
{
unmarshaller = MarshalFactory.getUnMarshaller(getDataType(), getSerializationType());
13 years, 10 months
JBoss Remoting SVN: r5252 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 20:23:16 -0400 (Sat, 16 May 2009)
New Revision: 5252
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java
Log:
JBREM-1102: Added passConfigMapToMarshalFactory variable.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java 2009-05-17 00:22:30 UTC (rev 5251)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java 2009-05-17 00:23:16 UTC (rev 5252)
@@ -66,6 +66,7 @@
protected Map configuration = new HashMap();
protected SocketFactory socketFactory;
protected int version;
+ protected boolean passConfigMapToMarshalFactory;
// Indicates if the serverSocketFactory was generated internally.
protected boolean socketFactoryCreatedFromSSLParameters;
@@ -160,6 +161,16 @@
log.warn(this + " value of " + Remoting.REMOTING_VERSION +
" must be a String: " + o + ". Using " + getVersion());
}
+
+ o = configuration.get(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY);
+ if (o instanceof String)
+ {
+ this.passConfigMapToMarshalFactory = Boolean.valueOf((String) o).booleanValue();
+ }
+ else if (o != null)
+ {
+ log.warn("value of " + Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY + " must be a String: " + o);
+ }
}
/**
13 years, 10 months
JBoss Remoting SVN: r5251 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 20:22:30 -0400 (Sat, 16 May 2009)
New Revision: 5251
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/BisocketConfigurationMapTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigTestMarshaller.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigTestUnmarshaller.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigurationMapTestParent.java
Log:
JBREM-1102: Added tests for case in which passing config map is turned off.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/BisocketConfigurationMapTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/BisocketConfigurationMapTestCase.java 2009-05-16 23:58:28 UTC (rev 5250)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/BisocketConfigurationMapTestCase.java 2009-05-17 00:22:30 UTC (rev 5251)
@@ -26,6 +26,7 @@
import org.apache.log4j.Logger;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Remoting;
import org.jboss.remoting.callback.Callback;
import org.jboss.remoting.callback.HandleCallbackException;
import org.jboss.remoting.callback.InvokerCallbackHandler;
@@ -49,7 +50,7 @@
return "bisocket";
}
- public void testDatatypeConfigWithCallbacks() throws Throwable
+ public void testDatatypeConfigWithCallbacksDefault() throws Throwable
{
log.info("entering " + getName());
@@ -80,8 +81,8 @@
client.addListener(callbackHandler, new HashMap());
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(12));
- assertTrue(ConfigTestUnmarshaller.ok(8));
+ assertTrue(ConfigTestMarshaller.ok(false, 4));
+ assertTrue(ConfigTestUnmarshaller.ok(false, 0));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
assertEquals(1, callbackHandler.counter);
@@ -92,12 +93,102 @@
}
- public void testFQNConfigWithCallbacks() throws Throwable
+ public void testDatatypeConfigWithCallbacksPassConfigMapFalse() throws Throwable
{
log.info("entering " + getName());
+ // Cache marshaller/unmarshaller.
+ MarshalFactory.addMarshaller("config", new ConfigTestMarshaller(), new ConfigTestUnmarshaller());
+
// Start server.
HashMap serverConfig = new HashMap();
+ serverConfig.put(InvokerLocator.DATATYPE, "config");
+ serverConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "false");
+ setupServer("x=y", serverConfig);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(InvokerLocator.DATATYPE, "config");
+ clientConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "false");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Configure callbacks.
+ TestCallbackHandler callbackHandler = new TestCallbackHandler();
+ client.addListener(callbackHandler, new HashMap());
+
+ // Do tests.
+ assertTrue(ConfigTestMarshaller.ok(false, 4));
+ assertTrue(ConfigTestUnmarshaller.ok(false, 0));
+ assertTrue(LocatorTestMarshaller.ok());
+ assertTrue(LocatorTestUnmarshaller.ok());
+ assertEquals(1, callbackHandler.counter);
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ public void testDatatypeConfigWithCallbacksPassConfigMapTrue() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Cache marshaller/unmarshaller.
+ MarshalFactory.addMarshaller("config", new ConfigTestMarshaller(), new ConfigTestUnmarshaller());
+
+ // Start server.
+ HashMap serverConfig = new HashMap();
+ serverConfig.put(InvokerLocator.DATATYPE, "config");
+ serverConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "true");
+ setupServer("x=y", serverConfig);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(InvokerLocator.DATATYPE, "config");
+ clientConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Configure callbacks.
+ TestCallbackHandler callbackHandler = new TestCallbackHandler();
+ client.addListener(callbackHandler, new HashMap());
+
+ // Do tests.
+ assertTrue(ConfigTestMarshaller.ok(true, 12));
+ assertTrue(ConfigTestUnmarshaller.ok(true, 8));
+ assertTrue(LocatorTestMarshaller.ok());
+ assertTrue(LocatorTestUnmarshaller.ok());
+ assertEquals(1, callbackHandler.counter);
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ public void testFQNConfigWithCallbacksDefault() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ HashMap serverConfig = new HashMap();
serverConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
serverConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
setupServer("x=y", serverConfig);
@@ -123,8 +214,8 @@
client.addListener(callbackHandler, new HashMap());
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(6));
- assertTrue(ConfigTestUnmarshaller.ok(4));
+ assertTrue(ConfigTestMarshaller.ok(false, 2));
+ assertTrue(ConfigTestUnmarshaller.ok(false, 0));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
assertEquals(1, callbackHandler.counter);
@@ -135,6 +226,96 @@
}
+ public void testFQNConfigWithCallbacksPassConfigMapFalse() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ HashMap serverConfig = new HashMap();
+ serverConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
+ serverConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
+ serverConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "false");
+ setupServer("x=y", serverConfig);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
+ clientConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
+ clientConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "false");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Do callback.
+ // Configure callbacks.
+ TestCallbackHandler callbackHandler = new TestCallbackHandler();
+ client.addListener(callbackHandler, new HashMap());
+
+ // Do tests.
+ assertTrue(ConfigTestMarshaller.ok(false, 2));
+ assertTrue(ConfigTestUnmarshaller.ok(false, 0));
+ assertTrue(LocatorTestMarshaller.ok());
+ assertTrue(LocatorTestUnmarshaller.ok());
+ assertEquals(1, callbackHandler.counter);
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ public void testFQNConfigWithCallbacksPassConfigMapTrue() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ HashMap serverConfig = new HashMap();
+ serverConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
+ serverConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
+ serverConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "true");
+ setupServer("x=y", serverConfig);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
+ clientConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
+ clientConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Do callback.
+ // Configure callbacks.
+ TestCallbackHandler callbackHandler = new TestCallbackHandler();
+ client.addListener(callbackHandler, new HashMap());
+
+ // Do tests.
+ assertTrue(ConfigTestMarshaller.ok(true, 6));
+ assertTrue(ConfigTestUnmarshaller.ok(true, 4));
+ assertTrue(LocatorTestMarshaller.ok());
+ assertTrue(LocatorTestUnmarshaller.ok());
+ assertEquals(1, callbackHandler.counter);
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
protected TestInvocationHandler getInvocationHandler()
{
return new BisocketTestInvocationHandler();
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigTestMarshaller.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigTestMarshaller.java 2009-05-16 23:58:28 UTC (rev 5250)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigTestMarshaller.java 2009-05-17 00:22:30 UTC (rev 5251)
@@ -57,10 +57,10 @@
return new ConfigTestMarshaller();
}
- public static boolean ok(int count)
+ public static boolean ok(boolean b, int count)
{
log.info("wrote: " + wrote + ", cloned: " + cloned);
- return wrote && cloned == count;
+ return wrote == b && cloned == count;
}
public static void reset()
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigTestUnmarshaller.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigTestUnmarshaller.java 2009-05-16 23:58:28 UTC (rev 5250)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigTestUnmarshaller.java 2009-05-17 00:22:30 UTC (rev 5251)
@@ -65,10 +65,10 @@
return ((Wrapper)o).wrappee;
}
- public static boolean ok(int count)
+ public static boolean ok(boolean b, int count)
{
log.info("read: " + read + ", cloned: " + cloned);
- return read && cloned == count;
+ return read == b && cloned == count;
}
public static void reset()
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigurationMapTestParent.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigurationMapTestParent.java 2009-05-16 23:58:28 UTC (rev 5250)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/config/ConfigurationMapTestParent.java 2009-05-17 00:22:30 UTC (rev 5251)
@@ -35,6 +35,7 @@
import org.jboss.logging.XLevel;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Remoting;
import org.jboss.remoting.marshal.MarshalFactory;
import org.jboss.remoting.transport.Connector;
import org.jboss.remoting.transport.PortUtil;
@@ -88,7 +89,7 @@
}
- public void testDatatypeConfig() throws Throwable
+ public void testDatatypeConfigDefault() throws Throwable
{
log.info("entering " + getName());
@@ -115,8 +116,8 @@
log.info("connection is good");
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(6));
- assertTrue(ConfigTestUnmarshaller.ok(4));
+ assertTrue(ConfigTestMarshaller.ok(false, marshallerDatatypeUnused()));
+ assertTrue(ConfigTestUnmarshaller.ok(false, 0));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
@@ -126,12 +127,92 @@
}
- public void testFQNConfig() throws Throwable
+ public void testDatatypePassConfigMapFalse() throws Throwable
{
log.info("entering " + getName());
+ // Cache marshaller/unmarshaller.
+ MarshalFactory.addMarshaller("config", new ConfigTestMarshaller(), new ConfigTestUnmarshaller());
+
// Start server.
HashMap serverConfig = new HashMap();
+ serverConfig.put(InvokerLocator.DATATYPE, "config");
+ serverConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "false");
+ setupServer("x=y", serverConfig);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(InvokerLocator.DATATYPE, "config");
+ clientConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "false");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Do tests.
+ assertTrue(ConfigTestMarshaller.ok(false, marshallerDatatypeUnused()));
+ assertTrue(ConfigTestUnmarshaller.ok(false, 0));
+ assertTrue(LocatorTestMarshaller.ok());
+ assertTrue(LocatorTestUnmarshaller.ok());
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ public void testDatatypePassConfigMapTrue() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Cache marshaller/unmarshaller.
+ MarshalFactory.addMarshaller("config", new ConfigTestMarshaller(), new ConfigTestUnmarshaller());
+
+ // Start server.
+ HashMap serverConfig = new HashMap();
+ serverConfig.put(InvokerLocator.DATATYPE, "config");
+ serverConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "true");
+ setupServer("x=y", serverConfig);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(InvokerLocator.DATATYPE, "config");
+ clientConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Do tests.
+ assertTrue(ConfigTestMarshaller.ok(true, marshallerCountDatatype()));
+ assertTrue(ConfigTestUnmarshaller.ok(true, unmarshallerCountDatatype()));
+ assertTrue(LocatorTestMarshaller.ok());
+ assertTrue(LocatorTestUnmarshaller.ok());
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ public void testFQNConfigDefault() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ HashMap serverConfig = new HashMap();
serverConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
serverConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
setupServer("x=y", serverConfig);
@@ -152,8 +233,8 @@
log.info("connection is good");
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(configTestMarshallerCount()));
- assertTrue(ConfigTestUnmarshaller.ok(configTestUnmarshallerCount()));
+ assertTrue(ConfigTestMarshaller.ok(false,marshallerFQNUnused()));
+ assertTrue(ConfigTestUnmarshaller.ok(false, 0));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
@@ -163,18 +244,116 @@
}
- protected int configTestMarshallerCount()
+
+
+ public void testFQNPassConfigMapFalse() throws Throwable
{
+ log.info("entering " + getName());
+
+ // Start server.
+ HashMap serverConfig = new HashMap();
+ serverConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
+ serverConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
+ serverConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "false");
+ setupServer("x=y", serverConfig);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
+ clientConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
+ clientConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "false");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Do tests.
+ assertTrue(ConfigTestMarshaller.ok(false, marshallerFQNUnused()));
+ assertTrue(ConfigTestUnmarshaller.ok(false, 0));
+ assertTrue(LocatorTestMarshaller.ok());
+ assertTrue(LocatorTestUnmarshaller.ok());
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ public void testFQNConfigPassConfigMapTrue() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ HashMap serverConfig = new HashMap();
+ serverConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
+ serverConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
+ serverConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "true");
+ setupServer("x=y", serverConfig);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(InvokerLocator.MARSHALLER, ConfigTestMarshaller.class.getName());
+ clientConfig.put(InvokerLocator.UNMARSHALLER, ConfigTestUnmarshaller.class.getName());
+ clientConfig.put(Remoting.PASS_CONFIG_MAP_TO_MARSHAL_FACTORY, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Do tests.
+ assertTrue(ConfigTestMarshaller.ok(true, marshallerCountFQN()));
+ assertTrue(ConfigTestUnmarshaller.ok(true, unmarshallerCountFQN()));
+ assertTrue(LocatorTestMarshaller.ok());
+ assertTrue(LocatorTestUnmarshaller.ok());
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ protected int marshallerCountDatatype()
+ {
+ return 6;
+ }
+
+ protected int unmarshallerCountDatatype()
+ {
+ return 4;
+ }
+
+ protected int marshallerCountFQN()
+ {
return 3;
}
+ protected int unmarshallerCountFQN()
+ {
+ return 2;
+ }
- protected int configTestUnmarshallerCount()
+ protected int marshallerDatatypeUnused()
{
return 2;
}
+
+ protected int marshallerFQNUnused()
+ {
+ return 1;
+ }
-
protected abstract String getTransport();
13 years, 10 months
JBoss Remoting SVN: r5250 - remoting2/branches/2.2.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 19:58:28 -0400 (Sat, 16 May 2009)
New Revision: 5250
Modified:
remoting2/branches/2.2/build.xml
Log:
JBREM-1102: Broke org.jboss.tests.remoting.transport.servlet.marshal into ...marshal.config and ...marshal.noconfig.
Modified: remoting2/branches/2.2/build.xml
===================================================================
--- remoting2/branches/2.2/build.xml 2009-05-16 23:52:54 UTC (rev 5249)
+++ remoting2/branches/2.2/build.xml 2009-05-16 23:58:28 UTC (rev 5250)
@@ -989,7 +989,8 @@
<antcall target="AS.start"/>
<antcall target="tests.servlet" inheritrefs="true"/>
<antcall target="tests.servlet.callback" inheritrefs="true"/>
- <antcall target="tests.servlet.marshal" inheritrefs="true"/>
+ <antcall target="tests.servlet.marshal.config" inheritrefs="true"/>
+ <antcall target="tests.servlet.marshal.noconfig" inheritrefs="true"/>
<antcall target="tests.servlet.nopreservelines" inheritrefs="true"/>
<antcall target="tests.servlet.preservelines" inheritrefs="true"/>
<antcall target="tests.servlet.ssl" inheritrefs="true"/>
@@ -1056,15 +1057,15 @@
<delete file="${jboss.deploy.dir}/remoting-servlet-service.xml"/>
</target>
- <target name="tests.servlet.marshal">
- <copy file="${servlet.tests.dir}/marshal/remoting-servlet-service.xml" todir="${jboss.deploy.dir}" overwrite="true"/>
+ <target name="tests.servlet.marshal.config">
+ <copy file="${servlet.tests.dir}/marshal/config/remoting-servlet-service.xml" todir="${jboss.deploy.dir}" overwrite="true"/>
<sleep seconds="4"/>
<copy todir="${jboss.deploy.dir}">
<fileset dir="${output.lib.dir}">
<include name="servlet-invoker.war/**"/>
</fileset>
</copy>
- <copy file="${servlet.tests.dir}/marshal/WEB-INF/web.xml"
+ <copy file="${servlet.tests.dir}/marshal/config/WEB-INF/web.xml"
todir="${jboss.deploy.dir}/servlet-invoker.war/WEB-INF" overwrite="true"/>
<sleep seconds="4"/>
<junit printsummary="true" fork="yes" includeantruntime="true">
@@ -1078,7 +1079,7 @@
extension="-java_serialization.xml"/>
<batchtest fork="yes" todir="${output.tests.results}" haltonfailure="no">
<fileset dir="${tests.compile.dir}">
- <include name="**/remoting/transport/servlet/marshal/*TestClient.class"/>
+ <include name="**/remoting/transport/servlet/marshal/config/*TestClient.class"/>
</fileset>
</batchtest>
</junit>
@@ -1086,6 +1087,36 @@
<delete file="${jboss.deploy.dir}/remoting-servlet-service.xml"/>
</target>
+ <target name="tests.servlet.marshal.noconfig">
+ <copy file="${servlet.tests.dir}/marshal/noconfig/remoting-servlet-service.xml" todir="${jboss.deploy.dir}" overwrite="true"/>
+ <sleep seconds="4"/>
+ <copy todir="${jboss.deploy.dir}">
+ <fileset dir="${output.lib.dir}">
+ <include name="servlet-invoker.war/**"/>
+ </fileset>
+ </copy>
+ <copy file="${servlet.tests.dir}/marshal/noconfig/WEB-INF/web.xml"
+ todir="${jboss.deploy.dir}/servlet-invoker.war/WEB-INF" overwrite="true"/>
+ <sleep seconds="4"/>
+ <junit printsummary="true" fork="yes" includeantruntime="true">
+ <jvmarg value="-Dloader.path=${output.lib.dir}/jboss-remoting-loading-tests.jar"/>
+ <jvmarg value="-D${remoting.metadata.key}=${metadata}"/>
+ <classpath>
+ <path refid="tests.classpath"/>
+ <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
+ </classpath>
+ <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
+ extension="-java_serialization.xml"/>
+ <batchtest fork="yes" todir="${output.tests.results}" haltonfailure="no">
+ <fileset dir="${tests.compile.dir}">
+ <include name="**/remoting/transport/servlet/marshal/noconfig/*TestClient.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ <delete dir="${jboss.deploy.dir}/servlet-invoker.war"/>
+ <delete file="${jboss.deploy.dir}/remoting-servlet-service.xml"/>
+ </target>
+
<target name="tests.servlet.nopreservelines">
<copy file="${servlet.tests.dir}/nopreservelines/remoting-servlet-service.xml" todir="${jboss.deploy.dir}" overwrite="true"/>
<sleep seconds="4"/>
13 years, 10 months
JBoss Remoting SVN: r5249 - remoting2/branches/2.2/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 19:52:54 -0400 (Sat, 16 May 2009)
New Revision: 5249
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/Version.java
Log:
JBREM-1131: Updated version to 2.2.3.
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/Version.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/Version.java 2009-05-16 23:51:24 UTC (rev 5248)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/Version.java 2009-05-16 23:52:54 UTC (rev 5249)
@@ -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.2.2.SP12";
+ public static final String VERSION = "2.2.3";
private static final byte byteVersion = VERSION_2_2;
private static byte defaultByteVersion = byteVersion;
private static boolean performVersioning = true;
13 years, 10 months
JBoss Remoting SVN: r5248 - remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/config/WEB-INF.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 19:51:24 -0400 (Sat, 16 May 2009)
New Revision: 5248
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/config/WEB-INF/web.xml
Log:
JBREM-1102: Broke org.jboss.tests.remoting.transport.servlet.marshal into ...marshal.config and ...marshal.noconfig.
Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/config/WEB-INF/web.xml
===================================================================
--- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/config/WEB-INF/web.xml 2009-05-16 23:48:57 UTC (rev 5247)
+++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/config/WEB-INF/web.xml 2009-05-16 23:51:24 UTC (rev 5248)
@@ -16,7 +16,7 @@
<servlet-class>org.jboss.remoting.transport.servlet.web.ServerInvokerServlet</servlet-class>
<init-param>
<param-name>locatorUrl</param-name>
- <param-value>servlet://localhost:8080/servlet-invoker/ServerInvokerServlet</param-value>
+ <param-value>servlet://localhost:8080/servlet-invoker/ServerInvokerServlet/?marshaller=org.jboss.test.remoting.marshall.config.ConfigTestMarshaller&unmarshaller=org.jboss.test.remoting.marshall.config.ConfigTestUnmarshaller</param-value>
<description>The servlet server invoker locator url</description>
</init-param>
<load-on-startup>1</load-on-startup>
13 years, 10 months
JBoss Remoting SVN: r5247 - remoting2/branches/2.2/src/tests/org/jboss/test/remoting/marshall/config.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-16 19:48:57 -0400 (Sat, 16 May 2009)
New Revision: 5247
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/marshall/config/ConfigurationMapTestParent.java
Log:
JBREM-1102: Made values overrideable for servlet tests.
Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/marshall/config/ConfigurationMapTestParent.java
===================================================================
--- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/marshall/config/ConfigurationMapTestParent.java 2009-05-16 23:47:03 UTC (rev 5246)
+++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/marshall/config/ConfigurationMapTestParent.java 2009-05-16 23:48:57 UTC (rev 5247)
@@ -116,7 +116,7 @@
log.info("connection is good");
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(false, 2));
+ assertTrue(ConfigTestMarshaller.ok(false, marshallerDatatypeUnused()));
assertTrue(ConfigTestUnmarshaller.ok(false, 0));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
@@ -156,7 +156,7 @@
log.info("connection is good");
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(false, 2));
+ assertTrue(ConfigTestMarshaller.ok(false, marshallerDatatypeUnused()));
assertTrue(ConfigTestUnmarshaller.ok(false, 0));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
@@ -196,8 +196,8 @@
log.info("connection is good");
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(true, 6));
- assertTrue(ConfigTestUnmarshaller.ok(true, 4));
+ assertTrue(ConfigTestMarshaller.ok(true, marshallerCountDatatype()));
+ assertTrue(ConfigTestUnmarshaller.ok(true, unmarshallerCountDatatype()));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
@@ -233,7 +233,7 @@
log.info("connection is good");
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(false, 1));
+ assertTrue(ConfigTestMarshaller.ok(false,marshallerFQNUnused()));
assertTrue(ConfigTestUnmarshaller.ok(false, 0));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
@@ -274,7 +274,7 @@
log.info("connection is good");
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(false, 1));
+ assertTrue(ConfigTestMarshaller.ok(false, marshallerFQNUnused()));
assertTrue(ConfigTestUnmarshaller.ok(false, 0));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
@@ -313,8 +313,8 @@
log.info("connection is good");
// Do tests.
- assertTrue(ConfigTestMarshaller.ok(true, configTestMarshallerCount()));
- assertTrue(ConfigTestUnmarshaller.ok(true, configTestUnmarshallerCount()));
+ assertTrue(ConfigTestMarshaller.ok(true, marshallerCountFQN()));
+ assertTrue(ConfigTestUnmarshaller.ok(true, unmarshallerCountFQN()));
assertTrue(LocatorTestMarshaller.ok());
assertTrue(LocatorTestUnmarshaller.ok());
@@ -323,19 +323,37 @@
log.info(getName() + " PASSES");
}
+
+ protected int marshallerCountDatatype()
+ {
+ return 6;
+ }
- protected int configTestMarshallerCount()
+ protected int unmarshallerCountDatatype()
{
+ return 4;
+ }
+
+ protected int marshallerCountFQN()
+ {
return 3;
}
+ protected int unmarshallerCountFQN()
+ {
+ return 2;
+ }
- protected int configTestUnmarshallerCount()
+ protected int marshallerDatatypeUnused()
{
return 2;
}
+
+ protected int marshallerFQNUnused()
+ {
+ return 1;
+ }
-
protected abstract String getTransport();
13 years, 10 months