public abstract class AbstractTestSuiteChunkerImpl<T> extends AbstractCommonTestSuiteChunkerImpl implements RunnerTestSuiteChunker
PrepareForTest
annotation and whichever test-method
annotation the actual implementation-class specifies by overriding the
method AbstractCommonTestSuiteChunkerImpl.testMethodAnnotation()
. This to make sure that you
can byte-code manipulate classes in tests without impacting on other tests.Modifier and Type | Field and Description |
---|---|
protected java.util.List<T> |
delegates |
protected java.util.Set<java.lang.Class<?>> |
delegatesCreatedForTheseClasses |
protected int |
testCount |
DEFAULT_TEST_LISTENERS_SIZE, INTERNAL_INDEX_NOT_FOUND, NOT_INITIALIZED, testAtDelegateMapper, testClasses
Modifier | Constructor and Description |
---|---|
protected |
AbstractTestSuiteChunkerImpl(java.lang.Class<?>... testClasses) |
protected |
AbstractTestSuiteChunkerImpl(java.lang.Class<?> testClass) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
createDelegatorFromClassloader(java.lang.ClassLoader classLoader,
java.lang.Class<?> testClass,
java.util.List<java.lang.reflect.Method> methodsToTest) |
void |
createTestDelegators(java.lang.Class<?> testClass,
java.util.List<TestChunk> chunks)
Create the test delegators needed for a whole class.
|
int |
getDelegatorIndex(int testIndex)
Get the junit runner delegate that handles the test at index
testIndex . |
protected MockingFrameworkReporterFactory |
getFrameworkReporterFactory() |
int |
getInternalTestIndex(int originalTestIndex)
Get the internal test index for a junit runner delegate based on the
"real" original test index.
|
protected java.lang.Object |
getPowerMockTestListenersLoadedByASpecificClassLoader(java.lang.Class<?> clazz,
java.lang.ClassLoader classLoader) |
java.lang.Class<?>[] |
getTestClasses() |
chunkClass, getChunkSize, getMockClassLoaderFactory, getTestChunk, getTestChunks, getTestChunksEntries, registerProxyframework, testMethodAnnotation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTestCount
getChunkSize, getTestChunk, getTestChunks, getTestChunksEntries, shouldExecuteTestForMethod
protected final java.util.Set<java.lang.Class<?>> delegatesCreatedForTheseClasses
protected final java.util.List<T> delegates
protected volatile int testCount
protected AbstractTestSuiteChunkerImpl(java.lang.Class<?> testClass) throws java.lang.Exception
java.lang.Exception
protected AbstractTestSuiteChunkerImpl(java.lang.Class<?>... testClasses) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object getPowerMockTestListenersLoadedByASpecificClassLoader(java.lang.Class<?> clazz, java.lang.ClassLoader classLoader)
public final void createTestDelegators(java.lang.Class<?> testClass, java.util.List<TestChunk> chunks) throws java.lang.Exception
createTestDelegators
in interface RunnerTestSuiteChunker
java.lang.Exception
protected abstract T createDelegatorFromClassloader(java.lang.ClassLoader classLoader, java.lang.Class<?> testClass, java.util.List<java.lang.reflect.Method> methodsToTest) throws java.lang.Exception
java.lang.Exception
public int getInternalTestIndex(int originalTestIndex)
originalTestIndex
- The original test index as seen by the test runner.-1
if no index was found.public int getDelegatorIndex(int testIndex)
testIndex
. Throws a RuntimeException
if a delegator
is not found for the specific test index.testIndex
- The test index that a delegator should hold.public java.lang.Class<?>[] getTestClasses()
protected MockingFrameworkReporterFactory getFrameworkReporterFactory()