Robert Kanter created OOZIE-1016:
------------------------------------
Summary: Tests that use junit assert or fail in a new thread
report success when they are actually failing
Key: OOZIE-1016
URL: https://issues.apache.org/jira/browse/OOZIE-1016
Project: Oozie
Issue Type: Bug
Components: tests
Reporter: Robert Kanter
Priority: Minor
These three tests create a new thread and use junit methods (e.g. assertTrue(),
fail(), etc). These tests report success even when they should be failing,
which can be seen by looking in the log output.
They all have something like this:
{code}
Thread testThread = new Thread() {
public void run() {
try {
do some stuff
assertTrue(something);
...
{code}
These are the three tests that do this:
1) {{org.apache.oozie.cli.TestValidation.testTimeout}}
2) {{org.apache.oozie.service.TestSchemaService.testWfSchemaFailure}}
3)
{{org.apache.oozie.workflow.lite.TestLiteWorkflowAppParser.testWfValidationFailure}}
All three of these tests are actually failing and incidentally they all seem to
be about validating XML.
The output from the first one is this:
{code}
Exception in thread "Thread-1" junit.framework.AssertionFailedError:
expected:<-1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
at junit.framework.Assert.failNotEquals(Assert.java:287)
at junit.framework.Assert.assertEquals(Assert.java:67)
at junit.framework.Assert.assertEquals(Assert.java:199)
at junit.framework.Assert.assertEquals(Assert.java:205)
at org.apache.oozie.cli.TestValidation$1.run(TestValidation.java:51)
{code}
The second one has this:
{code}
Exception in thread "Thread-132" junit.framework.AssertionFailedError: Expected
to catch ParseException but didn't encounter any at
junit.framework.Assert.fail(Assert.java:50)
at
org.apache.oozie.service.TestSchemaService$1.run(TestSchemaService.java:148)
{code}
And the third one has this:
{code}
Exception in thread "Thread-132" junit.framework.AssertionFailedError: Expected
to catch WorkflowException but an unexpected error happened at
junit.framework.Assert.fail(Assert.java:50)
at
org.apache.oozie.workflow.lite.TestLiteWorkflowAppParser$1.run(TestLiteWorkflowAppParser.java:350)
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira