User: kimptoc 
  Date: 01/05/19 12:19:54

  Modified:    src/main/org/jboss/test/xa/test Main.java
  Log:
  fix build probs with the xa test and make it report up the server error it gets
  
  Revision  Changes    Path
  1.3       +77 -77    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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Main.java 2001/04/18 19:48:29     1.2
  +++ Main.java 2001/05/19 19:19:54     1.3
  @@ -23,64 +23,64 @@
   
   public class Main extends junit.framework.TestCase {
   
  -     static boolean deployed = false;
  +    static boolean deployed = false;
   
  -     public static void main(String arg[]) {
  -             Main main = new Main("main");
  +    public static void main(String arg[]) {
  +        Main main = new Main("main");
   
  -             try {
  -                     main.setUp();
  +        try {
  +            main.setUp();
  +
  +        } catch (Exception e) {
  +            System.out.println("Setup failed:");
  +            e.printStackTrace();
  +        }
   
  -             } 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();
  +        try {
  +            main.testXABean();
  +            System.out.println();
  +            System.out.println("_____________________________________________");
  +            System.out.println("Congratulations!  Test completed");
  +            System.out.println("_____________________________________________");
  +            System.out.println();
   
  -             } catch (Exception e) {
  +        } 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 Main(String name)
  -     {
  -             super(name);
  -     }
  +            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 Main(String name)
  +    {
  +        super(name);
  +    }
   
  -     public void testXABean() throws Exception       {
  -             int test = 0;
  +    public void testXABean() throws Exception   {
  +        int test = 0;
   
  -             Context ctx = new InitialContext();
  +        Context ctx = new InitialContext();
   
           System.out.println();
           System.out.print(++test+"- "+"Looking up the XATest home...");
   
  -             XATestHome home;
  +        XATestHome home;
   
  -             try {
  -                     home = (XATestHome) ctx.lookup("XATest");
  +        try {
  +            home = (XATestHome) ctx.lookup("XATest");
   
  -                     if (home == null) throw new Exception("No Home!");
  +            if (home == null) throw new Exception("No Home!");
               System.out.println("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");
  +        } 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");
   
  -                     throw new Exception();
  +            throw e;
           }
   
           System.out.println();
  @@ -90,14 +90,14 @@
               bean = home.create();
               if(bean == null) throw new Exception("No Bean!");
               System.out.println("OK");
  -             } catch (Exception e) {
  +        } catch (Exception e) {
               System.out.println();
               System.out.println("Could not create the bean!");
               System.out.println("Check the server trace for details");
               e.printStackTrace();
   
   
  -                     throw new Exception();
  +            throw e;
           }
   
           System.out.println();
  @@ -106,11 +106,11 @@
               bean.clearData();
               System.out.println("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)");
  +            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)");
   
  -                     throw new Exception();
  +            throw e;
           }
   
           System.out.println();
  @@ -122,32 +122,32 @@
               System.out.println("sort of worked.");
               System.out.println(e.getMessage());
           } catch(Exception e) {
  -                     System.out.println();
  -                     System.out.println("Error during DB test!");
  -                     System.out.println("Check the server trace for details");
  -
  -                     throw new Exception();
  -        }
  -     }
  -
  -
  -     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!");
  -     }
  +            System.out.println();
  +            System.out.println("Error during DB test!");
  +            System.out.println("Check the server trace for details");
  +
  +            throw e;
  +        }
  +    }
  +
  +
  +    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!");
  +    }
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to