package ejbtest;

import javax.naming.InitialContext;
import junit.framework.*;
import junit.extensions.*;

public class TestEntity extends TestCase {
    
    private EntityAHome _entityAHome = null; 

    public TestEntity(String name) 
        throws Exception {

        super(name);

        InitialContext jndiContext = new InitialContext();
        Object obj = jndiContext.lookup("test/EntityA");
        
        _entityAHome = (EntityAHome)javax.rmi.PortableRemoteObject.narrow(obj, EntityAHome.class);        
    }
        
    public void testCacheClearing() 
        throws Exception {

        EntityA a1 = _entityAHome.create(0);
        a1.remove();

        EntityA a2 = _entityAHome.create(0);
        a2.remove();        
    }
}
