sota
Class SotaATM

java.lang.Object
  extended by sota.SotaATM

public class SotaATM
extends java.lang.Object

Provides a test instance for coverage tests. Includes the non-GUI-functionality of SOTA:


Constructor Summary
SotaATM(ProjectConfiguration sotaConfiguration)
          Instantiates a test instance from a project configuration.
SotaATM(java.lang.String file)
          Instantiates a test instance from a project file.
 
Method Summary
 boolean compile()
          Compiles the project if an ant buildscript and a path to Apache Ant are available.
 boolean createReport(java.util.Set<java.lang.String> testSet, java.lang.String fileName)
          Creates a report for a specific set of test logs.
 boolean createReport(java.util.Set<java.lang.String> testSet, java.lang.String fileName, int fontSize, boolean overwriteReport, boolean useColors, boolean showTests, boolean showFunctions, boolean showClasses, boolean showInnerClasses)
          Creates a report for a specific set of test logs and allows various configuration of the test format.
 boolean createReport(java.lang.String fileName)
          Creates a report from all imported testfiles.
 boolean createReport(java.lang.String fileName, int fontSize, boolean overwriteReport, boolean useColors, boolean showTests, boolean showFunctions, boolean showClasses, boolean showInnerClasses)
          Creates a report from all imported testfiles. and allows various configuration of the test format.
 ProjectConfiguration getConfiguration()
          Returns the current project configuration.
 Metrics getMetrics()
          Returns the a container with the computed metrics.
 boolean instrument(int level)
          Instruments the project according to the provided instrumentation level after backing up the original source files.
 boolean instrument(IScheme ischeme)
          Instruments the project according to the provided IScheme after backing up the original source files.
 boolean instrument(java.lang.String ischemeName)
          Instruments the project according to an IScheme after backing up the original source files.
 boolean openProject(java.lang.String file)
          Opens a project file and reinitialises the test instance.
 boolean readLogs(java.util.TreeSet<java.lang.String> testSet)
          Imports and processes a set of test log files.
 boolean reinit(ProjectConfiguration sotaConfiguration)
          Reinitialises the test instances with a project configuration.
 void restore()
          Restores the original source files.
 boolean run()
          Executes the run script, if in project configuration.
 boolean run(java.lang.String scriptName)
          Executes the provides run script.
 boolean saveProject()
          Saves the project configuration in <name>.project ab.
 boolean startTest(java.lang.String testName, java.lang.String testDesc, IScheme ischeme, boolean compileAndRun)
          Starts a program test: backup of original source code instrumentation of the source code creation of test information compilation of test project via ant buildfile (optional) start of test project via run script(optional
 boolean startTest(java.lang.String testName, java.lang.String testDesc, java.lang.String ischemeName, boolean compileAndRun)
          Starts a program test: backup of original source code instrumentation of the source code creation of test information compilation of test project via ant buildfile (optional) start of test project via run script(optional
 boolean stopTest(java.util.TreeSet<java.lang.String> testSet, boolean compile)
          Stops a program test: restoration of source files import and processing of a set of test logs recompilation of the project (optional)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SotaATM

public SotaATM(ProjectConfiguration sotaConfiguration)
Instantiates a test instance from a project configuration.

Parameters:
sotaConfiguration - the project configuration

SotaATM

public SotaATM(java.lang.String file)
Instantiates a test instance from a project file.

Parameters:
file - the project file
Method Detail

compile

public boolean compile()
Compiles the project if an ant buildscript and a path to Apache Ant are available.

Returns:
true, if compilation was successful, otherwise false.

createReport

public boolean createReport(java.util.Set<java.lang.String> testSet,
                            java.lang.String fileName)
Creates a report for a specific set of test logs.

Parameters:
testSet - the set of test logs to use for the report
fileName - the name of the report file
Returns:
true, if report creation was successful, otherwise false.

createReport

public boolean createReport(java.util.Set<java.lang.String> testSet,
                            java.lang.String fileName,
                            int fontSize,
                            boolean overwriteReport,
                            boolean useColors,
                            boolean showTests,
                            boolean showFunctions,
                            boolean showClasses,
                            boolean showInnerClasses)
Creates a report for a specific set of test logs and allows various configuration of the test format.

Parameters:
testSet - the set of test logs to use for the report
fileName - the name of the report file
fontSize - the font size
overwriteReport - whether existing report files should be overwritten
useColors - whether to use colors
showTests - whether to list tests
showFunctions - whether to list functions
showClasses - whether to list classes
showInnerClasses - whether to list inner classes
Returns:
true, if report creation was successful, otherwise false.

createReport

public boolean createReport(java.lang.String fileName)
Creates a report from all imported testfiles.

Parameters:
fileName - the name of the report file
Returns:
true, if report creation was successful, otherwise false.

createReport

public boolean createReport(java.lang.String fileName,
                            int fontSize,
                            boolean overwriteReport,
                            boolean useColors,
                            boolean showTests,
                            boolean showFunctions,
                            boolean showClasses,
                            boolean showInnerClasses)
Creates a report from all imported testfiles. and allows various configuration of the test format.

Parameters:
fileName - the name of the report file
fontSize - the font size
overwriteReport - whether existing report files should be overwritten
useColors - whether to use colors
showTests - whether to list tests
showFunctions - whether to list functions
showClasses - whether to list classes
showInnerClasses - whether to list inner classes
Returns:
true, if report creation was successful, otherwise false.

getConfiguration

public ProjectConfiguration getConfiguration()
Returns the current project configuration.

Returns:
the current project configuration

getMetrics

public Metrics getMetrics()
Returns the a container with the computed metrics.

Returns:
the computed metrics

instrument

public boolean instrument(int level)
Instruments the project according to the provided instrumentation level after backing up the original source files.

Parameters:
level - the instrumentation level (1-3)
Returns:
true, if instrumentation was successful, otherwise false.

instrument

public boolean instrument(IScheme ischeme)
Instruments the project according to the provided IScheme after backing up the original source files.

Parameters:
ischeme - the IScheme
Returns:
true, if instrumentation was successful, otherwise false.

instrument

public boolean instrument(java.lang.String ischemeName)
Instruments the project according to an IScheme after backing up the original source files.

Parameters:
ischemeName - the name of the IScheme
Returns:
true, if instrumentation was successful, otherwise false.

openProject

public boolean openProject(java.lang.String file)
Opens a project file and reinitialises the test instance. A previously opend project is closed.

Parameters:
file - the project file
Returns:
true, if opening of project was successful, otherwise false.

readLogs

public boolean readLogs(java.util.TreeSet<java.lang.String> testSet)
Imports and processes a set of test log files.

Parameters:
testSet - the set of test logs
Returns:
true, if importing of test logs was successful, otherwise false.

reinit

public boolean reinit(ProjectConfiguration sotaConfiguration)
Reinitialises the test instances with a project configuration.

Parameters:
sotaConfiguration - the project configuration
Returns:
true, if reinitialisation was successful, otherwise false.

restore

public void restore()
Restores the original source files.


run

public boolean run()
Executes the run script, if in project configuration.

Returns:
true, if execution of the run script was successful, otherwise false.

run

public boolean run(java.lang.String scriptName)
Executes the provides run script.

Parameters:
scriptName - the run script
Returns:
true, if execution of the run script was successful, otherwise false.

saveProject

public boolean saveProject()
Saves the project configuration in <name>.project ab.

Returns:
true, if saving was successful, otherwise false.

startTest

public boolean startTest(java.lang.String testName,
                         java.lang.String testDesc,
                         IScheme ischeme,
                         boolean compileAndRun)
Starts a program test:

Parameters:
testName - the name of the test
testDesc - the description of the test
ischeme - the IScheme
compileAndRun - whether the project should be compiled and started
Returns:
true, if test start was successful, otherwise false.

startTest

public boolean startTest(java.lang.String testName,
                         java.lang.String testDesc,
                         java.lang.String ischemeName,
                         boolean compileAndRun)
Starts a program test:

Parameters:
testName - the name of the test
testDesc - the description of the test
ischemeName - the name of an IScheme
compileAndRun - whether the project should be compiled and started
Returns:
true, if test start was successful, otherwise false.

stopTest

public boolean stopTest(java.util.TreeSet<java.lang.String> testSet,
                        boolean compile)
Stops a program test:

Parameters:
testSet - the set of test names
compile - whether the source code should be compiled
Returns:
true, if test stop was successful, otherwise false.