User: sparre
Date: 01/10/20 15:25:58
Modified: src/main/org/jboss/test JBossTestCase.java
Log:
Now catching deployment exceptions in setUp() and throwing it in
testServerFound().
This way, a deployment failure does not result in an empty .xml file,
making the test case being forgotten in the final report.
Also added testServerFound() to the MDB testcase.
Revision Changes Path
1.8 +18 -3 jbosstest/src/main/org/jboss/test/JBossTestCase.java
Index: JBossTestCase.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/JBossTestCase.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- JBossTestCase.java 2001/10/08 16:53:00 1.7
+++ JBossTestCase.java 2001/10/20 22:25:58 1.8
@@ -42,11 +42,16 @@
* ../lib).
*
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class JBossTestCase
extends TestCase
{
+ /**
+ * Saved exception from deployment.
+ * Will be thrown from {@link #testServerFound}, if not <code>null</code>.
+ */
+ private static Exception deploymentException = null;
private JBossTestServices delegate;
@@ -70,11 +75,15 @@
/**
* This just checks the server is there... so you should get at least one
* success!
+ * Also checks if an exception occurred during deployment, and throws
+ * any such exception from here.
*
* @exception Exception Description of Exception
*/
public void testServerFound() throws Exception
{
+ if (deploymentException != null)
+ throw deploymentException;
assertTrue("Server was not found", getServer() != null);
}
@@ -257,8 +266,14 @@
protected void setUp() throws Exception
{
- this.deployJ2ee(jarName);
- this.getLog().debug("deployed package: " + jarName);
+ deploymentException = null;
+ try {
+ this.deployJ2ee(jarName);
+ this.getLog().debug("deployed package: " + jarName);
+ } catch (Exception ex) {
+ // Throw this in testServerFound() instead.
+ deploymentException = ex;
+ }
}
protected void tearDown() throws Exception
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development