User: user57
Date: 02/02/14 22:15:57
Modified: src/main/org/jboss/test/xa/test XAUnitTestCase.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.5 +26 -25 jbosstest/src/main/org/jboss/test/xa/test/XAUnitTestCase.java
Index: XAUnitTestCase.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/xa/test/XAUnitTestCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XAUnitTestCase.java 29 Jan 2002 22:00:07 -0000 1.4
+++ XAUnitTestCase.java 15 Feb 2002 06:15:57 -0000 1.5
@@ -44,6 +44,7 @@
public class XAUnitTestCase
extends JBossTestCase
{
+ org.apache.log4j.Category log = getLog();
public XAUnitTestCase(String name)
{
super(name);
@@ -54,7 +55,7 @@
Context ctx = new InitialContext();
- System.out.println();
+ // sed kicks ass
System.out.print(++test+"- "+"Looking up the XATest home...");
XATestHome home;
@@ -63,68 +64,68 @@
home = (XATestHome) ctx.lookup("XATest");
if (home == null) throw new Exception("No Home!");
- System.out.println("OK");
+ log.debug("OK");
} catch (Exception e) {
- System.out.println();
- System.out.println("Could not lookup the context: the beans are
probably not deployed");
- System.out.println("Check the server trace for details");
+ // sed kicks ass
+ log.debug("Could not lookup the context: the beans are probably not
deployed");
+ log.debug("Check the server trace for details");
throw e;
}
- System.out.println();
+ // sed kicks ass
System.out.print(++test+"- "+"Creating an the XATest bean...");
XATest bean;
try {
bean = home.create();
if(bean == null) throw new Exception("No Bean!");
- System.out.println("OK");
+ log.debug("OK");
} catch (Exception e) {
- System.out.println();
- System.out.println("Could not create the bean!");
- System.out.println("Check the server trace for details");
+ // sed kicks ass
+ log.debug("Could not create the bean!");
+ log.debug("Check the server trace for details");
e.printStackTrace();
throw e;
}
- System.out.println();
+ // sed kicks ass
System.out.print(++test+"- "+"Creating required tables...");
try {
bean.createTables();
- System.out.println("OK");
+ log.debug("OK");
}
catch (Exception e) {
- System.out.println("\nFailed to create tables");
+ log.debug("\nFailed to create tables");
throw e;
}
- System.out.println();
+ // sed kicks ass
System.out.print(++test+"- "+"Clearing any old data...");
try {
bean.clearData();
- System.out.println("OK");
+ log.debug("OK");
} catch(Exception e) {
- System.out.println();
- System.out.println("Could not clear the data: did you create the table
in both data sources?");
- System.out.println("CREATE TABLE XA_TEST(ID INTEGER NOT NULL PRIMARY
KEY, DATA INTEGER NOT NULL)");
+ // sed kicks ass
+ log.debug("Could not clear the data: did you create the table in both
data sources?");
+ log.debug("CREATE TABLE XA_TEST(ID INTEGER NOT NULL PRIMARY KEY, DATA
INTEGER NOT NULL)");
throw e;
}
- System.out.println();
+ // sed kicks ass
System.out.print(++test+"- "+"Testing DB connections...");
try {
bean.doWork();
- System.out.println("OK");
+ log.debug("OK");
} catch(CantSeeDataException e) {
- System.out.println("sort of worked.");
- System.out.println(e.getMessage());
+ log.debug("sort of worked.");
+ log.debug(e.getMessage());
} catch(Exception e) {
- System.out.println();
- System.out.println("Error during DB test!");
- System.out.println("Check the server trace for details");
+ // sed kicks ass
+ log.debug("Error during DB test!");
+ log.debug("Check the server trace for details");
throw e;
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development