public abstract class AbstractTestSuiteChunkerImpl<T> extends Object implements TestSuiteChunker
PrepareForTest annotation and whichever test-method
annotation the actual implementation-class specifies by overriding the
method 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 List<T> |
delegates |
protected Set<Class<?>> |
delegatesCreatedForTheseClasses |
protected static int |
NOT_INITIALIZED |
protected TestClassesExtractor |
prepareForTestExtractor |
protected TestClassesExtractor |
suppressionExtractor |
protected LinkedHashMap<Integer,List<Integer>> |
testAtDelegateMapper |
protected int |
testCount |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTestSuiteChunkerImpl(Class<?>... testClasses) |
protected |
AbstractTestSuiteChunkerImpl(Class<?> testClass) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
chunkClass(Class<?> testClass) |
protected abstract T |
createDelegatorFromClassloader(ClassLoader classLoader,
Class<?> testClass,
List<Method> methodsToTest) |
ClassLoader |
createNewClassloader(Class<?> testClass,
String[] preliminaryClassesToLoadByMockClassloader,
String[] packagesToIgnore,
MockTransformer... extraMockTransformers)
Create a new class loader and load
classes from this
classloader. |
void |
createTestDelegators(Class<?> testClass,
List<TestChunk> chunks)
Create the test delegators needed for a whole class.
|
int |
getChunkSize()
Get the number of chunks defined in this suite.
|
int |
getDelegatorIndex(int testIndex)
Get the junit runner delegate that handles the test at index
testIndex. |
int |
getInternalTestIndex(int originalTestIndex)
Get the internal test index for a junit runner delegate based on the
"real" original test index.
|
protected Object |
getPowerMockTestListenersLoadedByASpecificClassLoader(Class<?> clazz,
ClassLoader classLoader) |
List<TestChunk> |
getTestChunks()
Get all chunk entries.
|
List<TestChunk> |
getTestChunksEntries(Class<?> testClass)
Get all chunk entries for a specific class.
|
Class<?>[] |
getTestClasses() |
protected boolean |
hasMockPolicyProvidedClasses(Class<?> testClass) |
protected Class<? extends Annotation> |
testMethodAnnotation() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTestCount, shouldExecuteTestForMethodprotected static final int NOT_INITIALIZED
protected final TestClassesExtractor prepareForTestExtractor
protected final TestClassesExtractor suppressionExtractor
protected final LinkedHashMap<Integer,List<Integer>> testAtDelegateMapper
protected volatile int testCount
protected AbstractTestSuiteChunkerImpl(Class<?> testClass) throws Exception
Exceptionprotected Object getPowerMockTestListenersLoadedByASpecificClassLoader(Class<?> clazz, ClassLoader classLoader)
public ClassLoader createNewClassloader(Class<?> testClass, String[] preliminaryClassesToLoadByMockClassloader, String[] packagesToIgnore, MockTransformer... extraMockTransformers)
TestSuiteChunkerclasses from this
classloader.createNewClassloader in interface TestSuiteChunkertestClass - TODOpreliminaryClassesToLoadByMockClassloader - An array of the fully qualified name of the classes to modify.packagesToIgnore - Packages to ignore.public final void createTestDelegators(Class<?> testClass, List<TestChunk> chunks) throws Exception
createTestDelegators in interface TestSuiteChunkerExceptionprotected Class<? extends Annotation> testMethodAnnotation()
protected abstract T createDelegatorFromClassloader(ClassLoader classLoader, Class<?> testClass, List<Method> methodsToTest) throws Exception
Exceptionpublic int getChunkSize()
TestSuiteChunkergetChunkSize in interface TestSuiteChunkerpublic List<TestChunk> getTestChunks()
TestSuiteChunkergetTestChunks in interface TestSuiteChunkerpublic 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 List<TestChunk> getTestChunksEntries(Class<?> testClass)
getTestChunksEntries in interface TestSuiteChunkertestClass - The class whose chunk entries to get.public Class<?>[] getTestClasses()
protected boolean hasMockPolicyProvidedClasses(Class<?> testClass)
true if there are some mock policies that
contributes with classes that should be loaded by the mock
classloader, false otherwise.Copyright © 2007–2015. All rights reserved.