[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Application Server Integration Tests

adrian@jboss.org do-not-reply at jboss.com
Fri Sep 29 07:59:05 EDT 2006


"rachmatowicz at jboss.com" wrote : 
  | All in all, I am in favour of using a simpler approach, based on the simplified scheme described above, where test cases
  | continue to sublass from JBossTestCase
  | 

No the point is to write unit tests. You are not testing JBoss integration!

The tests should be written against the microcontainer:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=76657

I said this should be based on a JMSAdmin like the JORAM tests.
Not that it should use the JORAM admin implementation.

Once we have our own admin implementation, the JORAM tests
can use that as a delegate.

The general outline should be something like:

// A base class

  | public abstract class AbstractJMSTest extends MicrocontainerTest
  | {
  |    /**
  |     * Get the delegate
  |     * 
  |     * @return the delegate
  |     */
  |    protected JMSTestDelegate getJMSDelegate()
  |    {
  |       return (JMSTestDelegate) getDelegate();
  |    }
  | 
  |    // helper methods that delegate/admin
  | }
  | 

// The delegate that encapsulates the admin/implementation

  | public class JMSTestDelegate extends MicrocontainerTestDelegate
  | {
  |    static JMSAdmin admin;
  | 
  |    static
  |    {
  |        // Possible rules
  |        // 1) Look at system property 
  |        // 2) Is JBoss Messaging in the classpath
  |        // 3) Is JBossMQ in the classpath 
  |        admin = initialiseAdmin();
  |    }
  | }
  | 

// Real tests just use the infrastructure

  | public class RealTest extends AbstractJMSTest
  | {
  |     public void testSomething()
  |     {
  |          ConnectionFactory cf = super.getConnectionFactory();
  |          Queue queue = super.createQueue("something");
  |          ...
  |     }
  | }
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975119#3975119

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975119



More information about the jboss-dev-forums mailing list