public class SimpleCallableJavaComponentTestCase extends AbstractComponentTestCase
{
public void testComponentCreationWithObjectFactory() throws Exception
{
PrototypeObjectFactory objectFactory = new PrototypeObjectFactory(
Apple.class);
objectFactory.setObjectClass(Apple.class);
objectFactory.initialise();
SimpleCallableJavaComponent component = new SimpleCallableJavaComponent(
objectFactory);
assertNotNull(component.getObjectFactory());
assertEquals(objectFactory, component.getObjectFactory());
assertEquals(Apple.class, component.getObjectFactory().getObjectClass());
assertEquals(Apple.class, component.getObjectType());
objectFactory = new PrototypeObjectFactory(Orange.class);
objectFactory.setObjectClass(Orange.class);
objectFactory.initialise();
try
{
component = new SimpleCallableJavaComponent(objectFactory);
}