提交 20a00c5e 编写于 作者: K kohsuke

turns out I couldn't use it, but since I wrote it, I'm committing it.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@25774 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1fd0978c
package org.jvnet.hudson.test;
import junit.framework.TestCase;
/**
* Tests that the specified class has the default constructor.
*
* @author Kohsuke Kawaguchi
*/
public class DefaultConstructorChecker extends TestCase {
private final Class clazz;
public DefaultConstructorChecker(Class clazz) {
this.clazz = clazz;
setName(clazz.getName()+".verifyDefaultConstructor");
}
@Override
protected void runTest() throws Throwable {
try {
clazz.getConstructor();
} catch (NoSuchMethodException e) {
throw new Error(clazz+" must have the default constructor",e);
} catch (SecurityException e) {
throw new Error(clazz+" must have the default constructor",e);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册