}
} else {
try {
testContainerFactoryClass = Class.forName(tcfClassName).asSubclass(TestContainerFactory.class);
} catch (ClassNotFoundException ex) {
throw new TestContainerException(
"The default test container factory class name, "
+ tcfClassName
+ ", cannot be loaded", ex);
} catch (ClassCastException ex) {
throw new TestContainerException(
"The default test container factory class, "
+ tcfClassName
+ ", is not an instance of TestContainerFactory", ex);
}
}
}
try {
return testContainerFactoryClass.newInstance();
} catch (Exception ex) {
throw new TestContainerException(
"The default test container factory, "
+ testContainerFactoryClass
+ ", could not be instantiated", ex);
}
}