提交 479a8ee9 编写于 作者: K Kohsuke Kawaguchi

more test fixes

上级 b257b6f1
......@@ -54,12 +54,11 @@ public class TestExtensionLoader extends GuiceExtensionAnnotation<TestExtension>
@Override
protected boolean isActive(AnnotatedElement e) {
TestEnvironment env = TestEnvironment.get();
if (env==null) return false;
TestExtension a = e.getAnnotation(TestExtension.class);
if (a==null) return false; // stale index
String testName = a.value();
if (testName.length()>0 && !env.testCase.getName().equals(testName))
if (testName.length()>0 && env!=null && env.testCase!=null && !env.testCase.getName().equals(testName))
return false; // doesn't apply to this test
if (e instanceof Class) {
......
......@@ -111,10 +111,10 @@ public class ExtensionFinderTest extends HudsonTestCase {
@TestExtension("testErrorRecovery")
public static class BrokenExtension extends PageDecorator {
@Inject Comparable c;
public BrokenExtension() {
super(InjectingExtension.class);
throw new Error();
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册