Commit f3fabf3b authored by Kisslinger's avatar Kisslinger
Browse files

adding statistic for state and transition coverage tests

parent 5ec3269d
......@@ -44,16 +44,18 @@ import org.fortiss.af3.testing.model.TestSuite;
import org.fortiss.af3.testing.model.TestSuiteSpecification;
import org.fortiss.af3.testing.simulator.TestCaseSimulator;
import org.fortiss.af3.testing.simulator.TestCaseSimulatorException;
import org.fortiss.af3.testing.statistic.StatisticListener;
import org.fortiss.af3.testing.statistic.StatisticListenerManager;
import org.fortiss.af3.tools.base.UnknownLanguageFragmentException;
/**
* A {@link ITestSuiteGenerator} using {@link StatesCoverageAnalyzer} to generate a
* A {@link ITestSuiteGenerator} using {@link ComponentsAnalyzerBase} to generate a
* {@link TestSuite}
*
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 807E6247E725D68E7F45B1A107B4F70A
* @ConQAT.Rating YELLOW Hash: 7B29F187568E248FB41CB1E2BB52D448
*/
public class ModelCheckingTestSuiteGenerator implements ITestSuiteGenerator {
......@@ -79,6 +81,8 @@ public class ModelCheckingTestSuiteGenerator implements ITestSuiteGenerator {
Component component = (Component)specification.getSpecificationOf();
StatisticListenerManager statisticListenerManager = new StatisticListenerManager();
monitor.beginTask("Generating test cases ...", 1);
try {
LinkedHashMap<State, ModelCheckingAnalysisResult> results;
......@@ -111,6 +115,7 @@ public class ModelCheckingTestSuiteGenerator implements ITestSuiteGenerator {
}
TestCaseSimulator simulator = new TestCaseSimulator(testcase, component);
simulator.setStatisticListenerManager(statisticListenerManager);
try {
simulator.simulate(true);
} catch(TestCaseSimulatorException e) {
......@@ -121,6 +126,11 @@ public class ModelCheckingTestSuiteGenerator implements ITestSuiteGenerator {
monitor.done();
}
// get the results of the StatisticListeners created by the statisticListenerManager and
// attach them to the generated test suite
for(StatisticListener listener : statisticListenerManager.getAllListeners())
testsuite.getSpecificationsList().add(listener.getStatistic());
return testsuite;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment