Return-Path: Delivered-To: apmail-jakarta-cactus-user-archive@apache.org Received: (qmail 55315 invoked from network); 19 Dec 2001 19:54:51 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 19 Dec 2001 19:54:51 -0000 Received: (qmail 7542 invoked by uid 97); 19 Dec 2001 19:54:51 -0000 Delivered-To: qmlist-jakarta-archive-cactus-user@jakarta.apache.org Received: (qmail 7443 invoked by uid 97); 19 Dec 2001 19:54:47 -0000 Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Cactus Users List" Reply-To: "Cactus Users List" Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 7336 invoked from network); 19 Dec 2001 19:54:45 -0000 From: "Vincent Massol" To: "'Cactus Users List'" Cc: Subject: JMS support in Cactus (WAS RE: [junit] Using JUnit or Cactus for testing JMS) Date: Wed, 19 Dec 2001 20:50:18 -0000 Organization: OCTO Technology Message-ID: <000301c188ce$dc9dbc90$92e16dd9@octovma> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Alan, Cactus does not currently support unit testing of JMS applications. At the current time, it only has an HTTP injector. However, I am also interested in unit testing JMS listeners, especially EJB Message-Driven Beans. I'm planning to include a JMS injector (i.e. the ability to send a JMS message in the beginXXX() method of a test case) and have a Cactus MDB redirector which would make available the Message object to your test case, in the same spirit as what Cactus currently does for Servlets/Taglibs/Filters. Thus a typical test case would be : Public MyTestCase extends MDBTestCase { [...] public void beginXXX(JMSRequest request) { // set up the message to send [...] } public void testXXX() { MyMDBBean mdb = new MyMDBBean(); mdb.onMessage(message); // perform asserts } [...] } In summary : - the focus is on unit testing MDB, not in testing the JMS server - it is focused on testing MDB, not generic JMS listeners - a subsequent version might provide a generic JMS listener redirector (i.e. not a MDB) What do you think ? Would you like this ? Thanks -Vincent > -----Original Message----- > From: Alan Pearlman Spencer [mailto:aspencer@mobileaware.com] > Sent: 22 November 2001 09:43 > To: junit@yahoogroups.com > Subject: RE: [junit] Using JUnit or Cactus for testing JMS > > I suppose you are correct. > I already have these tests. The way the DE as you call it > sends messages is a function of how it is configured and I > have tests for the "local" version that just uses Java calls. > > I think what I am doing is moving into a system type test... > > Thanks for the reference to Mock etc. I am a little unsure about > these as we are using JUnit for unit and system/integration > testing (differentiating these clearly) and I can (hopefully) > have my unit tests not need mock objects and make sure the system > tests cover this. Thoughts? We will be using HttpUnit and/or > Cactus for the system tests. We define system tests to be ones > the require the application to be deployed in a container > and running... > > Thanks, > Alan. > > -----Original Message----- > From: Manu [mailto:mamago@bigfoot.com] > Sent: 21 November 2001 19:08 > To: junit@yahoogroups.com > Subject: RE: [junit] Using JUnit or Cactus for testing JMS > > > I have not used JMS, therefore I can only guess... > > What you want to test is the 'Decision Engine' (DE), right? Then, why > don't you test the DE? > > Approach: > Write a couple of tests that use known 'Reject' and 'Accept' messages. > If > a test case allows a 'Reject' message through (no need to use the whole > JMS system, just put the pre-constructed message through the appropriate > procedure call), the test has failed. The opposite is also true: if an > 'Accept' message is rejected, the test fails. > > You could also test the 'Destination (To) Engine' (TE). Create a couple > of messages for some known destinations, and check that the chosen > destination for the given message has been chosen. Otherwise, the test > fails. > > (If the DE and TE are combined into one method, try combining the test > cases: known recepient/'Reject'/'Accept' pair. Otherwise, look into > separating both procedures, although this may not be practical.) > > In creating these tests, it might help to know about Mock Objects, or > other alternatives (Object Mother, etc.). See the NG archives for > pointers. > > Regards, > > Manuel Amago. > mailto:mamago@bigfoot.com > > > -----Original Message----- > > From: Alan Pearlman Spencer [mailto:aspencer@mobileaware.com] > > Sent: 21 November 2001 10:20 > > To: Cactus Users List; junit@yahoogroups.com > > Subject: [junit] Using JUnit or Cactus for testing JMS > > > > > > Hi All, > > I was wondering if you could help me with something... > > I am trying to write Unit/System tests... > > > To unsubscribe from this group, send an email to: > junit-unsubscribe@yahoogroups.com > > > Your use of Yahoo! Groups is subject to > http://docs.yahoo.com/info/terms/ > > > > ------------------------ Yahoo! Groups Sponsor ---------------------~--> > Universal Inkjet Refill Kit $29.95 > Refill any ink cartridge for less! > Includes black and color ink. > http://us.click.yahoo.com/E11sED/MkNDAA/ySSFAA/NhFolB/TM > ---------------------------------------------------------------------~-> > > To unsubscribe from this group, send an email to: > junit-unsubscribe@yahoogroups.com > > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ > -- To unsubscribe, e-mail: For additional commands, e-mail: