User: d_jencks
Date: 01/09/14 17:12:16
Modified: src/main/org/jboss/test/cts/jms ContainerMBox.java
Log:
Made tests work and converted to JBossTestCase and logging
Revision Changes Path
1.3 +15 -8 jbosstest/src/main/org/jboss/test/cts/jms/ContainerMBox.java
Index: ContainerMBox.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/cts/jms/ContainerMBox.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ContainerMBox.java 2001/07/29 18:17:39 1.2
+++ ContainerMBox.java 2001/09/15 00:12:16 1.3
@@ -1,3 +1,9 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package org.jboss.test.cts.jms;
import java.io.*;
@@ -6,6 +12,8 @@
import javax.naming.*;
import javax.jms.*;
+import org.apache.log4j.Category;
+
public class ContainerMBox
implements MessageListener
{
@@ -19,6 +27,8 @@
private TextMessage msg;
private Queue queue;
+ private Category log;
+
public static final String EJB_CREATE_MSG = "EJB_CREATE_MSG";
public static final String EJB_POST_CREATE_MSG = "EJB_POST_CREATE_MSG";
public static final String EJB_ACTIVATE_MSG = "EJB_ACTIVATE_MSG";
@@ -33,13 +43,14 @@
public ContainerMBox ( )
{
+ log = Category.getInstance(getClass().getName());
try
{
- init( new InitialContext(), QUEUE );
+ init( new InitialContext(), QUEUE );
}
catch(Exception ex)
{
- ex.printStackTrace();
+ log.error("MBox could not get initial context", ex);
}
}
@@ -58,12 +69,12 @@
msgText = msg.toString();
}
- System.out.println("[BEAN MESSAGE]: "+ msgText );
+ log.debug("[BEAN MESSAGE]: "+ msgText );
messageList.put(msgText, "msg" );
}
catch (JMSException jmse)
{
- jmse.printStackTrace();
+ log.error("problem receiving MBox message", jmse);
}
}
@@ -116,10 +127,6 @@
private static InitialContext getInitialContext(String url)
throws NamingException
{
- //Hashtable env = new Hashtable();
- //env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
- //env.put(Context.PROVIDER_URL, url);
- //return new InitialContext(env);
return new InitialContext();
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development