Class AbstractCommonTestSuiteChunkerImpl

java.lang.Object
org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl
All Implemented Interfaces:
TestSuiteChunker
Direct Known Subclasses:
AbstractTestSuiteChunkerImpl, PowerMockRuleTestSuiteChunker

public abstract class AbstractCommonTestSuiteChunkerImpl extends Object implements TestSuiteChunker
  • Field Details

  • Constructor Details

    • AbstractCommonTestSuiteChunkerImpl

      protected AbstractCommonTestSuiteChunkerImpl(Class<?> testClass) throws Exception
      Throws:
      Exception
    • AbstractCommonTestSuiteChunkerImpl

      AbstractCommonTestSuiteChunkerImpl(Class<?>... testClasses) throws Exception
      Throws:
      Exception
  • Method Details

    • getChunkSize

      public int getChunkSize()
      Description copied from interface: TestSuiteChunker
      Get the number of chunks defined in this suite.
      Specified by:
      getChunkSize in interface TestSuiteChunker
      Returns:
      The number of chunks defined in the correct suite.
    • getTestChunks

      public List<TestChunk> getTestChunks()
      Description copied from interface: TestSuiteChunker
      Get all chunk entries.
      Specified by:
      getTestChunks in interface TestSuiteChunker
      Returns:
      An set of entries that contains a list of methods contained in the chunk and the class loader that loaded these methods.
    • getTestChunksEntries

      public List<TestChunk> getTestChunksEntries(Class<?> testClass)
      Description copied from interface: TestSuiteChunker
      Get all chunk entries for a specific class.
      Specified by:
      getTestChunksEntries in interface TestSuiteChunker
      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

      public TestChunk getTestChunk(Method method)
      Description copied from interface: TestSuiteChunker
      Get TestChunk for the given method.
      Specified by:
      getTestChunk in interface TestSuiteChunker
      Parameters:
      method - - method for which test chunk should be found.
      Returns:
      TestChunk for this method.
    • chunkClass

      private void chunkClass(Class<?> testClass) throws Exception
      Throws:
      Exception
    • createDefaultMockLoader

      private ClassLoader createDefaultMockLoader(Class<?> testClass, Collection<Method> testMethodsForOtherClassLoaders)
    • putMethodToChunk

      private void putMethodToChunk(TestCaseEntry testCaseEntry, Class<?> testClass, Method method)
    • createClassLoaderForMethod

      private ClassLoader createClassLoaderForMethod(Class<?> testClass, Method method)
    • testMethodAnnotation

      protected Class<? extends Annotation> testMethodAnnotation()
    • initEntries

      private void initEntries(List<TestCaseEntry> entries)
    • findMethods

      private void findMethods(TestCaseEntry testCaseEntry, Class<?> testClass)
    • hasChunkAnnotation

      private boolean hasChunkAnnotation(Method method)
    • updatedIndexes

      private void updatedIndexes()