You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2009/08/20 15:38:36 UTC

[jira] Created: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

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.


[jira] Assigned: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-1924:
-----------------------------------

    Assignee: Willem Jiang

> 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
>            Assignee: Willem Jiang
>             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.


[jira] Closed: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schneider closed CAMEL-1924.
--------------------------------------


Camel-core now builds without failures or errors:
Tests	Errors 	Failures	Skipped	Success Rate	Time
1420	0	0	0	100%	1,286,584

Great work. Thanks


> 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
>            Assignee: Willem Jiang
>             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.


[jira] Commented: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53685#action_53685 ] 

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

I have found the problem in the first test that failed:
GenericFileDeleteProcessStrategyTest.testCannotDeleteFile

In the method exists file the test checks if the file name equals "target/foo/boom.txt" but on windows the file name is "target\foo\boom.txt". So the method says the file does not exist. The test then thinks it has successfully deleted the file and does not throw the expected exception. 

> 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.


[jira] Issue Comment Edited: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53685#action_53685 ] 

Christian Schneider edited comment on CAMEL-1924 at 8/20/09 6:38 AM:
---------------------------------------------------------------------

I have found the problem in the first test that failed:
GenericFileDeleteProcessStrategyTest.testCannotDeleteFile

In the method exists file the test checks if the file name equals "target/foo/boom.txt" but on windows the file name is "target\foo\boom.txt". So the method says the file does not exist. The test then thinks it has successfully deleted the file and does not throw the expected exception. 

Claus remarked:
Good use the FileUtil.normalizePath to ensure the path can be tested
using equals.
There are other unit tests that does this as well.

      was (Author: chris@die-schneider.net):
    I have found the problem in the first test that failed:
GenericFileDeleteProcessStrategyTest.testCannotDeleteFile

In the method exists file the test checks if the file name equals "target/foo/boom.txt" but on windows the file name is "target\foo\boom.txt". So the method says the file does not exist. The test then thinks it has successfully deleted the file and does not throw the expected exception. 
  
> 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.


[jira] Resolved: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-1924.
---------------------------------

    Resolution: Fixed

> 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
>            Assignee: Willem Jiang
>             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.


[jira] Commented: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53747#action_53747 ] 

Willem Jiang commented on CAMEL-1924:
-------------------------------------

@Christian
For the CachedOutputStreamTest.testCacheStreamToFileAndNotCloseStream, as you said, windows can't delete the file which is open, so I close the cached inputstream before calling the exchange  done method. 

I just tried run the org.apache.camel.processor.ChoiceWithEndTest.testRouteIsCorrectAtRuntime with JDK 1.5.0_13 on Windows Vista box, the test is OK.
So I added a method to search the route by looking up the endpoint's uri, please feel free to give it a try :)


> 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
>            Assignee: Willem Jiang
>             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.


[jira] Commented: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53748#action_53748 ] 

Willem Jiang commented on CAMEL-1924:
-------------------------------------

Committed revision :  807183

> 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
>            Assignee: Willem Jiang
>             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.


[jira] Commented: (CAMEL-1924) Unit test failures on Windows in 2.0.0 release

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53687#action_53687 ] 

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

I have just debugged the last failure:

org.apache.camel.processor.ChoiceWithEndTest.testRouteIsCorrectAtRuntime

It checks for 4 nodes but only gets one.

The reason is that it checks the wrong route. When I change the line
       Navigate<Processor> nav = context.getRoutes().get(0).navigate();
to
       Navigate<Processor> nav = context.getRoutes().get(1).navigate();
then it works. So it seems the sequence of the routes is not the same for all systems. Perhaps it would be better to use another way of getting the route from the camel context. 


> 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.