org.powermock.modules.junit4.common.internal.impl
Class JUnit4TestSuiteChunkerImpl

java.lang.Object
  extended by org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl<PowerMockJUnitRunnerDelegate>
      extended by org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl
All Implemented Interfaces:
org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable, JUnit4TestSuiteChunker, 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, NOT_INITIALIZED, prepareForTestExtractor, suppressionExtractor, testAtDelegateMapper, testCount
 
Constructor Summary
JUnit4TestSuiteChunkerImpl(java.lang.Class<?> testClass, java.lang.Class<? extends PowerMockJUnitRunnerDelegate> runnerDelegateImplementationType)
           
 
Method Summary
protected  PowerMockJUnitRunnerDelegate createDelegatorFromClassloader(java.lang.ClassLoader classLoader, java.lang.Class<?> testClass, java.util.List<java.lang.reflect.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(java.lang.Class<?> testClass, java.lang.reflect.Method potentialTestMethod)
          Should reflect whether or not this method is eligible for testing.
 void sort(org.junit.runner.manipulation.Sorter sorter)
           
 
Methods inherited from class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl
chunkClass, createNewClassloader, createTestDelegators, getChunkSize, getDelegatorIndex, getInternalTestIndex, getPowerMockTestListenersLoadedByASpecificClassLoader, getTestChunks, getTestChunksEntries, getTestClasses, hasMockPolicyProvidedClasses
 
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
createNewClassloader, createTestDelegators, getChunkSize, getTestChunks, getTestChunksEntries
 

Constructor Detail

JUnit4TestSuiteChunkerImpl

public 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:
run in interface JUnit4TestSuiteChunker

shouldExecuteTestForMethod

public boolean shouldExecuteTestForMethod(java.lang.Class<?> testClass,
                                          java.lang.reflect.Method potentialTestMethod)
Description copied from interface: TestSuiteChunker
Should reflect whether or not this method is eligible for testing.

Specified by:
shouldExecuteTestForMethod in interface TestSuiteChunker
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.

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:
createDelegatorFromClassloader in class AbstractTestSuiteChunkerImpl<PowerMockJUnitRunnerDelegate>
Throws:
java.lang.Exception

getTestCount

public int getTestCount()
Description copied from interface: TestSuiteChunker
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 interface TestSuiteChunker
Returns:
The number of tests in this suite.

getDescription

public org.junit.runner.Description getDescription()
Specified by:
getDescription in interface JUnit4TestSuiteChunker

filter

public void filter(org.junit.runner.manipulation.Filter filter)
            throws org.junit.runner.manipulation.NoTestsRemainException
Specified by:
filter in interface org.junit.runner.manipulation.Filterable
Throws:
org.junit.runner.manipulation.NoTestsRemainException

sort

public void sort(org.junit.runner.manipulation.Sorter sorter)
Specified by:
sort in interface org.junit.runner.manipulation.Sortable