Class AbstractIpsTestRunner

java.lang.Object
org.faktorips.runtime.test.AbstractIpsTestRunner
All Implemented Interfaces:
IpsTestListener
Direct Known Subclasses:
CmdLineIpsTestRunner, SocketIpsTestRunner

public abstract class AbstractIpsTestRunner extends Object implements IpsTestListener
Abstract class for all ips test runner implementation.
Author:
Joerg Ortmann
  • Constructor Details

    • AbstractIpsTestRunner

      public AbstractIpsTestRunner()
  • Method Details

    • countTests

      public int countTests(String names) throws Exception
      Counts all ips test cases in the given packages.
      The format of the input string is:
       {packageName in repository1}{packageName in repository2}{...}
       
      Throws:
      Exception - if an error occurs.
    • getTests

      public List<IpsTest2> getTests()
      Returns all tests.
    • getRepositories

      protected List<IRuntimeRepository> getRepositories() throws Exception
      Returns all stored repositories.
      If the repositories currently not exists in memory create the repositories first.
      The repository will be created by the to be implemented method: createRepositories()
      Throws:
      Exception - if an error occurs.
    • getClassLoader

      protected ClassLoader getClassLoader()
    • setClassLoader

      public void setClassLoader(ClassLoader classLoader)
      Sets the classloader to find the test and instantiate the corresponding classes.
    • setRepositoryPackages

      public void setRepositoryPackages(String repositoryPackages)
      Sets the repository packages names
    • getRepositoryPackages

      public String getRepositoryPackages()
      Returns the repository packages names
    • setAdditionalRepositoryPackages

      protected void setAdditionalRepositoryPackages(String additionalRepositoryPackages)
      Sets additional packages, will be used to create the ClassloaderRuntimeRepository which could be used in the runtime environment to obtain necessary objects. Format: {package1}{package2}{...}{packageN}
    • run

      public void run(String names) throws Exception
      Run the all ips test cases in the given packages.
      The format of the input string is:
       {packageName in repository1}{packageName in repository2}{...}
       
      Throws:
      Exception - if an error occurs.
    • getRepositoryListFromInputString

      protected List<String> getRepositoryListFromInputString(String repositoryPackages)
      Returns a list of repository names from a given string of repositories.
      The format of the input string is:
       {repositoryName1}{repositoryName2}{...}
       
    • extractListFromString

      public static List<String> extractListFromString(String input)
    • toStringFromList

      public static String toStringFromList(List<String> input)
    • createRepositories

      protected abstract List<IRuntimeRepository> createRepositories() throws Exception
      Creates the repositories. Where the test will be searched.
      Throws:
      Exception