org.powermock.modules.junit3.internal.impl
Class JUnit3TestSuiteChunkerImpl

java.lang.Object
  extended by org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl<PowerMockJUnit3RunnerDelegate>
      extended by org.powermock.modules.junit3.internal.impl.JUnit3TestSuiteChunkerImpl
All Implemented Interfaces:
JUnit3TestSuiteChunker, org.powermock.tests.utils.TestSuiteChunker

public class JUnit3TestSuiteChunkerImpl
extends org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl<PowerMockJUnit3RunnerDelegate>
implements JUnit3TestSuiteChunker


Field Summary
 
Fields inherited from class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl
delegates, delegatesCreatedForTheseClasses, NOT_INITIALIZED, prepareForTestExtractor, suppressionExtractor, testAtDelegateMapper, testCount
 
Constructor Summary
JUnit3TestSuiteChunkerImpl(Class<? extends junit.framework.TestCase>... testClasses)
           
JUnit3TestSuiteChunkerImpl(String name, Class<? extends junit.framework.TestCase>... testClasses)
           
 
Method Summary
 void addTest(junit.framework.Test test)
          
 void addTestClassToSuite(Class<?> clazz)
          Add a class to the test suite.
 void addTestSuite(Class<? extends junit.framework.TestCase> testClass)
          
protected  void chunkClass(Class<?> testClass)
           
 int countTestCases()
          
protected  PowerMockJUnit3RunnerDelegate createDelegatorFromClassloader(ClassLoader classLoader, Class<?> testClass, List<Method> methodsToTest)
          
 int getTestCount()
          
 void run(junit.framework.TestResult result)
          
 void runTest(junit.framework.Test test, junit.framework.TestResult result)
          
 boolean shouldExecuteTestForMethod(Class<?> testClass, Method potentialTestMethod)
          
 junit.framework.Test testAt(int index)
          
 Enumeration<?> tests()
          
 
Methods inherited from class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl
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

JUnit3TestSuiteChunkerImpl

public JUnit3TestSuiteChunkerImpl(Class<? extends junit.framework.TestCase>... testClasses)
                           throws Exception
Throws:
Exception

JUnit3TestSuiteChunkerImpl

public JUnit3TestSuiteChunkerImpl(String name,
                                  Class<? extends junit.framework.TestCase>... testClasses)
                           throws Exception
Throws:
Exception
Method Detail

createDelegatorFromClassloader

protected PowerMockJUnit3RunnerDelegate createDelegatorFromClassloader(ClassLoader classLoader,
                                                                       Class<?> testClass,
                                                                       List<Method> methodsToTest)
                                                                throws Exception

Specified by:
createDelegatorFromClassloader in class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl<PowerMockJUnit3RunnerDelegate>
Throws:
Exception

chunkClass

protected void chunkClass(Class<?> testClass)
                   throws Exception
Overrides:
chunkClass in class org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl<PowerMockJUnit3RunnerDelegate>
Throws:
Exception

getTestCount

public int getTestCount()

Specified by:
getTestCount in interface org.powermock.tests.utils.TestSuiteChunker

shouldExecuteTestForMethod

public boolean shouldExecuteTestForMethod(Class<?> testClass,
                                          Method potentialTestMethod)

Specified by:
shouldExecuteTestForMethod in interface org.powermock.tests.utils.TestSuiteChunker

addTest

public void addTest(junit.framework.Test test)
             throws Exception

Specified by:
addTest in interface JUnit3TestSuiteChunker
Throws:
Exception

addTestSuite

public void addTestSuite(Class<? extends junit.framework.TestCase> testClass)
                  throws Exception

Specified by:
addTestSuite in interface JUnit3TestSuiteChunker
Throws:
Exception

countTestCases

public int countTestCases()

Specified by:
countTestCases in interface JUnit3TestSuiteChunker

run

public void run(junit.framework.TestResult result)

Specified by:
run in interface JUnit3TestSuiteChunker

runTest

public void runTest(junit.framework.Test test,
                    junit.framework.TestResult result)

Specified by:
runTest in interface JUnit3TestSuiteChunker

testAt

public junit.framework.Test testAt(int index)

Specified by:
testAt in interface JUnit3TestSuiteChunker

addTestClassToSuite

public void addTestClassToSuite(Class<?> clazz)
                         throws Exception
Add a class to the test suite. Methods in this class will be checked according to TestSuiteChunker.shouldExecuteTestForMethod(Class, Method) to see if it should be executed.

Specified by:
addTestClassToSuite in interface JUnit3TestSuiteChunker
Parameters:
clazz - The class that should contain test cases.
Throws:
Exception - If something unexpected goes wrong.

tests

public Enumeration<?> tests()

Specified by:
tests in interface JUnit3TestSuiteChunker


Copyright © 2007-2012. All Rights Reserved.