this.method = method;
try {
this.instance = klass.newInstance();
} catch (InstantiationException e) {
throw new InitializationError(e);
} catch (IllegalAccessException e) {
throw new InitializationError(e);
}
TestScript scriptData = klass.getAnnotation(TestScript.class);
if (scriptData == null) {
this.testScript = null;
} else {
try {
String source = loadPath.load(scriptData.filename() + ".js");
this.testScript = new Script(scriptData.filename(), source, loadPath, "hegemon/unittest");
} catch (LoadError e) {
throw new InitializationError(e);
}
}
}