Package org.faktorips.runtime.test
Class AbstractIpsTestRunner
- java.lang.Object
-
- org.faktorips.runtime.test.AbstractIpsTestRunner
-
- All Implemented Interfaces:
IpsTestListener
- Direct Known Subclasses:
CmdLineIpsTestRunner,SocketIpsTestRunner
public abstract class AbstractIpsTestRunner extends java.lang.Object implements IpsTestListener
Abstract class for all ips test runner implementation.- Author:
- Joerg Ortmann
-
-
Constructor Summary
Constructors Constructor Description AbstractIpsTestRunner()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcountTests(java.lang.String names)Counts all ips test cases in the given packages.
The format of the input string is:protected abstract java.util.List<IRuntimeRepository>createRepositories()Creates the repositories.static java.util.List<java.lang.String>extractListFromString(java.lang.String input)protected java.lang.ClassLoadergetClassLoader()protected java.util.List<IRuntimeRepository>getRepositories()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()protected java.util.List<java.lang.String>getRepositoryListFromInputString(java.lang.String repositoryPackages)Returns a list of repository names from a given string of repositories.
The format of the input string is:java.lang.StringgetRepositoryPackages()Returns the repository packages namesjava.util.List<IpsTest2>getTests()Returns all tests.voidrun(java.lang.String names)Run the all ips test cases in the given packages.
The format of the input string is:protected voidsetAdditionalRepositoryPackages(java.lang.String additionalRepositoryPackages)Sets additional packages, will be used to create the ClassloaderRuntimeRepository which could be used in the runtime environment to obtain necessary objects.voidsetClassLoader(java.lang.ClassLoader classLoader)Sets the classloader to find the test and instantiate the corresponding classes.voidsetRepositoryPackages(java.lang.String repositoryPackages)Sets the repository packages namesstatic java.lang.StringtoStringFromList(java.util.List<java.lang.String> input)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.faktorips.runtime.test.IpsTestListener
testFailureOccured, testFinished, testStarted
-
-
-
-
Method Detail
-
countTests
public int countTests(java.lang.String names) throws java.lang.ExceptionCounts all ips test cases in the given packages.
The format of the input string is:
{packageName in repository1}{packageName in repository2}{...}- Throws:
java.lang.Exception- if an error occurs.
-
getTests
public java.util.List<IpsTest2> getTests()
Returns all tests.
-
getRepositories
protected java.util.List<IRuntimeRepository> getRepositories() throws java.lang.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:
java.lang.Exception- if an error occurs.
-
getClassLoader
protected java.lang.ClassLoader getClassLoader()
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
Sets the classloader to find the test and instantiate the corresponding classes.
-
setRepositoryPackages
public void setRepositoryPackages(java.lang.String repositoryPackages)
Sets the repository packages names
-
getRepositoryPackages
public java.lang.String getRepositoryPackages()
Returns the repository packages names
-
setAdditionalRepositoryPackages
protected void setAdditionalRepositoryPackages(java.lang.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(java.lang.String names) throws java.lang.ExceptionRun the all ips test cases in the given packages.
The format of the input string is:
{packageName in repository1}{packageName in repository2}{...}- Throws:
java.lang.Exception- if an error occurs.
-
getRepositoryListFromInputString
protected java.util.List<java.lang.String> getRepositoryListFromInputString(java.lang.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 java.util.List<java.lang.String> extractListFromString(java.lang.String input)
-
toStringFromList
public static java.lang.String toStringFromList(java.util.List<java.lang.String> input)
-
createRepositories
protected abstract java.util.List<IRuntimeRepository> createRepositories() throws java.lang.Exception
Creates the repositories. Where the test will be searched.- Throws:
java.lang.Exception
-
-