[
https://issues.apache.org/jira/browse/SCXML-91?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654658#action_12654658
]
Sebb commented on SCXML-91:
---------------------------
As to 1), what I had in mind was to change code of the form:
{code}
public void testInvoke01Sample() {
try {
SCXML scxml = SCXMLParser.parse(invoke01,
new SimpleErrorHandler());
exec = new SCXMLExecutor(new JexlEvaluator(), new
SimpleDispatcher(),
new SimpleErrorReporter());
assertNotNull(exec);
exec.setRootContext(new JexlContext());
exec.setStateMachine(scxml);
exec.registerInvokerClass("scxml", SimpleSCXMLInvoker.class);
exec.go();
Set<TransitionTarget> currentStates =
exec.getCurrentStatus().getStates();
assertEquals(1, currentStates.size());
assertEquals("invoker", currentStates.iterator().next().getId());
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
{code}
to
{code}
public void testInvoke01Sample() throws Exception {
SCXML scxml = SCXMLParser.parse(invoke01,
new SimpleErrorHandler());
exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
new SimpleErrorReporter());
assertNotNull(exec);
exec.setRootContext(new JexlContext());
exec.setStateMachine(scxml);
exec.registerInvokerClass("scxml", SimpleSCXMLInvoker.class);
exec.go();
Set<TransitionTarget> currentStates =
exec.getCurrentStatus().getStates();
assertEquals(1, currentStates.size());
assertEquals("invoker", currentStates.iterator().next().getId());
}
{code}
As to 2), I still think it would be sensible to report at least one test
failure if the test environment does not allow all the tests to be completed
successfully.
> Test case bugs
> --------------
>
> Key: SCXML-91
> URL: https://issues.apache.org/jira/browse/SCXML-91
> Project: Commons SCXML
> Issue Type: Bug
> Affects Versions: 0.9
> Reporter: Sebb
> Fix For: 0.10
>
>
> Test cases are difficult to debug if they fail.
> This is because many test cases catch Exception, and don't report it fully.
> Test cases should only catch a (specific) Exception if the test is expected
> to generate one, and should otherwise throw the Exception.
> Several test cases report problems to System.out or System.err and carry on
> processing.
> For example, serialisation errors are largely ignored, and
> SCXMLTestHelper#testExecutorSerializability() ignores IO errors.
> Testing generates a lot of output, some of which appears to be errors (e.g.
> stack traces) yet the test passes.
> Ideally tests should suppress output stack traces which are expected during
> testing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.