User: d_jencks
  Date: 01/09/11 21:55:38

  Modified:    src/main/org/jboss/test/cts/test StatefulSessionTest.java
  Added:       src/main/org/jboss/test/cts/test AllCtsUnitTestCase.java
                        StatelessSessionStressTestCase.java
  Removed:     src/main/org/jboss/test/cts/test AllJUnitTests.java
                        Main.java
  Log:
  Changed naming scheme of tests to *UnitTestCase.java for short running tests and 
*StressTestCase.java for lengthy tests.  Made tests-unit and tests-stress targets in 
build.xml
  
  Revision  Changes    Path
  1.11      +8 -4      
jbosstest/src/main/org/jboss/test/cts/test/StatefulSessionTest.java
  
  Index: StatefulSessionTest.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/cts/test/StatefulSessionTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- StatefulSessionTest.java  2001/09/07 10:26:43     1.10
  +++ StatefulSessionTest.java  2001/09/12 04:55:38     1.11
  @@ -22,8 +22,8 @@
   /**
    *
    *   @see <related>
  - *   @author $Author: kimptoc $
  - *   @version $Revision: 1.10 $
  + *   @author $Author: d_jencks $
  + *   @version $Revision: 1.11 $
    */
   
   public class StatefulSessionTest
  @@ -71,7 +71,9 @@
         {
            sessionBean.remove();
         }
  -      catch (Exception ex){}
  +      catch (Exception ex){
  +          fail("could not remove stateless session bean" + ex);
  +      }
   
         System.out.println(
            "**************************************************************");
  @@ -139,8 +141,10 @@
         try
         {
            sessionBean.remove();
  +      }
  +      catch (Exception ex){
  +          fail("could not remove stateful session bean" + ex);
         }
  -      catch (Exception ex){}
   
         System.out.println(
            "**************************************************************");
  
  
  
  1.1                  
jbosstest/src/main/org/jboss/test/cts/test/AllCtsUnitTestCase.java
  
  Index: AllCtsUnitTestCase.java
  ===================================================================
  package org.jboss.test.cts.test;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  import org.jboss.test.util.Deploy;
  
  /**
   * Class AllJUnitTests
   *
   *
   * @author
   * @version %I%, %G%
   */
  
  public class AllCtsUnitTestCase
     extends TestCase
  {
  
     /**
      * Constructor AllJUnitTests
      *
      *
      * @param name
      *
      */
     public AllCtsUnitTestCase (String name)
     {
        super(name);
     }
  
     /**
      * Setup the test suite.
      */
     public static Test suite()
     {
        TestSuite suite = new TestSuite();
  
        // add a test case to deploy our support applications
        String filename = "cts.jar";
        suite.addTest(new Deploy.Deployer(filename));
  
        suite.addTest(new StatefulSessionTest("testBasicSession"));
        suite.addTest(new StatefulSessionTest("testEJBHomeInterface"));
        // Broken 12/05/00
        suite.addTest(new StatefulSessionTest("testRemoveSessionObject"));
        suite.addTest(new StatefulSessionTest("testSerialization"));
        suite.addTest(new StatefulSessionTest("testUnSerialization"));
        suite.addTest(new StatefulSessionTest("testCompareSerializeGetPK"));
        suite.addTest(new StatefulSessionTest("testProbeBeanContext"));
        suite.addTest(new StatefulSessionTest("testLoopback"));
        suite.addTest(new StatefulSessionTest("testUserTrx"));
  
        suite.addTest(new StatelessSessionTest("testBasicStatelessSession"));
  
        suite.addTest(new BmpTest("testProbeContainerCallbacks"));
  
        suite.addTest(new BmpTest("testEjbCreate"));
        suite.addTest(new BmpTest("testEjbFinder"));
        suite.addTest(new BmpTest("testEjbRemove"));
        suite.addTest(new BmpTest("testEjbLifeCycle"));
  
        suite.addTest(new BmpTest("testPrimaryKeyObjectIdentity"));
        suite.addTest(new BmpTest("testEjbRemoteIF"));
        suite.addTest(new BmpTest("testEntityHandle"));
        suite.addTest(new BmpTest("testUserTransaction"));
   
        // 03/01/2001
        suite.addTest(new BmpTest("testContainerObjects"));
  
        // add a test case to undeploy our support applications
        suite.addTest(new Deploy.Undeployer(filename));
        
        return suite;
     }
  }
  
  
  /*------ Formatted by Jindent 3.23 Basic 1.0 --- http://www.jindent.de ------*/
  
  
  
  1.1                  
