org.faktorips.runtime.test
Class AbstractIpsTestRunner

java.lang.Object
  extended by 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

Field Summary
protected  ClassLoader classLoader
           
 
Constructor Summary
AbstractIpsTestRunner()
           
 
Method Summary
 int countTests(String names)
          Counts all ips test cases in the given packages.
The format of the input string is:
protected abstract  List<IRuntimeRepository> createRepositories()
          Creates the repositories.
static List<String> extractListFromString(String input)
           
protected  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  List<String> getRepositoryListFromInputString(String repositoryPackages)
          Returns a list of repository names from a given string of repositories.
The format of the input string is:
 String getRepositoryPackages()
          Returns the repository packages names
 List<IpsTest2> getTests()
          Returns all tests.
 void run(String names)
          Run the all ips test cases in the given packages.
The format of the input string is:
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.
 void setClassLoader(ClassLoader classLoader)
          Sets the classloader to find the test and instantiate the corresponding classes.
 void setRepositoryPackages(String repositoryPackages)
          Sets the repository packages names
static String toStringFromList(List<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
 

Field Detail

classLoader

protected ClassLoader classLoader
Constructor Detail

AbstractIpsTestRunner

public AbstractIpsTestRunner()
Method Detail

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.

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


Copyright © 2015. All rights reserved.