2 Replies Latest reply on Dec 21, 2001 12:43 AM by dsundstrom

    EJBTestcase

    erikture

      Hello!

      I am using the extension to JUnit that you receive in the CMP Cookbook. It works fine for me except for one thing.

      I write and execute my EJBTestcase.
      The setUpEJB, tearDownEJB methods are called as well as my testmethods. My problem is that when I validate my EJBs with for example assertTrue or assertEguals, those method works fine but when an error occures the TestRunner still thinks that the test has passed without any remarks.

      If I change the EJBTestcase to be an ordinary JUnit TestCase and performes the same tests in the same environment, i e not actually involving my EJBs (just for testing of the testing!!) the Testrunner finds out when a test have failed.

      What is wrong?

      /Erik Turesson

        • 1. Re: EJBTestcase
          tobyhede

          I was suffering a similar problem last night, my EJB tests where passing, even if JBoss was shut down...what I have done, which appears to rectify the situation in my case is catch any Exception an re-throw it from my test method:

            protected void setUp() throws Exception
            {
              try {
                . . . do stuff . . .

              }
            catch (Exception e) {
              throw new Exception(e.toString());
            }
            }

          • 2. Re: EJBTestcase
            dsundstrom

            I found this last week along with some other bugs. The update version can be downloaded from http://sourceforge.net/projects/junitejb/