0 Replies Latest reply on Jun 25, 2008 8:44 AM by adrian.brock

    ForceClear tests are stupid

      I've fixed the following test
      org.jboss.test.mdbsessionpoolclear.test.MDBUnitTestCase
      so it at least runs to completion.

      But this test isn't actually testing anything.

      The ForceClear was described as "experimental" by the person that wrote it.
      Except that it broke the normal behaviour
      http://jira.jboss.com/jira/browse/JBAS-5428

      The idea of the ForceClear option is that if the MDB is busy,
      the undeployment of the MDB will still proceed after a certain amount of waiting.

      This test, doesn't test that behaviour. The MDB has no wait at all

       public void onMessage(Message message)
       {
       try
       {
       InitialContext jndiContext = new InitialContext();
       TestStatusHome statusHome = (TestStatusHome)jndiContext.lookup("TestStatus");
       TestStatus status = statusHome.create();
       int count = status.increment();
       log.info("**** Mdb got message " + count + " " + ((TextMessage)message).getText());
       }
       catch (Exception e)
       {
       e.printStackTrace();
       }
       }
      

      So I don't see how it would ever block the undeploy?
      The undeploy isn't even part of the test, it's in the test setup.

      So we have an undocumentated feature, that broke the normal behaviour
      and isn't actually tested.

      It's a good job the person that did this work doesn't work for Redhat anymore. :-)