public abstract class AbstractTestSuiteChunkerImpl<T> extends Object implements TestSuiteChunker
PrepareForTest
annotation. 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[] classesToLoadByMockClassloader,
String[] packagesToIgnore)
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTestCount, shouldExecuteTestForMethod
protected 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
Exception
protected Object getPowerMockTestListenersLoadedByASpecificClassLoader(Class<?> clazz, ClassLoader classLoader)
public ClassLoader createNewClassloader(Class<?> testClass, String[] classesToLoadByMockClassloader, String[] packagesToIgnore)
TestSuiteChunker
classes
from this
classloader.createNewClassloader
in interface TestSuiteChunker
testClass
- TODOclassesToLoadByMockClassloader
- An array of the fully qualified name of the classes to modify.packagesToIgnore
- Packages to ignore.public void createTestDelegators(Class<?> testClass, List<TestChunk> chunks) throws Exception
createTestDelegators
in interface TestSuiteChunker
Exception
protected abstract T createDelegatorFromClassloader(ClassLoader classLoader, Class<?> testClass, List<Method> methodsToTest) throws Exception
Exception
public int getChunkSize()
TestSuiteChunker
getChunkSize
in interface TestSuiteChunker
public List<TestChunk> getTestChunks()
TestSuiteChunker
getTestChunks
in interface TestSuiteChunker
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 List<TestChunk> getTestChunksEntries(Class<?> testClass)
getTestChunksEntries
in interface TestSuiteChunker
testClass
- 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-2012. All Rights Reserved.