jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robertson, Jason" <Jason.Robert...@acs-inc.com>
Subject RE: CMR testing
Date Thu, 08 Aug 2002 14:16:51 GMT
You can create a transaction by hand, for example:

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.transaction.UserTransaction;

public class MyTest extends ServletTestCase
   private Context         _ctx = null;
   private UserTransaction _ut  = null;

   public void setUp() throws Exception
      _ctx = new InitialContext();
      _ut = (UserTransaction)

   public void tearDown() throws Exception
      if (_ut != null) _ut.commit();
      if (_ctx != null) _ctx.close();


Each testXXX method will now be in the context of a transaction.


-----Original Message-----
From: Gustavo Hexsel [mailto:GHexsel@mercador.com]
Sent: Wednesday, August 07, 2002 6:32 PM
To: 'cactus-user@jakarta.apache.org'
Subject: CMR testing

	Does Cactus provide any facilities to test CMR on CMP2.x beans? 
	I tried a servlet redirector, but it seems I cannot use CMR
collections outside their creation transactions, and I think that creating a
session bean to test an entity bean would be overkill!

	Thanks a lot,

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>

View raw message