Author: ron.sigal(a)jboss.com
Date: 2008-05-22 01:26:18 -0400 (Thu, 22 May 2008)
New Revision: 4225
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/stream/StreamingTestClient.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/stream/StreamingTestServer.java
Log:
JBREM-930: Changed System.out.println() to log.info().
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/stream/StreamingTestClient.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/stream/StreamingTestClient.java 2008-05-22
05:08:46 UTC (rev 4224)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/stream/StreamingTestClient.java 2008-05-22
05:26:18 UTC (rev 4225)
@@ -23,6 +23,8 @@
package org.jboss.test.remoting.stream;
import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
@@ -36,6 +38,8 @@
*/
public class StreamingTestClient extends TestCase
{
+ private static Logger log = Logger.getLogger(StreamingTestClient.class);
+
// Default locator values
private static String transport = "socket";
private static String host = "localhost";
@@ -71,8 +75,8 @@
// Thread.sleep(5000);
// assertFalse(error);
- System.out.println("Waiting to give server a chance to send ");
- System.out.println("org.jboss.remoting.stream.StreamHandler.CLOSE
message");
+ log.info("Waiting to give server a chance to send ");
+ log.info("org.jboss.remoting.stream.StreamHandler.CLOSE message");
Thread.sleep(5000);
}
@@ -88,7 +92,7 @@
String param = "foobar";
long fileLength = testFile.length();
- System.out.println("File size = " + fileLength);
+ log.info("File size = " + fileLength);
Object ret = remotingClient.invoke(fileInput, param);
Map responseMap = (Map)ret;
@@ -102,15 +106,15 @@
Object response = remotingClient.invoke("get_size");
int returnedFileLength = ((Integer) response).intValue();
- System.out.println("Invocation response: " + response);
+ log.info("Invocation response: " + response);
if(fileLength == returnedFileLength)
{
- System.out.println("PASS");
+ log.info("PASS");
}
else
{
- System.out.println("FAILED - returned file length was " +
returnedFileLength);
+ log.info("FAILED - returned file length was " + returnedFileLength);
}
assertEquals(fileLength, returnedFileLength);
}
@@ -120,7 +124,7 @@
String bindAddr = System.getProperty("jrunit.bind_addr", host);
locatorURI = transport + "://" + bindAddr + ":" + port;
InvokerLocator locator = new InvokerLocator(locatorURI);
- System.out.println("Calling remoting server with locator uri of: " +
locatorURI);
+ log.info("Calling remoting server with locator uri of: " + locatorURI);
remotingClient = new Client(locator, "test_stream");
remotingClient.connect();
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/stream/StreamingTestServer.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/stream/StreamingTestServer.java 2008-05-22
05:08:46 UTC (rev 4224)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/stream/StreamingTestServer.java 2008-05-22
05:26:18 UTC (rev 4225)
@@ -28,6 +28,8 @@
import java.util.Map;
import java.util.HashMap;
import javax.management.MBeanServer;
+
+import org.apache.log4j.Logger;
import org.jboss.jrunit.extensions.ServerTestCase;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvokerLocator;
@@ -41,6 +43,8 @@
*/
public class StreamingTestServer extends ServerTestCase
{
+ private static Logger log = Logger.getLogger(StreamingTestServer.class);
+
// Default locator values
private static String transport = "socket";
private static String host = "localhost";
@@ -54,7 +58,7 @@
String bindAddr = System.getProperty("jrunit.bind_addr", host);
locatorURI = transport + "://" + bindAddr + ":" + port;
InvokerLocator locator = new InvokerLocator(locatorURI);
- System.out.println("Starting remoting server with locator uri of: " +
locatorURI);
+ log.info("Starting remoting server with locator uri of: " + locatorURI);
connector = new Connector();
connector.setInvokerLocator(locator.getLocatorURI());
connector.create();
@@ -64,6 +68,7 @@
connector.addInvocationHandler("test_stream", invocationHandler);
connector.start();
+ log.info("Started remoting server with locator uri of: " + locatorURI);
}
protected void setUp() throws Exception
@@ -130,7 +135,7 @@
public Object invoke(InvocationRequest invocation) throws Throwable
{
// Print out the invocation request
- System.out.println("Invocation request is: " +
invocation.getParameter());
+ log.info("Invocation request is: " + invocation.getParameter());
// Just going to return static string as this is just simple example code.
return new Integer(streamSize);
@@ -197,7 +202,7 @@
}
byte[] bytes = out.toByteArray();
streamSize = bytes.length;
- System.out.println("Read stream. Contents is: " + new
String(bytes));
+ log.info("Read stream. Contents is: " + new String(bytes));
}
catch(IOException e)
{
Show replies by date