jbosstest/src/main/org/jboss/test/cts/test/StatelessSessionStressTestCase.java
  
  Index: StatelessSessionStressTestCase.java
  ===================================================================
  package org.jboss.test.cts.test;
  
  
  
  import java.io.*;
  import java.util.*;
  import java.lang.reflect.*;
  import javax.ejb.*;
  import javax.naming.*;
  import javax.management.*;
  import org.jboss.test.cts.interfaces.*;
  
  import junit.framework.*;
  import org.jboss.test.util.Deploy;
  
  /**
   *
   *   @see <related>
   *   @author $Author: d_jencks $
   *   @version $Revision: 1.1 $
   */
  
  public class StatelessSessionStressTestCase
     extends junit.framework.TestCase
  {
  
     // Constants -----------------------------------------------------
     // Attributes ----------------------------------------------------
     // Static --------------------------------------------------------
      //static boolean deployed = false;
  
     // Constructors --------------------------------------------------
  
     /**
      * Constructor Main
      *
      *
      * @param name
      *
      */
  
     public StatelessSessionStressTestCase (String name)
     {
        super(name);
     }
  
     // Public --------------------------------------------------------
  
  
  
  
  
  
     //-------------------------------------------------------------------------
     // EJB 1.1 
     // 
  
     /**
      * Method testCallbacks
      * What is being tested here??? Is there some use to this test???
      *
      */
  
     public void testCallbacks ()
     {
        System.out.println("Callback test");
  
        StatefulSession     sessionBean [] = new StatefulSession [125];
        StatefulSessionHome home           = null;
        int                 i              = 0;
  
        try
        {
           Properties props = System.getProperties();
  
           System.out.println("Obtain home interface");
  
           // Create a new session object   
           Context ctx = new InitialContext(props);
  
           home =
              ( StatefulSessionHome ) ctx.lookup("ejbcts/StatefulSessionBean");
        }
        catch (Exception Ex)
        {
           fail("Caught an Unknown Exception in lookup");
        }
  
        try
        {
           for (i = 0; i < 125; i++)
           {
              sessionBean [i] = home.create();
  
              sessionBean [i].method1("test");
              Thread.sleep(500);
           }
  
           // Kill all the beans
           for (i = 0; i < 125; i++)
              sessionBean [i].remove();
        }
        catch (Exception ex)
        {
           ex.printStackTrace();
           fail("Caught an unknown excpeption");
        }
     }   // testCallbacks()
  
      /*   protected void setUp ()
        throws Exception
     {
        if (deployed) return;
  
        System.out.println("Deploying");
        new org.jboss.jmx.client.Deployer().deploy("../deploy/cts.jar");
  
        deployed = true;
        }*/
  
     /**
      * Setup the test suite.
      */
     public static Test suite() {
        TestSuite suite = new TestSuite();
          
        // add a test case to deploy our support applications
        String filename = "cts.jar";
        suite.addTest(new Deploy.Deployer(filename));
  
        suite.addTest(new TestSuite(StatelessSessionStressTestCase.class));
  
        // add a test case to undeploy our support applications
        suite.addTest(new Deploy.Undeployer(filename));
        
        return suite;
     }
  }
  
  
  /*------ Formatted by Jindent 3.23 Basic 1.0 --- http://www.jindent.de ------*/
  
  
  

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

Reply via email to