Instead of performing the deploy in the construction of the TestSuite, wrap
the
TestSuite in a junit.extensions.TestSetup Object:


public static Test suite() {
  TestSuite suite= new TestSuite();
  // Add tests and suites...
  TestSetup wrapper= new TestSetup(suite) {
   protected void setUp() throws Exception
   {
    // Deploy the test jar...
   }
   protected void tearDown() throws Exception
   {
    // Undeploy the test jar...
   }
  };
  return wrapper;
}

An exception during deploy in the setUp() method will generate
and error that is caught by the test code.

----- Original Message -----
From: "Jason Dillon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 09, 2001 5:14 PM
Subject: [JBoss-dev] More: MDB tests failing


> It looks like the errors are not being reported because the deployement
> happens in the suite() method, then System.exit()'s after a failure.  If
we
> move the deployment to a test (like undeploy), then the failure shows up,
> but for some reason the actual tests will succeed even if the deployement
> failed.
>
> Hrm... I do not really like deploying/undeploying as a test, as it means
> that you can not just run tests by themselves, you have to run the deploy
> test first.  This is probably best done in setUp(), but then we run into a
> problem of deploy/undeploy for each test, not each suite of tests.  It
would
> be best to do this, though it would slow things down, perhaps too much.
>
> Anyways, I guess for the timebeing it would be a good idea to change all
of
> the deployment to tests, so we can actually see when things break.
> Eventually we need to figure out a better (and more consistent) was to
> deploy/undeploy.
>
> Any ideas?  Is there any way to get around having to deploy/undeploy for
> each test, yet ensure that the application gets undeployed after the test
is
> over?
>
> Is is a bad idea to assume that users can only run the primary test suite,
> which deploys/tests/undeploys and not the individual tests?
>
> --jason
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>


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

Reply via email to