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
This commit is contained in:
kohsuke committed 2010-01-13 20:08:43 +00:00
1 parent 1fd0978c76
commit 20a00c5e0d
1 file changed
+28
@@ -0,0 +1,28 @@
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);
}
}
}