User: starksm Date: 02/02/25 12:59:58 Modified: src/main/org/jboss/test/hello/test HelloTimingStressTestCase.java Log: Simplified the test code to get rid of tests that were not used and convered by other unit tests Revision Changes Path 1.7 +22 -57 jbosstest/src/main/org/jboss/test/hello/test/HelloTimingStressTestCase.java Index: HelloTimingStressTestCase.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/hello/test/HelloTimingStressTestCase.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- HelloTimingStressTestCase.java 29 Jan 2002 22:00:02 -0000 1.6 +++ HelloTimingStressTestCase.java 25 Feb 2002 20:59:58 -0000 1.7 @@ -22,34 +22,33 @@ import org.jboss.test.JBossTestCase; -/** - * - * @see <related> - * @author Author: schaefera - * @version $Revision: 1.6 $ +/** Simple tests of the Hello stateless session bean + * + * @author [EMAIL PROTECTED] + * @version $Revision: 1.7 $ */ public class HelloTimingStressTestCase extends JBossTestCase { // Constants ----------------------------------------------------- - + // Attributes ---------------------------------------------------- // Static -------------------------------------------------------- static boolean deployed = false; - + // Constructors -------------------------------------------------- public HelloTimingStressTestCase(String name) { - super(name); + super(name); } // Public -------------------------------------------------------- - + /** * Lookup the bean, call it, remove it. * - * @exception Exception + * @exception Exception */ public void testHello() throws Exception @@ -63,7 +62,7 @@ /** * Test marshalling of custom data-holders. * - * @exception Exception + * @exception Exception */ public void testData() throws Exception @@ -79,26 +78,17 @@ /** * This tests the speed of invocations * - * @exception Exception + * @exception Exception */ public void testSpeed() throws Exception { long start = System.currentTimeMillis(); - long start2 = start; HelloHome home = (HelloHome)getInitialContext().lookup(HelloHome.JNDI_NAME); Hello hello = home.create(); for (int i = 0 ; i < getIterationCount(); i++) { - hello.hello("Rickard"); - - if (i % 100 == 0 && i != 0) - { - long end = System.currentTimeMillis(); - getLog().debug("Time/call(ms):"+((end-start2)/100)); - start2 = end; - } - + hello.hello("Rickard"); } long end = System.currentTimeMillis(); getLog().debug("Avg. time/call(ms):"+((end-start)/getIterationCount())); @@ -107,57 +97,33 @@ /** * This tests the speed of invocations * - * @exception Exception + * @exception Exception */ public void testSpeed2() throws Exception { long start = System.currentTimeMillis(); - long start2 = start; + long start2 = start; HelloHome home = (HelloHome)getInitialContext().lookup(HelloHome.JNDI_NAME); Hello hello = home.create(); for (int i = 0 ; i < getIterationCount(); i++) { hello.helloHello(hello); - - if (i % 100 == 0 && i != 0) - { - long end = System.currentTimeMillis(); - getLog().debug("Time/call(ms):"+((end-start2)/100)); - start2 = end; - } } long end = System.currentTimeMillis(); getLog().debug("Avg. time/call(ms):"+((end-start)/getIterationCount())); } - - /** - * This tests the speed of server-internal invocations - * - * @exception Exception - */ -/* public void testInternalSpeed() - throws Exception - { - HelloHome home = (HelloHome)getInitialContext().lookup(HelloHome.JNDI_NAME); - Hello hello = home.create(); - - long start = System.currentTimeMillis(); - hello.testSpeed("Rickard", getIterationCount()); - long end = System.currentTimeMillis(); - getLog().debug("Avg. time/call(ms):"+((end-start)/getIterationCount())); - } -*/ + /** * This tests the speed of InitialContext lookups * including getting the initial context. - * @exception Exception + * @exception Exception */ public void testContextSpeed() throws Exception { long start = System.currentTimeMillis(); - + getLog().debug("Starting context lookup speed test"); for (int i = 0; i < getIterationCount(); i++) { @@ -166,18 +132,18 @@ long end = System.currentTimeMillis(); getLog().debug("Avg. time/call(ms):"+((end-start)/getIterationCount())); } - + /** * This tests the speed of JNDI lookups * - * @exception Exception + * @exception Exception */ public void testReusedContextSpeed() throws Exception { Context ctx = getInitialContext(); long start = System.currentTimeMillis(); - + getLog().debug("Starting context lookup speed test"); for (int i = 0; i < getIterationCount(); i++) { @@ -186,12 +152,11 @@ long end = System.currentTimeMillis(); getLog().debug("Avg. time/call(ms):"+((end-start)/getIterationCount())); } - - + + public static Test suite() throws Exception { return getDeploySetup(HelloTimingStressTestCase.class, "hello.jar"); } - }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development