public abstract class TestClassTransformer<T,M> extends java.lang.Object implements MockTransformer<T>
ConstructorsMockTransformer)
- to avoid that multiple public test-class constructors cause
a delegate runner from JUnit (or 3rd party) to bail out with an
error message such as "Test class can only have one constructor".
4) Set test-class defer constructor (if exist) as protected instead of public.
Otherwise a delegate runner from JUnit (or 3rd party) might get confused by
the presence of more than one test-class constructor and bail out with an
error message such as "Test class can only have one constructor".
The #3 and #4 enhancements will also be enforced on the constructors of classes that are nested within the test-class.
| Modifier and Type | Field and Description |
|---|---|
private MethodSignatureWriter<M> |
methodSignatureWriter |
private java.lang.Class<?> |
testClass |
private java.lang.Class<? extends java.lang.annotation.Annotation> |
testMethodAnnotationType |
| Constructor and Description |
|---|
TestClassTransformer(java.lang.Class<?> testClass,
java.lang.Class<? extends java.lang.annotation.Annotation> testMethodAnnotationType,
MethodSignatureWriter<M> methodSignatureWriter) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Class<?> |
getTestClass() |
protected java.lang.Class<? extends java.lang.annotation.Annotation> |
getTestMethodAnnotationType() |
protected java.lang.String |
signatureOf(M method) |
protected java.lang.String |
signatureOf(java.lang.reflect.Method m) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransformprivate final java.lang.Class<?> testClass
private final java.lang.Class<? extends java.lang.annotation.Annotation> testMethodAnnotationType
private final MethodSignatureWriter<M> methodSignatureWriter
public TestClassTransformer(java.lang.Class<?> testClass,
java.lang.Class<? extends java.lang.annotation.Annotation> testMethodAnnotationType,
MethodSignatureWriter<M> methodSignatureWriter)
protected java.lang.String signatureOf(M method)
protected java.lang.String signatureOf(java.lang.reflect.Method m)
protected java.lang.Class<? extends java.lang.annotation.Annotation> getTestMethodAnnotationType()
protected java.lang.Class<?> getTestClass()