XXXSetUp and tearDown method
anil.saldhana Apr 18, 2006 3:41 AMSeems like the XXXSetUp (not the JBossTestSetUp) pattern does not invoke the tearDown() method on a test failure. I want a second opinion on this because the testsuite has a lot of this pattern including the AOPTestSetUp. These XXXSetup extend JBossTestSetUp.
But in the case of SecurePerfTestCase, the following pattern:
Setup wrapper = new Setup(suite, "secure-perf.jar", true); return wrapper;
was not invoking the tearDown method, after the testfailure -thus having a side effect on EJBSpecUnitTestCase.
From: jboss-cvs-commits-admin@lists.sourceforge.net on behalf of Anil Saldhana
Sent: Mon 4/17/2006 10:22 PM
To: jboss-cvs-commits@lists.sourceforge.net
Subject: [jboss-cvs] jbosstest/src/main/org/jboss/test/perf/test ...
User: asaldhana
Date: 06/04/17 23:22:31
Modified: src/main/org/jboss/test/perf/test Tag: Branch_4_0
SecurePerfStressTestCase.java
Log:
Fix the issue that the failing test is not undeploying the jar file. This eliminates the side effects on the other testcase org.jboss.test.security.test.EJBSpecUnitTestCase.
Revision Changes Path
No revision
No revision
1.6.6.2 +25 -25 jbosstest/src/main/org/jboss/test/perf/test/SecurePerfStressTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SecurePerfStressTestCase.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/test/SecurePerfStressTestCase.java,v
retrieving revision 1.6.6.1
retrieving revision 1.6.6.2
diff -u -b -r1.6.6.1 -r1.6.6.2
--- SecurePerfStressTestCase.java 29 Oct 2005 05:05:41 -0000 1.6.6.1
+++ SecurePerfStressTestCase.java 18 Apr 2006 03:22:31 -0000 1.6.6.2
@@ -21,39 +21,22 @@
*/
package org.jboss.test.perf.test;
public class SecurePerfStressTestCase extends PerfStressTestCase //JBossTestCase
{
@@ -78,7 +61,24 @@
suite.addTest(new TestSuite(SecurePerfStressTestCase.class));
// Create an initializer for the test suite
- Setup wrapper = new Setup(suite, "secure-perf.jar", true);
+ /*Setup wrapper = new Setup(suite, "secure-perf.jar", true);
+ return wrapper; */
+ //Create an initializer for the test suite
+ TestSetup wrapper = new JBossTestSetup(suite)
+ {
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ Configuration.setConfiguration(new XMLLoginConfigImpl());
+ redeploy("secure-perf.jar");
+ }
+ protected void tearDown() throws Exception
+ {
+ undeploy("secure-perf.jar");
+ super.tearDown();
+
+ }
+ };
return wrapper;
}
}