Author: ron.sigal(a)jboss.com
Date: 2009-08-27 10:36:30 -0400 (Thu, 27 Aug 2009)
New Revision: 5397
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http/marshal/HttpContentTypeTestCase.java
Log:
JBREM-1145: (1) Changed test for InvocationResponse returned as String; (2) added
logging.
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http/marshal/HttpContentTypeTestCase.java
===================================================================
---
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http/marshal/HttpContentTypeTestCase.java 2009-08-27
04:33:11 UTC (rev 5396)
+++
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http/marshal/HttpContentTypeTestCase.java 2009-08-27
14:36:30 UTC (rev 5397)
@@ -114,27 +114,19 @@
HashMap clientConfig = new HashMap();
clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
addExtraClientConfig(clientConfig);
+ log.info("connecting to: " + serverLocator);
Client client = new Client(serverLocator, clientConfig);
client.connect();
- log.info("client is connected");
+ log.info("client is connected to " + serverLocator);
// Do invocation.
Object o = client.invoke("abc");
+
+ // Show that an InvocationResponse was incorrectly returned as a Strin..
assertTrue(o instanceof String);
String result = (String) o;
+ assertTrue(result.indexOf("org.jboss.remoting.InvocationResponse") >=
0);
- // Show that an InvocationResponse was returned as a String, starting with
- // the ObjectInputStream header bytes.
- byte[] bytes = result.getBytes();
- System.out.print("bytes: ");
- for (int i = 0; i < bytes.length; i++)
- System.out.print(bytes[i] + " ");
- System.out.println("");
- assertEquals(-84, bytes[0]);
- assertEquals(-19, bytes[1]);
- assertEquals(0, bytes[2]);
- assertEquals(5, bytes[3]);
-
// Check remoting content type handling.
validateOrdinaryInvocation(client);
@@ -157,25 +149,16 @@
addExtraClientConfig(clientConfig);
Client client = new Client(serverLocator, clientConfig);
client.connect();
- log.info("client is connected");
+ log.info("client is connected to " + serverLocator);
// Do invocation.
Object o = client.invoke("abc");
+
+ // Show that an InvocationResponse was incorrectly returned as a String.
assertTrue(o instanceof String);
String result = (String) o;
+ assertTrue(result.indexOf("org.jboss.remoting.InvocationResponse") >=
0);
- // Show that an InvocationResponse was returned as a String, starting with
- // the ObjectInputStream header bytes.
- byte[] bytes = result.getBytes();
- System.out.print("bytes: ");
- for (int i = 0; i < bytes.length; i++)
- System.out.print(bytes[i] + " ");
- System.out.println("");
- assertEquals(-84, bytes[0]);
- assertEquals(-19, bytes[1]);
- assertEquals(0, bytes[2]);
- assertEquals(5, bytes[3]);
-
// Check remoting content type handling.
validateOrdinaryInvocation(client);
@@ -198,7 +181,7 @@
addExtraClientConfig(clientConfig);
Client client = new Client(serverLocator, clientConfig);
client.connect();
- log.info("client is connected");
+ log.info("client is connected to " + serverLocator);
// Test connections.
assertEquals("abc", client.invoke("abc"));
@@ -226,7 +209,7 @@
addExtraClientConfig(clientConfig);
Client client = new Client(serverLocator, clientConfig);
client.connect();
- log.info("client is connected");
+ log.info("client is connected to " + serverLocator);
// Test connections.
Map metadata = new HashMap();
@@ -256,7 +239,7 @@
addExtraClientConfig(clientConfig);
Client client = new Client(serverLocator, clientConfig);
client.connect();
- log.info("client is connected");
+ log.info("client is connected to " + serverLocator);
// Test connections.
Map metadata = new HashMap();
@@ -286,7 +269,7 @@
addExtraClientConfig(clientConfig);
Client client = new Client(serverLocator, clientConfig);
client.connect();
- log.info("client is connected");
+ log.info("client is connected to " + serverLocator);
// Test connections.
Map metadata = new HashMap();
Show replies by date