[ 
https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53686#action_53686
 ] 

Christian Schneider commented on CAMEL-1924:
--------------------------------------------

I have digged into the next failure.
CachedOutputStreamTest.testCacheStreamToFileAndNotCloseStream

At the end of the test the temporary file is expected to be deleted. But 
honestly I do not understand how this could work.

The test first calls exchange.getUnitOfWork().done(exchange);. This will try to 
delete the file but the delete will fail as the stream is still open.
Then it calls ((InputStream)cache).close(); which will close the stream. The 
problem is that now the file will not be deleted again.

I have swapped the two commands and the test works but I think this is wrong as 
the test seems to explicitly test the fact that close is not called before done.
Can anyone clarify what this test tries to do?
Btw. I think this test works on unix as the delete on the file will also work 
when the file is opened. On windows this does not work. 


> Unit test failures on Windows in 2.0.0 release
> ----------------------------------------------
>
>                 Key: CAMEL-1924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1924
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0.0
>         Environment: Windows Vista 32 Bit, JDK 1.6.0_14 and maven 2.2.0
>            Reporter: Christian Schneider
>             Fix For: 2.1.0
>
>
> 3 failures in camel-core that do not seem to occur on linux and mac.
> Failure Details
>       testCannotDeleteFile
>       junit.framework.AssertionFailedError: Should have thrown an exception
>       
> org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategyTest:125
>       testCacheStreamToFileAndNotCloseStream
>       junit.framework.AssertionFailedError: we should have no temp file 
> expected:<1> but was:<0>
>       
> org.apache.camel.converter.stream.CachedOutputStreamTest:117
>       testRouteIsCorrectAtRuntime
>       junit.framework.AssertionFailedError: expected:<4> but was:<1>
>       
> org.apache.camel.processor.ChoiceWithEndTest:39

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to