Method testContainerObjects
EJB 1.1 [9.3] p. 127-129
Container must implement:
- Entity EJBHome class
- Entity EJBObject class
- Handle class
- HomeHandle class
- Meta-data class
Method testEjbFinder
EJB 1.1 [8.3.2] p. 90
An entity bean's home interface defines one or more finder methods,
one for each way to find and entity object or collection of entity objects
within the home.
Test stategy: Create a bean. Use the bean that has been previously
created, and call the finder method. Make sure that
a result set is returned and that the bean returned
has the same name associated with it as the bean that
was previously created.
throws: Exception -
Method testEjbLifeCycle
EJB 1.1 [8.4] p. 92
A client can get a reference to an existing entity objects
remote interface in any of the following ways:
- Receive the reference as a parameter in a method call.
- Find the entity object using a finder method defined in the EB home i/f.
- Obtain the reference from the entity objects' handle.
throws: Exception -
Method testEjbRemoteIF
EJB 1.1 [8.6] p. 93-94
The javax.ejb.EJBObject I/F defines the methods that allow the client
to perform the following:
- Obtain the home interface for the entity object
- Remove the entity object
- Obtain the entity object's handle
- Obtain the entity object's primary key
throws: Exception -
Method testEjbRemove
EJB 1.1 [8.3.3] p. 90
Test Strategy:
1) Create a bean to remove.
2) Attempt a simple remove using the remote interface.
3) Create a bean to remove.
4) Attempt a simple remove using the home interface and primary key.
5) Create a bean to remove.
6) Try to remove the instance using its handle.
7) Try to access the instance. This should result in a
java.rmi.NoSuchObjectException
throws: Exception -
Method testEntityHandle
EJB 1.1 [8.7] p. 93-94
- Client can get handle to remote interface
- Use javax.rmi.PortableRemoteObject.narrow(...) to convert the
result of the getEJBObject().
- An entity handle is typically implemented to be usable over a
long period of time it must be usable at least across a server
restart.
throws: Exception -
Method testPrimaryKeyObjectIdentity
EJB 1.1 [8.5] p. 92-93
Every entity object has a unique identity within its home. If
two entity objects have the same home and the same primary key
they are considered identitcal.
getPrimaryKey() always returns the same value when called one the
same entity object.
A client can test whether two entity object references refer to the
same entity object by using the isIdentical(EBJObject) method.
Alternatively, if a client obtains two entity object references from
the same home, it can determin if they refer to the same entity by comparing
their primary keys using the 'equals' method.
throws: Exception -