From: Scott M S. <st...@us...> - 2002-08-09 02:06:43
|
User: starksm Date: 02/08/08 19:06:42 Modified: src/main/org/jboss/test/perf/test Tag: Branch_3_2 PerfUnitTestCase.java Log: Add home interface location debugging info Revision Changes Path No revision No revision 1.2.2.1 +14 -6 jbosstest/src/main/org/jboss/test/perf/test/PerfUnitTestCase.java Index: PerfUnitTestCase.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/test/PerfUnitTestCase.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- PerfUnitTestCase.java 26 Jul 2002 00:49:51 -0000 1.2 +++ PerfUnitTestCase.java 9 Aug 2002 02:06:42 -0000 1.2.2.1 @@ -1,3 +1,4 @@ + /* * JBoss, the OpenSource J2EE webOS * @@ -18,6 +19,7 @@ import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jboss.test.perf.interfaces.PerfResult; import org.jboss.test.perf.interfaces.PerfTestSession; import org.jboss.test.perf.interfaces.PerfTestSessionHome; import org.jboss.test.perf.interfaces.Probe; @@ -30,7 +32,7 @@ wrapper. @author Sco...@jb... - @version $Revision: 1.2 $ + @version $Revision: 1.2.2.1 $ */ public class PerfUnitTestCase extends JBossTestCase { @@ -45,40 +47,46 @@ public void testInVMCalls() throws Exception { getLog().debug("+++ testInVMCalls()"); - Object obj = getInitialContext().lookup("perf.PerfTestSession"); + Object obj = getInitialContext().lookup("PerfTestSession"); obj = PortableRemoteObject.narrow(obj, PerfTestSessionHome.class); PerfTestSessionHome home = (PerfTestSessionHome) obj; getLog().debug("Found PerfTestSessionHome @ jndiName=PerfTestSessionHome"); PerfTestSession bean = home.create(); getLog().debug("Created PerfTestSession"); long start = System.currentTimeMillis(); - String report = bean.runProbeTests(iterationCount); + PerfResult result = bean.runProbeTests(iterationCount); + String report = result.report; long end = System.currentTimeMillis(); long elapsed = end - start; getLog().debug("Elapsed time = "+(elapsed / iterationCount)); getLog().info("The testInVMCalls report is:\n"+report); + if( result.error != null ) + throw result.error; } public void testInVMLocalCalls() throws Exception { getLog().debug("+++ testInVMLocalCalls()"); - Object obj = getInitialContext().lookup("perf.PerfTestSession"); + Object obj = getInitialContext().lookup("PerfTestSession"); obj = PortableRemoteObject.narrow(obj, PerfTestSessionHome.class); PerfTestSessionHome home = (PerfTestSessionHome) obj; getLog().debug("Found PerfTestSessionHome @ jndiName=PerfTestSessionHome"); PerfTestSession bean = home.create(); getLog().debug("Created PerfTestSession"); long start = System.currentTimeMillis(); - String report = bean.runProbeLocalTests(iterationCount); + PerfResult result = bean.runProbeLocalTests(iterationCount); + String report = result.report; long end = System.currentTimeMillis(); long elapsed = end - start; getLog().debug("Elapsed time = "+(elapsed / iterationCount)); getLog().info("The testInVMLocalCalls report is:\n"+report); + if( result.error != null ) + throw result.error; } public static Test suite() throws Exception { - Test test = getDeploySetup(PerfUnitTestCase.class, "perf.jar"); + Test test = getDeploySetup(PerfUnitTestCase.class, "probe.jar"); return test; } |