User: salborini
  Date: 00/08/01 10:14:41

  Modified:    src/java/org/jboss/zol/testbean/client EjbossClient.java
  Log:
  Added test for persistence of non-pk fields in CMP entity
  
  Revision  Changes    Path
  1.9       +24 -5     zola/src/java/org/jboss/zol/testbean/client/EjbossClient.java
  
  Index: EjbossClient.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/zola/src/java/org/jboss/zol/testbean/client/EjbossClient.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- EjbossClient.java 2000/07/06 01:13:39     1.8
  +++ EjbossClient.java 2000/08/01 17:14:40     1.9
  @@ -30,7 +30,7 @@
    * It works with the HelloWorld2.jar bean jar.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  - * @version $Id: EjbossClient.java,v 1.8 2000/07/06 01:13:39 sylvain Exp $
  + * @version $Id: EjbossClient.java,v 1.9 2000/08/01 17:14:40 salborini Exp $
    */
   public class EjbossClient {
   
  @@ -130,8 +130,8 @@
               statefulSession.remove();
               System.out.println("ok");
   
  -
  -            System.out.println();
  +  
  +                     System.out.println();
               System.out.println();
               System.out.println("Test Entity Bean CMP");
               System.out.println("====================");
  @@ -185,9 +185,9 @@
   
               System.out.println();
               System.out.println();
  -            System.out.println();
  -
               System.out.println();
  +            
  +                     System.out.println();
               System.out.println();
               System.out.println("Test Entity Bean BMP");
               System.out.println("====================");
  @@ -260,12 +260,31 @@
   
               if (pkBean!= null) System.out.println("ok");
   
  +                     System.out.print("Retrieving other field...");
  +                     if (pkBean.getOtherField() == 0) {
  +                             System.out.println("0, ok");
  +                     } else {
  +                             System.out.println("failed");
  +                     }
  +                     System.out.print("Setting it to 4...");
  +                     pkBean.setOtherField(4);
  +                     System.out.println("ok");
  +                     
               System.out.print("Findind it again ... ") ;
   
               // Now we should be able to find it
               pkBean = pkHome.findByPrimaryKey(new AComplexPK(true, 10, 100,1000.0, 
"Marc"));
   
               if (pkBean != null) System.out.println("ok");
  +
  +                     // check if the other field has been saved
  +                     System.out.print("Retrieving other field again, should be 
4...");
  +                     int newValue = pkBean.getOtherField();
  +                     if (newValue == 4) {
  +                             System.out.println("4, ok");
  +                     } else {
  +                             System.out.println("failed, value is " + newValue);
  +                     }
   
               // Now remove it
               System.out.println("Removing the bean...");
  
  
  

Reply via email to