User: starksm
Date: 01/07/08 18:06:07
Modified: src/main/org/jboss/test/xa/test Tag: Branch_2_4 Main.java
Log:
Merge latest changes from main to the 2.4 branch
Revision Changes Path
No revision
No revision
1.3.2.1 +40 -52 jbosstest/src/main/org/jboss/test/xa/test/Main.java
Index: Main.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/xa/test/Main.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- Main.java 2001/05/19 19:19:54 1.3
+++ Main.java 2001/07/09 01:06:07 1.3.2.1
@@ -16,51 +16,25 @@
import java.util.Iterator;
import java.util.Enumeration;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.jboss.test.util.Deploy;
+
import org.jboss.test.xa.interfaces.CantSeeDataException;
import org.jboss.test.xa.interfaces.XATest;
import org.jboss.test.xa.interfaces.XATestHome;
-
-
-public class Main extends junit.framework.TestCase {
-
- static boolean deployed = false;
-
- public static void main(String arg[]) {
- Main main = new Main("main");
-
- try {
- main.setUp();
-
- } catch (Exception e) {
- System.out.println("Setup failed:");
- e.printStackTrace();
- }
-
- try {
- main.testXABean();
- System.out.println();
- System.out.println("_____________________________________________");
- System.out.println("Congratulations! Test completed");
- System.out.println("_____________________________________________");
- System.out.println();
-
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println();
- System.out.println("_____________________________________________");
- System.out.println("Sorry, test failed. Try again with different
settings!");
- System.out.println("Thanks for your time...");
- System.out.println();
- }
- }
-
+public class Main
+ extends TestCase
+{
public Main(String name)
{
super(name);
}
- public void testXABean() throws Exception {
+ public void testXABean() throws Exception {
int test = 0;
Context ctx = new InitialContext();
@@ -101,6 +75,17 @@
}
System.out.println();
+ System.out.print(++test+"- "+"Creating required tables...");
+ try {
+ bean.createTables();
+ System.out.println("OK");
+ }
+ catch (Exception e) {
+ System.out.println("\nFailed to create tables");
+ throw e;
+ }
+
+ System.out.println();
System.out.print(++test+"- "+"Clearing any old data...");
try {
bean.clearData();
@@ -130,24 +115,27 @@
}
}
-
protected void setUp() throws Exception
{
- if (deployed) return;
+ }
- System.out.println("_____________________________________________");
- System.out.println();
- System.out.println("jBoss, the EJB Open Source Server");
- System.out.println("Copyright (C), The jBoss Organization, 2000");
- System.out.println("_____________________________________________");
- System.out.println();
- System.out.println("Welcome to the XADataSource test");
- System.out.println("_____________________________________________");
- System.out.println();
- System.out.print("Deploying the bean...");
- System.out.flush();
- new org.jboss.jmx.client.Deployer().deploy("../deploy/xatest.jar");
- deployed = true;
- System.out.println("done!");
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+
+ try {
+ System.out.println("Deploying...");
+ Deploy.deploy("../deploy/xatest.jar");
+
+ suite.addTest(new TestSuite(Main.class));
+
+ // add a test case to undeploy our support applications
+ suite.addTest(new Deploy.Undeployer("../deploy/xatest.jar"));
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ System.exit(0);
+ }
+
+ return suite;
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development