* If args are present, we expect exactly one integer argument, defining the index of
* the parameter set for a parameterized test.
*/
if (args.length > 0) {
if (!(args[0] instanceof Integer)) {
throw new TestContainerException("Integer argument expected");
}
index = (Integer) args[0];
}
// find matching method
for (Method m : testClass.getMethods()) {
if (m.getName().equals(method)) {
// we assume its correct:
invokeViaServletBridge(testClass, m, index);
return true;
}
}
}
catch (NoClassDefFoundError e) {
throw new TestContainerException(e);
}
catch (IOException e) {
throw new TestContainerException(e);
}
catch (ClassNotFoundException e) {
throw new TestContainerException(e);
}
return false;
}