Package org.powermock.tests.utils.impl
Class AbstractCommonTestSuiteChunkerImpl
java.lang.Object
org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl
- All Implemented Interfaces:
TestSuiteChunker
- Direct Known Subclasses:
AbstractTestSuiteChunkerImpl,PowerMockRuleTestSuiteChunker
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayMergerprivate intprotected static final intprivate final IgnorePackagesExtractorprotected static final intprivate final List<TestCaseEntry> protected static final intprivate final TestClassesExtractorprivate final TestClassesExtractorprotected final LinkedHashMap<Integer, List<Integer>> protected final Class<?>[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCommonTestSuiteChunkerImpl(Class<?> testClass) protectedAbstractCommonTestSuiteChunkerImpl(Class<?>... testClasses) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchunkClass(Class<?> testClass) private MockTransformer[]createDefaultExtraMockTransformers(Class<?> testClass, List<Method> testMethodsThatRunOnOtherClassLoaders) private ClassLoadercreateDefaultMockLoader(Class<?> testClass, MockTransformer[] extraMockTransformers, String[] ignorePackages) private ClassLoadercreateNewClassloader(Class<?> testClass, String[] classesToLoadByMockClassloader, String[] packagesToIgnore, MockTransformer... extraMockTransformers) private voidfindMethods(TestCaseEntry testCaseEntry, Class<?> testClass) intGet the number of chunks defined in this suite.protected MockClassLoaderFactorygetMockClassLoaderFactory(Class<?> testClass, String[] preliminaryClassesToLoadByMockClassloader, String[] packagesToIgnore, MockTransformer[] extraMockTransformers) private String[]getStaticSuppressionClasses(Class<?> testClass, Method method) getTestChunk(Method method) Get TestChunk for the given method.Get all chunk entries.getTestChunksEntries(Class<?> testClass) Get all chunk entries for a specific class.private booleanhasChunkAnnotation(Method method) private voidinitEntries(List<TestCaseEntry> entries) private voidputMethodToChunk(TestCaseEntry testCaseEntry, Class<?> testClass, Method method) protected voidregisterProxyframework(ClassLoader classLoader) protected Class<? extends Annotation> private voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.powermock.tests.utils.TestSuiteChunker
shouldExecuteTestForMethod
-
Field Details
-
DEFAULT_TEST_LISTENERS_SIZE
protected static final int DEFAULT_TEST_LISTENERS_SIZE- See Also:
-
NOT_INITIALIZED
protected static final int NOT_INITIALIZED- See Also:
-
INTERNAL_INDEX_NOT_FOUND
protected static final int INTERNAL_INDEX_NOT_FOUND- See Also:
-
internalSuites
-
prepareForTestExtractor
-
suppressionExtractor
-
testAtDelegateMapper
-
testClasses
-
ignorePackagesExtractor
-
arrayMerger
-
currentTestIndex
private int currentTestIndex
-
-
Constructor Details
-
Method Details
-
getChunkSize
public int getChunkSize()Description copied from interface:TestSuiteChunkerGet the number of chunks defined in this suite.- Specified by:
getChunkSizein interfaceTestSuiteChunker- Returns:
- The number of chunks defined in the correct suite.
-
getTestChunks
Description copied from interface:TestSuiteChunkerGet all chunk entries.- Specified by:
getTestChunksin interfaceTestSuiteChunker- Returns:
- An set of entries that contains a list of methods contained in the chunk and the class loader that loaded these methods.
-
getTestChunksEntries
Get all chunk entries for a specific class.- Specified by:
getTestChunksEntriesin interfaceTestSuiteChunker- Parameters:
testClass- The class whose chunk entries to get.- Returns:
- An set of entries that contains a list of methods contained in the chunk for the specific test class and the class loader that loaded these methods.
-
getTestChunk
Description copied from interface:TestSuiteChunkerGet TestChunk for the given method.- Specified by:
getTestChunkin interfaceTestSuiteChunker- Parameters:
method- - method for which test chunk should be found.- Returns:
- TestChunk for this method.
-
registerProxyframework
-
chunkClass
- Throws:
Exception
-
createDefaultMockLoader
private ClassLoader createDefaultMockLoader(Class<?> testClass, MockTransformer[] extraMockTransformers, String[] ignorePackages) -
createNewClassloader
private ClassLoader createNewClassloader(Class<?> testClass, String[] classesToLoadByMockClassloader, String[] packagesToIgnore, MockTransformer... extraMockTransformers) -
getMockClassLoaderFactory
protected MockClassLoaderFactory getMockClassLoaderFactory(Class<?> testClass, String[] preliminaryClassesToLoadByMockClassloader, String[] packagesToIgnore, MockTransformer[] extraMockTransformers) -
createDefaultExtraMockTransformers
private MockTransformer[] createDefaultExtraMockTransformers(Class<?> testClass, List<Method> testMethodsThatRunOnOtherClassLoaders) -
testMethodAnnotation
-
initEntries
-
findMethods
-
putMethodToChunk
-
hasChunkAnnotation
-
getStaticSuppressionClasses
-
updatedIndexes
private void updatedIndexes()
-