[ 
https://issues.apache.org/jira/browse/OOZIE-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472756#comment-13472756
 ] 

Virag Kothari commented on OOZIE-1016:
--------------------------------------

These tests are invalid now. Before oozie-637, these tests where checking a 
timing related issue when wf app name was being validated against  this pattern 
"([a-zA-Z_]([\-_a-zA-Z0-9])*){1,39})". But after 637, app name can be any 
String and no pattern matching was required. As you pointed out that the tests 
are always reporting success, they were not caught failing during oozie-637. 
Now, I think they can be removed.
Good find!
                
> 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 these tests are actually failing.
> 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 didn't encounter any   at 
> junit.framework.Assert.fail(Assert.java:50)
>       at 
> org.apache.oozie.workflow.lite.TestLiteWorkflowAppParser$1.run(TestLiteWorkflowAppParser.java:345)
> {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

Reply via email to