User: starksm 
  Date: 02/02/12 01:38:00

  Modified:    src/main/org/jboss/test/perf/ejb EntityBean.java
                        SessionBean.java TxSessionBean.java
  Log:
  Fix some problems with the key ranges and add an assertion in the
  Session.remove(int low, int high) method that the remove count
  is as expected.
  
  Revision  Changes    Path
  1.2       +78 -70    jbosstest/src/main/org/jboss/test/perf/ejb/EntityBean.java
  
  Index: EntityBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/ejb/EntityBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EntityBean.java   25 Aug 2000 13:43:43 -0000      1.1
  +++ EntityBean.java   12 Feb 2002 09:37:59 -0000      1.2
  @@ -2,74 +2,82 @@
   // EntityBean.java
   import org.jboss.test.perf.interfaces.EntityPK;
   
  -public class EntityBean implements javax.ejb.EntityBean {
  -
  -  private javax.ejb.EntityContext _context;
  -  private transient boolean       isDirty; //WL
  -
  -  public int the_key;
  -  public int the_value;
  -
  -  public int read() {
  -    // WL
  -    setModified(false); // to avoid writing
  -    return the_value;
  -  }
  -  
  -  public void write(int the_value) {
  -    // WL
  -    setModified(true); // to force writing
  -    this.the_value = the_value;
  -  }
  -
  -  public EntityPK ejbCreate(int the_key, int the_value) {
  -    this.the_key = the_key;
  -    this.the_value = the_value;
  -    return null;
  -  }
  -
  -  public void ejbPostCreate(int the_key, int the_value) {
  -  }
  -
  -  public void ejbRemove() {
  -  }
  -
  -  public void setEntityContext(javax.ejb.EntityContext context) {
  -    _context = context;
  -  }
  -
  -  public void unsetEntityContext() {
  -    _context = null;
  -  }
  -
  -  public void ejbActivate() {
  -  }
  -
  -  public void ejbPassivate() {
  -  }
  -
  -  public void ejbLoad() {
  -    // WL
  -    setModified(false); // to avoid writing
  -  }
  -
  -  public void ejbStore() {
  -    // WL
  -    setModified(false); // to avoid writing
  -  }
  -
  -  public String toString() {
  -    return "EntityBean[the_key=" + the_key + ",the_value=" + the_value +"]";
  -  }
  -
  -  // WL
  -  public boolean isModified() {
  -    return isDirty;
  -  }
  -  // WL
  -  public void setModified(boolean flag) {
  -    isDirty = flag;
  -  }
  -
  -
  +public class EntityBean implements javax.ejb.EntityBean
  +{
  +   private javax.ejb.EntityContext _context;
  +   private transient boolean isDirty;
  +   
  +   public int the_key;
  +   public int the_value;
  +   
  +   public int read()
  +   {
  +      setModified(false); // to avoid writing
  +      return the_value;
  +   }
  +   
  +   public void write(int the_value)
  +   {
  +      setModified(true); // to force writing
  +      this.the_value = the_value;
  +   }
  +   
  +   public EntityPK ejbCreate(int the_key, int the_value)
  +   {
  +      this.the_key = the_key;
  +      this.the_value = the_value;
  +      return null;
  +   }
  +   
  +   public void ejbPostCreate(int the_key, int the_value)
  +   {
  +   }
  +   
  +   public void ejbRemove()
  +   {
  +   }
  +   
  +   public void setEntityContext(javax.ejb.EntityContext context)
  +   {
  +      _context = context;
  +   }
  +   
  +   public void unsetEntityContext()
  +   {
  +      _context = null;
  +   }
  +   
  +   public void ejbActivate()
  +   {
  +   }
  +   
  +   public void ejbPassivate()
  +   {
  +   }
  +   
  +   public void ejbLoad()
  +   {
  +      setModified(false); // to avoid writing
  +   }
  +   
  +   public void ejbStore()
  +   {
  +      setModified(false); // to avoid writing
  +   }
  +   
  +   public String toString()
  +   {
  +      return "EntityBean[the_key=" + the_key + ",the_value=" + the_value +"]";
  +   }
  +   
  +   public boolean isModified()
  +   {
  +      return isDirty;
  +   }
  +
  +   public void setModified(boolean flag)
  +   {
  +      isDirty = flag;
  +   }
  +   
   }
  
  
  
  1.3       +4 -0      jbosstest/src/main/org/jboss/test/perf/ejb/SessionBean.java
  
  Index: SessionBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/ejb/SessionBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SessionBean.java  13 Jul 2001 17:14:33 -0000      1.2
  +++ SessionBean.java  12 Feb 2002 09:38:00 -0000      1.3
  @@ -82,11 +82,15 @@
         else
         {
            java.util.Enumeration elements = findInRange(low, high);
  +         int count = 0;
            while(elements.hasMoreElements())
            {
               Entity entity = (Entity) elements.nextElement();
               entity.remove();
  +            count ++;
            }
  +         if( count != (high-low) )
  +            throw new RemoveException("Removed "+count+" but should 
remove:"+(high-low));
         }
      }
   
  
  
  
  1.3       +0 -3      jbosstest/src/main/org/jboss/test/perf/ejb/TxSessionBean.java
  
  Index: TxSessionBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/ejb/TxSessionBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TxSessionBean.java        13 Jul 2001 17:14:33 -0000      1.2
  +++ TxSessionBean.java        12 Feb 2002 09:38:00 -0000      1.3
  @@ -24,17 +24,14 @@
      
      public void ejbActivate()
      {
  -      System.out.println("TxSessionBean.ejbActivate() called");
      }
      
      public void ejbPassivate()
      {
  -      System.out.println("TxSessionBean.ejbPassivate() called");
      }
      
      public void ejbRemove()
      {
  -      System.out.println("TxSessionBean.ejbRemove() called");
      }
   
      public void setSessionContext(SessionContext context)
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to