User: starksm Date: 02/04/17 12:06:45 Modified: src/main/org/jboss/test/bank/ejb Tag: Branch_2_4 CustomerBean.java TellerBean.java Log: Add tests of creating and removing an entity using the default commit option to test caching. Revision Changes Path No revision No revision 1.4.2.1 +7 -38 jbosstest/src/main/org/jboss/test/bank/ejb/CustomerBean.java Index: CustomerBean.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/bank/ejb/CustomerBean.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- CustomerBean.java 20 Jan 2001 16:32:51 -0000 1.4 +++ CustomerBean.java 17 Apr 2002 19:06:44 -0000 1.4.2.1 @@ -14,8 +14,8 @@ /** * * @see <related> - * @author $Author: osh $ - * @version $Revision: 1.4 $ + * @author $Author: starksm $ + * @version $Revision: 1.4.2.1 $ */ public class CustomerBean extends EntitySupport @@ -37,21 +37,11 @@ return id; } - public void setId(String id) - { - this.id = id; - } - public String getName() { return name; } - public void setName(String name) - { - this.name = name; - } - public Collection getAccounts() { return accounts; @@ -69,40 +59,16 @@ // EntityHome implementation ------------------------------------- public CustomerPK ejbCreate(String id, String name) - { - setId(id); - setName(name); + { + this.id = id; + this.name = name; accounts = new ArrayList(); - - CustomerPK pk = new CustomerPK(); - pk.id = id; - pk.name = name; + CustomerPK pk = new CustomerPK(id, name); return pk; } - + public void ejbPostCreate(String id, String name) { } } - -/* - * $Id: CustomerBean.java,v 1.4 2001/01/20 16:32:51 osh Exp $ - * Currently locked by:$Locker: $ - * Revision: - * $Log: CustomerBean.java,v $ - * Revision 1.4 2001/01/20 16:32:51 osh - * More cleanup to avoid verifier warnings. - * - * Revision 1.3 2001/01/07 23:14:34 peter - * Trying to get JAAS to work within test suite. - * - * Revision 1.2 2000/09/30 01:00:54 fleury - * Updated bank tests to work with new jBoss version - * - * Revision 1.1.1.1 2000/06/21 15:52:37 oberg - * Initial import of jBoss test. This module contains CTS tests, some simple examples, and small bean suites. - * - * - * - */ 1.3.2.1 +27 -16 jbosstest/src/main/org/jboss/test/bank/ejb/TellerBean.java Index: TellerBean.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/bank/ejb/TellerBean.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -r1.3 -r1.3.2.1 --- TellerBean.java 7 Jan 2001 23:14:34 -0000 1.3 +++ TellerBean.java 17 Apr 2002 19:06:44 -0000 1.3.2.1 @@ -4,6 +4,7 @@ */ package org.jboss.test.bank.ejb; +import java.rmi.ServerException; import java.util.*; import javax.naming.InitialContext; @@ -14,8 +15,8 @@ /** * * @see <related> - * @author $Author: peter $ - * @version $Revision: 1.3 $ + * @author $Author: starksm $ + * @version $Revision: 1.3.2.1 $ */ public class TellerBean extends SessionSupport @@ -134,21 +135,28 @@ to.deposit(amount); } } + + public void createAndRemove(String customerID, String customerName) + throws ServerException + { + try + { + // Create a customer + CustomerHome home = (CustomerHome)new InitialContext().lookup(CustomerHome.COMP_NAME); + Customer customer = home.create(customerID, customerName); + System.out.println("Customer name="+customer.getName()); + customer.remove(); + System.out.println("Customer removed"); + // Recreate the customer + System.out.println("Recreate Customer"); + customer = home.create(customerID, customerName); + System.out.println("Customer name="+customer.getName()); + customer.remove(); + System.out.println("Customer removed"); + } + catch(Exception e) + { + throw new ServerException("Create failed", e); + } + } } -/* - * $Id: TellerBean.java,v 1.3 2001/01/07 23:14:34 peter Exp $ - * Currently locked by:$Locker: $ - * Revision: - * $Log: TellerBean.java,v $ - * Revision 1.3 2001/01/07 23:14:34 peter - * Trying to get JAAS to work within test suite. - * - * Revision 1.2 2000/09/30 01:00:55 fleury - * Updated bank tests to work with new jBoss version - * - * Revision 1.1.1.1 2000/06/21 15:52:37 oberg - * Initial import of jBoss test. This module contains CTS tests, some simple examples, and small bean suites. - * - * - * - */
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development