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 Modifier and Type Field Description private org.junit.runner.Descriptiondescriptionprivate java.lang.Class<? extends PowerMockJUnitRunnerDelegate>runnerDelegateImplementationTypeprivate static java.lang.Class<? extends java.lang.annotation.Annotation>testMethodAnnotation-
Fields inherited from class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl
delegates, delegatesCreatedForTheseClasses, testCount
-
Fields inherited from class org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl
NOT_INITIALIZED
-
-
Constructor Summary
Constructors Constructor Description JUnit4TestSuiteChunkerImpl(java.lang.Class<?> testClass, java.lang.Class<? extends PowerMockJUnitRunnerDelegate> runnerDelegateImplementationType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PowerMockJUnitRunnerDelegatecreateDelegatorFromClassloader(java.lang.ClassLoader classLoader, java.lang.Class<?> testClass, java.util.List<java.lang.reflect.Method> methodsToTest)voidfilter(org.junit.runner.manipulation.Filter filter)org.junit.runner.DescriptiongetDescription()intgetTestCount()Get the number of total tests defined in the suite (the sum of all tests defined in all chunks for this suite).voidrun(org.junit.runner.notification.RunNotifier notifier)booleanshouldExecuteTestForMethod(java.lang.Class<?> testClass, java.lang.reflect.Method potentialTestMethod)Should reflect whether or not this method is eligible for testing.voidsort(org.junit.runner.manipulation.Sorter sorter)protected java.lang.Class<? extends java.lang.annotation.Annotation>testMethodAnnotation()-
Methods inherited from class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl
createTestDelegators, getDelegatorIndex, getInternalTestIndex, getPowerMockTestListenersLoadedByASpecificClassLoader, getTestClasses
-
Methods inherited from class org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl
getChunkSize, getTestChunk, getTestChunks, getTestChunksEntries
-
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
-
-
-
-
Field Detail
-
testMethodAnnotation
private static final java.lang.Class<? extends java.lang.annotation.Annotation> testMethodAnnotation
-
description
private org.junit.runner.Description description
-
runnerDelegateImplementationType
private final java.lang.Class<? extends PowerMockJUnitRunnerDelegate> runnerDelegateImplementationType
-
-
Constructor Detail
-
JUnit4TestSuiteChunkerImpl
JUnit4TestSuiteChunkerImpl(java.lang.Class<?> testClass, java.lang.Class<? extends PowerMockJUnitRunnerDelegate> runnerDelegateImplementationType) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
Method Detail
-
run
public void run(org.junit.runner.notification.RunNotifier notifier)
- Specified by:
runin interfaceJUnit4TestSuiteChunker
-
shouldExecuteTestForMethod
public boolean shouldExecuteTestForMethod(java.lang.Class<?> testClass, java.lang.reflect.Method potentialTestMethod)Description copied from interface:TestSuiteChunkerShould reflect whether or not this method is eligible for testing.- Specified by:
shouldExecuteTestForMethodin 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:
trueif the method is a test method and should be executed,falseotherwise.
-
testMethodAnnotation
protected java.lang.Class<? extends java.lang.annotation.Annotation> testMethodAnnotation()
- Overrides:
testMethodAnnotationin classAbstractCommonTestSuiteChunkerImpl
-
createDelegatorFromClassloader
protected PowerMockJUnitRunnerDelegate createDelegatorFromClassloader(java.lang.ClassLoader classLoader, java.lang.Class<?> testClass, java.util.List<java.lang.reflect.Method> methodsToTest) throws java.lang.Exception
- Specified by:
createDelegatorFromClassloaderin classAbstractTestSuiteChunkerImpl<PowerMockJUnitRunnerDelegate>- Throws:
java.lang.Exception
-
getTestCount
public int getTestCount()
Description copied from interface:RunnerTestSuiteChunkerGet the number of total tests defined in the suite (the sum of all tests defined in all chunks for this suite).- Specified by:
getTestCountin interfaceRunnerTestSuiteChunker- Returns:
- The number of tests in this suite.
-
getDescription
public org.junit.runner.Description getDescription()
- Specified by:
getDescriptionin interfaceJUnit4TestSuiteChunker
-
filter
public void filter(org.junit.runner.manipulation.Filter filter) throws org.junit.runner.manipulation.NoTestsRemainException- Specified by:
filterin interfaceorg.junit.runner.manipulation.Filterable- Throws:
org.junit.runner.manipulation.NoTestsRemainException
-
sort
public void sort(org.junit.runner.manipulation.Sorter sorter)
- Specified by:
sortin interfaceorg.junit.runner.manipulation.Sortable
-
-