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 int
(package private) static final int
(package private) static final int
private final List
<TestCaseEntry> protected static final int
(package private) final LinkedHashMap
<Integer, List<Integer>> (package private) final Class<?>[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractCommonTestSuiteChunkerImpl
(Class<?> testClass) (package private)
AbstractCommonTestSuiteChunkerImpl
(Class<?>... testClasses) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
chunkClass
(Class<?> testClass) private ClassLoader
createClassLoaderForMethod
(Class<?> testClass, Method method) private ClassLoader
createDefaultMockLoader
(Class<?> testClass, Collection<Method> testMethodsForOtherClassLoaders) private void
findMethods
(TestCaseEntry testCaseEntry, Class<?> testClass) int
Get the number of chunks defined in this suite.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 boolean
hasChunkAnnotation
(Method method) private void
initEntries
(List<TestCaseEntry> entries) private void
putMethodToChunk
(TestCaseEntry testCaseEntry, Class<?> testClass, Method method) protected Class
<? extends Annotation> private void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.powermock.tests.utils.TestSuiteChunker
shouldExecuteTestForMethod
-
Field Details
-
NOT_INITIALIZED
protected static final int NOT_INITIALIZED- See Also:
-
DEFAULT_TEST_LISTENERS_SIZE
static final int DEFAULT_TEST_LISTENERS_SIZE- See Also:
-
INTERNAL_INDEX_NOT_FOUND
static final int INTERNAL_INDEX_NOT_FOUND- See Also:
-
internalSuites
-
testAtDelegateMapper
-
testClasses
-
currentTestIndex
private int currentTestIndex
-
-
Constructor Details
-
Method Details
-
getChunkSize
public int getChunkSize()Description copied from interface:TestSuiteChunker
Get the number of chunks defined in this suite.- Specified by:
getChunkSize
in interfaceTestSuiteChunker
- Returns:
- The number of chunks defined in the correct suite.
-
getTestChunks
Description copied from interface:TestSuiteChunker
Get all chunk entries.- Specified by:
getTestChunks
in 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
Description copied from interface:TestSuiteChunker
Get all chunk entries for a specific class.- Specified by:
getTestChunksEntries
in 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:TestSuiteChunker
Get TestChunk for the given method.- Specified by:
getTestChunk
in interfaceTestSuiteChunker
- Parameters:
method
- - method for which test chunk should be found.- Returns:
- TestChunk for this method.
-
chunkClass
- Throws:
Exception
-
createDefaultMockLoader
private ClassLoader createDefaultMockLoader(Class<?> testClass, Collection<Method> testMethodsForOtherClassLoaders) -
putMethodToChunk
-
createClassLoaderForMethod
-
testMethodAnnotation
-
initEntries
-
findMethods
-
hasChunkAnnotation
-
updatedIndexes
private void updatedIndexes()
-