gdamour     2005/08/05 07:00:24

  Modified:    modules/openejb-builder/src/test/org/openejb/deployment
                        CMPSystemMethodIndicesTest.java
  Log:

  GERONIMO-665 - CMP - Prefetching of CMP and CMR fields.
  
  This is a final tweak to add to the transactional cache the CMP returned by
  finders and selects. This way when a CMP or CMR field is accessed after
  a finder or a select returning an entity, which is not associated to a
  prefetching group, only one query is executed by the engine.
  
  The previous implementation was executing two queries in this specific
  scenario.
  
  Revision  Changes    Path
  1.6       +15 -2     
openejb/modules/openejb-builder/src/test/org/openejb/deployment/CMPSystemMethodIndicesTest.java
  
  Index: CMPSystemMethodIndicesTest.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/CMPSystemMethodIndicesTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CMPSystemMethodIndicesTest.java   5 Feb 2005 02:36:25 -0000       1.5
  +++ CMPSystemMethodIndicesTest.java   5 Aug 2005 11:00:24 -0000       1.6
  @@ -60,6 +60,10 @@
   import org.openejb.EJBInstanceContext;
   import org.tranql.cache.CacheSlot;
   import org.tranql.cache.CacheTable;
  +import org.tranql.cache.GlobalSchema;
  +import org.tranql.ejb.EJB;
  +import org.tranql.ejb.EJBSchema;
  +import org.tranql.identity.IdentityDefinerBuilder;
   
   /**
    *
  @@ -72,7 +76,16 @@
       public void testSystemMethodIndices() throws Exception {
           CMPContainerBuilder builder = new CMPContainerBuilder();
           builder.setClassLoader(MockCMPEJB.class.getClassLoader());
  -        Map vopMap = builder.buildVopMap(MockCMPEJB.class, new 
CacheTable("mock", new CacheSlot[0], null, null, null, null), 
Collections.EMPTY_MAP, null, null, null, null, null, null, new HashMap());
  +        EJB ejb = new EJB("mock", "mock");
  +        EJBSchema ejbSchema = new EJBSchema("schema");
  +        ejbSchema.addEJB(ejb);
  +        CacheTable cacheTable = new CacheTable("mock", new CacheSlot[0], 
null, null, null, null);
  +        GlobalSchema globalSchema = new GlobalSchema("schema");
  +        globalSchema.addCacheTable(cacheTable);
  +        builder.setEJBName("mock");
  +        builder.setEJBSchema(ejbSchema);
  +        builder.initialize();
  +        Map vopMap = builder.buildVopMap(MockCMPEJB.class, cacheTable, 
Collections.EMPTY_MAP, null, new IdentityDefinerBuilder(ejbSchema, 
globalSchema), null, null, null, null, new HashMap());
           InterfaceMethodSignature[] signatures = (InterfaceMethodSignature[]) 
vopMap.keySet().toArray(new InterfaceMethodSignature[vopMap.size()]);
           SystemMethodIndices systemMethodIndices = 
SystemMethodIndices.createSystemMethodIndices(signatures, "setEntityContext", 
new String(EntityContext.class.getName()), "unsetEntityContext");
           EJBInstanceContext ctx = MockEJBInstanceContext.INSTANCE;
  
  
  

Reply via email to