Author: jmesnil
Date: 2009-11-04 05:12:56 -0500 (Wed, 04 Nov 2009)
New Revision: 8206
Added:
trunk/tests/joram-tests/src/org/hornetq/jms/SysoutLoggerDelegateFactory.java
Modified:
trunk/tests/joram-tests/src/org/hornetq/jms/HornetQAdmin.java
Log:
print server logging on System.out for JORAM tests
Modified: trunk/tests/joram-tests/src/org/hornetq/jms/HornetQAdmin.java
===================================================================
--- trunk/tests/joram-tests/src/org/hornetq/jms/HornetQAdmin.java 2009-11-04 08:38:44 UTC
(rev 8205)
+++ trunk/tests/joram-tests/src/org/hornetq/jms/HornetQAdmin.java 2009-11-04 10:12:56 UTC
(rev 8206)
@@ -208,7 +208,8 @@
public void startServer() throws Exception
{
- serverProcess = SpawnedVMSupport.spawnVM(SpawnedJMSServer.class.getName(), false);
+ String[] vmArgs = new String[]
{"-Dorg.hornetq.logger-delegate-factory-class-name=org.hornetq.jms.SysoutLoggerDelegateFactory"};
+ serverProcess = SpawnedVMSupport.spawnVM(SpawnedJMSServer.class.getName(), vmArgs,
false);
InputStreamReader isr = new InputStreamReader(serverProcess.getInputStream());
final BufferedReader br = new BufferedReader(isr);
@@ -228,7 +229,7 @@
String line = null;
while ((line = br.readLine()) != null)
{
- System.out.println("server output: " + line);
+ System.out.println("SERVER: " + line);
}
}
catch (Exception e)
Added: trunk/tests/joram-tests/src/org/hornetq/jms/SysoutLoggerDelegateFactory.java
===================================================================
--- trunk/tests/joram-tests/src/org/hornetq/jms/SysoutLoggerDelegateFactory.java
(rev 0)
+++
trunk/tests/joram-tests/src/org/hornetq/jms/SysoutLoggerDelegateFactory.java 2009-11-04
10:12:56 UTC (rev 8206)
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms;
+
+import org.hornetq.core.logging.LogDelegate;
+import org.hornetq.core.logging.LogDelegateFactory;
+
+/**
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ */
+public class SysoutLoggerDelegateFactory implements LogDelegateFactory
+{
+ public LogDelegate createDelegate(Class<?> clazz)
+ {
+ return new SysoutLoggerDelegate();
+ }
+
+ public class SysoutLoggerDelegate implements LogDelegate
+ {
+ public void debug(Object message, Throwable t)
+ {
+ System.out.println(message);
+ t.printStackTrace(System.out);
+ }
+
+ public void debug(Object message)
+ {
+ System.out.println(message);
+ }
+
+ public void error(Object message, Throwable t)
+ {
+ System.out.println(message);
+ t.printStackTrace(System.out);
+ }
+
+ public void error(Object message)
+ {
+ System.out.println(message);
+ }
+
+ public void fatal(Object message, Throwable t)
+ {
+ System.out.println(message);
+ t.printStackTrace(System.out);
+ }
+
+ public void fatal(Object message)
+ {
+ System.out.println(message);
+ }
+
+ public void info(Object message, Throwable t)
+ {
+ System.out.println(message);
+ t.printStackTrace(System.out);
+ }
+
+ public void info(Object message)
+ {
+ System.out.println(message);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return true;
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return true;
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return true;
+ }
+
+ public void trace(Object message, Throwable t)
+ {
+ System.out.println(message);
+ t.printStackTrace(System.out);
+ }
+
+ public void trace(Object message)
+ {
+ System.out.println(message);
+ }
+
+ public void warn(Object message, Throwable t)
+ {
+ System.out.println(message);
+ t.printStackTrace(System.out);
+ }
+
+ public void warn(Object message)
+ {
+ System.out.println(message);
+ }
+
+ }
+}
+
+