Class TestClassesUtil

java.lang.Object
de.hybris.bootstrap.testclasses.TestClassesUtil

public class TestClassesUtil extends Object
Gets all test classes that have hybris testing annotations

All test classes that have the standard junit @Test annotation will be treated like a IntegrationTest.

see IntegrationTest, DemoTest and UnitTest

  • Method Details

    • createBootstrapInstance

      public static TestClassesUtil createBootstrapInstance(PlatformConfig platformConfig)
      Constructs an instance in the bootstrap environment. Where we have to emulate a PlatformInPlaceClassLoader for give platformConfig.
    • setWebRelated

      public void setWebRelated(boolean webRelated)
    • createIntegrationInstance

      public static TestClassesUtil createIntegrationInstance(PlatformConfig platformConfig)
      Constructs an instance in the integrated environment. Where the full blown class loader is current for thread. Which is TestServlet in the hybrisServer or any other app server. We use original passed class loader.
    • createInstance

      public static TestClassesUtil createInstance(PlatformConfig platformConfig, PlatformInPlaceClassLoader inPlaceClassLoader)
    • createTestClassLoader

      public static ClassLoader createTestClassLoader(PlatformConfig platformConfig, ClassLoader parent)
    • addTestSrcFoldersToClassPath

      public static void addTestSrcFoldersToClassPath(PlatformConfig platformConfig, groovy.lang.GroovyClassLoader ret)
    • getClassLoaderForTests

      public ClassLoader getClassLoaderForTests()
    • getAllTestClasses

      public Collection<Class> getAllTestClasses()
      This method resets all filters and scans for UnitTest, IntegrationTest, DemoTest, ManualTest and PerformanceTest annotated classes.
      Classes that only have @Test annotations before methods are treated as IntegrationTests.
      Returns:
      returns all test classes
    • getAllWebTestClasses

      public Collection<Class> getAllWebTestClasses()
    • getAllUnitTestClasses

      public Collection<Class> getAllUnitTestClasses()
      This method resets all filters and scans for UnitTest annotated classes.
      Returns:
      returns all test classes that are annotated with UnitTest
    • getAllIntegrationTestClasses

      public Collection<Class> getAllIntegrationTestClasses()
      This method resets all filters and scans for IntegrationTest annotated classes.
      This method also returns classes that only have Test annotations before test methods!
      Returns:
      returns all test classes that are annotated with IntegrationTest or have at least one @Test annotation
    • getAllDemoTestClasses

      public Collection<Class> getAllDemoTestClasses()
      This method resets all filters and scans for DemoTest annotated classes.
      Returns:
      returns all test classes that are annotated with DemoTest
    • getAllPerformanceTestClasses

      public Collection<Class> getAllPerformanceTestClasses()
      This method resets all filters and scans for PerformanceTest annotated classes.
      Returns:
      returns all test classes that are annotated with PerformanceTest
    • getAllManualTestClasses

      public Collection<Class> getAllManualTestClasses()
      This method resets all filters and scans for ManualTest annotated classes.
      Returns:
      returns all test classes that are annotated with ManualTest
    • getAllBugProofTestClasses

      public Collection<Class> getAllBugProofTestClasses()
      This method resets all filters and scans for BugProofTest annotated classes.
      Returns:
      returns all test classes that are annotated with BugProofTest
    • addFilter

      public void addFilter(TestClassesUtil.FILTER filter, Object filterValue)
      This method adds a filter to the scanning process. All filters can be deleted with the resetFilter method.
      Please add all filters before you finally invoke a getAllClasses() method!
      Parameters:
      filter - see TestClassesUtil.FILTER
      filterValue - The filterValue can either be an Object or a Collection of Objects. See description of TestClassesUtil.FILTER
    • resetFilter

      public void resetFilter()
      Clears all filters!
    • getFilteredTestClasses

      public Collection<Class> getFilteredTestClasses()
      Returns all test classes according to the filters that are set. If no filters are set, the result equals to the getAllTestClasses() method!
      Returns:
      the filtered test classes
    • getWebModuleClasspaths

      public String getWebModuleClasspaths()
    • getModuleClasspaths

      public String getModuleClasspaths(ExtensionModule... modules)
      Get classpaths for selected modules.
      Parameters:
      modules - List of modules to retrieve classpaths for.
      Returns:
      Comma-separated list of classpaths for the selected modules. If no classpaths exist for the given modules or if no modules were selected, null is returned.
    • matchesPackageFilters

      public boolean matchesPackageFilters(Class clazz)
    • setLogging

      public void setLogging(boolean logging)
    • matchesPackageFilters

      public boolean matchesPackageFilters(String string)