[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 08:08:16 EDT 2006


I'd also recommend that most tests bootstrap
a default configuration for the server.

The default Microcontainer delegate looks for an xml file
based on the test class name.
e.g.
org.jboss.test.jms.test.TestSomething.class
uses
org.jboss.test.jms.test.TestSomething.xml

Rather than writing one for each test, there should be 
a mechanism to provide a default JMS config
(while still allowing individual tests to use different configurations).

e.g. maybe?

  | public class JMSTestDelegate extends MicrocontainerTestDelegate
  | {
  |    static JMSAdmin admin;
  | 
  |    ...
  | 
  |    protected void setUp() throws Execption
  |    {
  |        super.setUp();
  | 
  |        // No test specific configuration?
  |        if (getBean("ConnectionFactory") == null)
  |        {
  |            String name = admin.getDefaultConfigName();
  |            URL url = clazz.getResource(name); // the config will be in the classpath
  |            deploy(url);
  |        }
  |    }
  | }
  | 

Or perhaps:

  |    protected void setUp() throws Execption
  |    {
  |        super.setUp();
  | 
  |        
  |        String name = admin.getConfig(clazz.getName());
  |        // No test specific configuration?
  |        if (name == null)
  |            name = admin.getDefaultConfigName();
  |        URL url = clazz.getResource(name); // the config will be in the classpath
  |         deploy(url);
  |    }
  | 

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

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



More information about the jboss-dev-forums mailing list