Class JUnit4TestSuiteChunkerImpl
- java.lang.Object
-
- org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl
-
- org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl<PowerMockJUnitRunnerDelegate>
-
- org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl
-
- All Implemented Interfaces:
org.junit.runner.manipulation.Filterable
,org.junit.runner.manipulation.Sortable
,JUnit4TestSuiteChunker
,RunnerTestSuiteChunker
,TestSuiteChunker
public class JUnit4TestSuiteChunkerImpl extends AbstractTestSuiteChunkerImpl<PowerMockJUnitRunnerDelegate> implements JUnit4TestSuiteChunker, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable
-
-
Field Summary
-
Fields inherited from class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl
delegates, delegatesCreatedForTheseClasses, testCount
-
Fields inherited from class org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl
DEFAULT_TEST_LISTENERS_SIZE, INTERNAL_INDEX_NOT_FOUND, NOT_INITIALIZED, testAtDelegateMapper, testClasses
-
-
Constructor Summary
Constructors Constructor Description JUnit4TestSuiteChunkerImpl(Class<?> testClass, Class<? extends PowerMockJUnitRunnerDelegate> runnerDelegateImplementationType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PowerMockJUnitRunnerDelegate
createDelegatorFromClassloader(ClassLoader classLoader, Class<?> testClass, List<Method> methodsToTest)
void
filter(org.junit.runner.manipulation.Filter filter)
org.junit.runner.Description
getDescription()
int
getTestCount()
Get the number of total tests defined in the suite (the sum of all tests defined in all chunks for this suite).void
run(org.junit.runner.notification.RunNotifier notifier)
boolean
shouldExecuteTestForMethod(Class<?> testClass, Method potentialTestMethod)
Should reflect whether or not this method is eligible for testing.void
sort(org.junit.runner.manipulation.Sorter sorter)
protected Class<? extends Annotation>
testMethodAnnotation()
-
Methods inherited from class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl
createTestDelegators, getDelegatorIndex, getFrameworkReporterFactory, getInternalTestIndex, getPowerMockTestListenersLoadedByASpecificClassLoader, getTestClasses
-
Methods inherited from class org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl
chunkClass, getChunkSize, getMockClassLoaderFactory, getTestChunk, getTestChunks, getTestChunksEntries, registerProxyframework
-
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.RunnerTestSuiteChunker
createTestDelegators
-
Methods inherited from interface org.powermock.tests.utils.TestSuiteChunker
getChunkSize, getTestChunk, getTestChunks, getTestChunksEntries
-
-
-
-
Constructor Detail
-
JUnit4TestSuiteChunkerImpl
public JUnit4TestSuiteChunkerImpl(Class<?> testClass, Class<? extends PowerMockJUnitRunnerDelegate> runnerDelegateImplementationType) throws Exception
- Throws:
Exception
-
-
Method Detail
-
run
public void run(org.junit.runner.notification.RunNotifier notifier)
- Specified by:
run
in interfaceJUnit4TestSuiteChunker
-
shouldExecuteTestForMethod
public boolean shouldExecuteTestForMethod(Class<?> testClass, Method potentialTestMethod)
Description copied from interface:TestSuiteChunker
Should reflect whether or not this method is eligible for testing.- Specified by:
shouldExecuteTestForMethod
in interfaceTestSuiteChunker
- Parameters:
testClass
- The class that defines the method.potentialTestMethod
- The method to inspect whether it should be executed in the test suite or not.- Returns:
true
if the method is a test method and should be executed,false
otherwise.
-
testMethodAnnotation
protected Class<? extends Annotation> testMethodAnnotation()
- Overrides:
testMethodAnnotation
in classAbstractCommonTestSuiteChunkerImpl
-
createDelegatorFromClassloader
protected PowerMockJUnitRunnerDelegate createDelegatorFromClassloader(ClassLoader classLoader, Class<?> testClass, List<Method> methodsToTest) throws Exception
- Specified by:
createDelegatorFromClassloader
in classAbstractTestSuiteChunkerImpl<PowerMockJUnitRunnerDelegate>
- Throws:
Exception
-
getTestCount
public int getTestCount()
Description copied from interface:RunnerTestSuiteChunker
Get the number of total tests defined in the suite (the sum of all tests defined in all chunks for this suite).- Specified by:
getTestCount
in interfaceRunnerTestSuiteChunker
- Returns:
- The number of tests in this suite.
-
getDescription
public org.junit.runner.Description getDescription()
- Specified by:
getDescription
in interfaceJUnit4TestSuiteChunker
-
filter
public void filter(org.junit.runner.manipulation.Filter filter) throws org.junit.runner.manipulation.NoTestsRemainException
- Specified by:
filter
in interfaceorg.junit.runner.manipulation.Filterable
- Throws:
org.junit.runner.manipulation.NoTestsRemainException
-
sort
public void sort(org.junit.runner.manipulation.Sorter sorter)
- Specified by:
sort
in interfaceorg.junit.runner.manipulation.Sortable
-
-