Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
f3fabf3b
Commit
f3fabf3b
authored
May 24, 2012
by
Kisslinger
Browse files
adding statistic for state and transition coverage tests
parent
5ec3269d
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.testing/trunk/src/org/fortiss/af3/testing/generator/modelchecking/ModelCheckingTestSuiteGenerator.java
View file @
f3fabf3b
...
...
@@ -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
StatesCoverage
Analyzer} to generate a
* A {@link ITestSuiteGenerator} using {@link
Components
Analyzer
Base
} 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
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment