User: user57
Date: 02/02/14 22:15:55
Modified: src/main/org/jboss/test/naming/ejb TestENCBean.java
Log:
o replaced most System.out usage with Log4j. should really introduce
some base classes to make this mess more maintainable...
Revision Changes Path
1.6 +20 -18 jbosstest/src/main/org/jboss/test/naming/ejb/TestENCBean.java
Index: TestENCBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/naming/ejb/TestENCBean.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TestENCBean.java 10 Jun 2001 20:49:28 -0000 1.5
+++ TestENCBean.java 15 Feb 2002 06:15:55 -0000 1.6
@@ -12,10 +12,12 @@
to test ENC usage.
@author [EMAIL PROTECTED]
-@version $Revision: 1.5 $
+@version $Revision: 1.6 $
*/
public class TestENCBean implements SessionBean
{
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
+
private SessionContext sessionContext;
public void ejbCreate() throws CreateException
@@ -44,8 +46,8 @@
Context initCtx = new InitialContext();
Context myEnv = (Context) initCtx.lookup("java:comp/env");
Boolean hasFullENC = (Boolean) myEnv.lookup("hasFullENC");
- System.out.println("ThreadContext CL =
"+Thread.currentThread().getContextClassLoader());
- System.out.println("hasFullENC = "+hasFullENC);
+ log.debug("ThreadContext CL =
"+Thread.currentThread().getContextClassLoader());
+ log.debug("hasFullENC = "+hasFullENC);
if( hasFullENC.equals(Boolean.TRUE) )
{
// This bean should have the full ENC setup of the ENCBean
@@ -83,17 +85,17 @@
{
// Basic env values
Integer i = (Integer) myEnv.lookup("Ints/i0");
- System.out.println("Ints/i0 = "+i);
+ log.debug("Ints/i0 = "+i);
i = (Integer) initCtx.lookup("java:comp/env/Ints/i1");
- System.out.println("Ints/i1 = "+i);
+ log.debug("Ints/i1 = "+i);
Float f = (Float) myEnv.lookup("Floats/f0");
- System.out.println("Floats/f0 = "+f);
+ log.debug("Floats/f0 = "+f);
f = (Float) initCtx.lookup("java:comp/env/Floats/f1");
- System.out.println("Floats/f1 = "+f);
+ log.debug("Floats/f1 = "+f);
String s = (String) myEnv.lookup("Strings/s0");
- System.out.println("Strings/s0 = "+s);
+ log.debug("Strings/s0 = "+s);
s = (String) initCtx.lookup("java:comp/env/Strings/s1");
- System.out.println("Strings/s1 = "+s);
+ log.debug("Strings/s1 = "+s);
}
private void testEjbRefs(Context initCtx, Context myEnv) throws NamingException
{
@@ -101,12 +103,12 @@
Object ejb = myEnv.lookup("ejb/bean0");
if( (ejb instanceof javax.ejb.EJBHome) == false )
throw new NamingException("ejb/bean0 is not a javax.ejb.EJBHome");
- System.out.println("ejb/bean0 = "+ejb);
+ log.debug("ejb/bean0 = "+ejb);
ejb = initCtx.lookup("java:comp/env/ejb/bean1");
- System.out.println("ejb/bean1 = "+ejb);
+ log.debug("ejb/bean1 = "+ejb);
//ejb = initCtx.lookup("java:comp/env/ejb/remote-bean");
ejb = null;
- System.out.println("ejb/remote-bean = "+ejb);
+ log.debug("ejb/remote-bean = "+ejb);
}
private void testJdbcDataSource(Context initCtx, Context myEnv) throws
NamingException
{
@@ -114,7 +116,7 @@
Object obj = myEnv.lookup("jdbc/DefaultDS");
if( (obj instanceof javax.sql.DataSource) == false )
throw new NamingException("jdbc/DefaultDS is not a
javax.sql.DataSource");
- System.out.println("jdbc/DefaultDS = "+obj);
+ log.debug("jdbc/DefaultDS = "+obj);
}
private void testMail(Context initCtx, Context myEnv) throws NamingException
{
@@ -122,7 +124,7 @@
Object obj = myEnv.lookup("mail/DefaultMail");
if( (obj instanceof javax.mail.Session) == false )
throw new NamingException("mail/DefaultMail is not a
javax.mail.Session");
- System.out.println("mail/DefaultMail = "+obj);
+ log.debug("mail/DefaultMail = "+obj);
}
private void testJMS(Context initCtx, Context myEnv) throws NamingException
{
@@ -130,7 +132,7 @@
Object obj = myEnv.lookup("jms/QueFactory");
if( (obj instanceof javax.jms.QueueConnectionFactory) == false )
throw new NamingException("mail/DefaultMail is not a
javax.jms.QueueConnectionFactory");
- System.out.println("jms/QueFactory = "+obj);
+ log.debug("jms/QueFactory = "+obj);
}
private void testURL(Context initCtx, Context myEnv) throws NamingException
{
@@ -138,9 +140,9 @@
Object obj = myEnv.lookup("url/JBossHomePage");
if( (obj instanceof java.net.URL) == false )
throw new NamingException("url/JBossHomePage is not a java.net.URL");
- System.out.println("url/SourceforgeHomePage = "+obj);
+ log.debug("url/SourceforgeHomePage = "+obj);
obj = myEnv.lookup("url/SourceforgeHomePage");
- System.out.println("url/SourceforgeHomePage = "+obj);
+ log.debug("url/SourceforgeHomePage = "+obj);
}
private void testResourceEnvEntries(Context initCtx, Context myEnv) throws
NamingException
@@ -148,7 +150,7 @@
Object obj = myEnv.lookup("res/aQueue");
if( (obj instanceof javax.jms.Queue) == false )
throw new NamingException("res/aQueue is not a javax.jms.Queue");
- System.out.println("res/aQueue = "+obj);
+ log.debug("res/aQueue = "+obj);
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development