[jboss-dev] MDB integration tests

Adrian adrian_brock at jboss.org
Wed Jan 17 11:45:38 EST 2007


The tests that get run are in

org.jboss.test.messagedriven.test.*

Most of them just delegate to simple base tests that do things like
send/check message received, but with different configurations like
CMT/Required, BMT, Queue/Topic, etc.

These base tests are in 
org.jboss.test.messagedriven.support.*

If your looking for the "code", the tests use the command pattern.
i.e. the operations define what is run.

The operations query an MBean that the mdbs update with the state, 
e.g. the messages received, what messages went to the DLQ, etc.

   public Operation[] getOperations() throws Exception
   {
      return new Operation[]
      {
         new SendMessageOperation(this, "1"),
         new CheckMessageSizeOperation(this, 1, 0),
         new CheckJMSDestinationOperation(this, 0,
getDestination().toString()),
         new CheckMessageIDOperation(this, 0, "1"),
      };
   }


On Wed, 2007-01-17 at 16:23 +0000, Tim Fox wrote:
> I didn't see it before, but now I've had a quick look.
> 
> I still can't work out though if this is just a framework or it contains 
> actual tests.... or where those tests are.
> 
> Weston Price wrote:
> > Note, Tim I specifically mentioned org.jboss.test.messagedriven. This is
> > the framework I was talking about. I am not sure if you read the post or
> > you just didn't see it. 
> > 
> > 
> > 
> > -----Original Message-----
> > From: Adrian Brock 
> > Sent: Wednesday, January 17, 2007 9:44 AM
> > To: JBoss.org development list
> > Cc: Tim Fox; Weston Price
> > Subject: Re: [jboss-dev] MDB integration tests
> > 
> >> Scott M Stark wrote:
> >>> They are spread out. Other mdb tests are:
> >>>
> >>> testsuite module:
> >>> org.jboss.test.cts.test.MDBUnitTestCase
> >>> org.jboss.test.jca.test.InflowUnitTestCase
> >>>
> >>> ejb3 module:
> >>> org.jboss.ejb3.test.mdb
> >>> org.jboss.ejb3.test.mdbtopic
> >>> org.jboss.ejb3.test.mdbtransactions
> >>>
> > 
> > On Sat, 2007-01-13 at 18:48 +0000, Tim Fox wrote:
> >> The coverage still seems very poor w.r.t. integration tests, unless
> > I'm 
> >> missing something.
> >>
> > 
> > That is true of org.jboss.test.mdb 
> > 
> > I remember complaining about them 3 years ago, they are not good tests.
> > I only left them in place because you can never have too many tests. :-)
> > 
> > The real tests are in org.jboss.test.messagedriven
> > 
> > Theses tests use a framework that creates the same tests for
> > old = JMSContainerInvoker
> > new = JCA Inflow
> > 
> > They have a simple format:
> > 
> > properties - for configuration of the activiation spec or the invoker
> > proxy
> > 
> > operation - steps in the test (including assertions)
> > 
> > See org.jboss.test.messagedriven.support.BaseMessageDrivenTest
> > 
> >    public void runTest(Operation[] ops, Properties props) throws
> > 
> > So you can trivially add new tests without having to create
> > new MDB deployments for each test.
> > 
> > e.g. The single mdb for JCA1.5 looks like this:
> >       <message-driven>
> >          <ejb-name>TestMDB</ejb-name>
> >          <activation-config>
> >             <activation-config-property>
> > 
> > <activation-config-property-name>destination</activation-config-property
> > -name>
> > 
> > <activation-config-property-value>${test.messagedriven.destination}</act
> > ivation-config-property-value>
> >             </activation-config-property>
> >             <activation-config-property>
> > 
> > <activation-config-property-name>destinationType</activation-config-prop
> > erty-name>
> > 
> > <activation-config-property-value>${test.messagedriven.destinationType}<
> > /activation-config-property-value>
> >             </activation-config-property>
> > etc....
> > 
> > But they are incomplete until this task is done:
> > http://jira.jboss.com/jira/browse/JBAS-1434
> > 
> >>  From the point of view of JBM (and JBossMQ) we need to know all the 
> >> main use cases are tests with the JMSContainerInvoker, and also using 
> >> JCA1.5 inflow now this is apparently supported in production.
> >>
> >> Without proper coverage we can't have any confidence that JBM (or 
> >> JBossMQ) will work correctly with the app server.
> >>
> >> I've added a task to get these tests sorted before we release JBM 1.2.
> > 
> > Is that this task?
> > http://jira.jboss.com/jira/browse/JBMESSAGING-170
> 
-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx




More information about the jboss-development mailing list