You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "edge wang (JIRA)" <ji...@apache.org> on 2011/08/14 17:45:28 UTC

[jira] [Created] (CAMEL-4334) ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.

ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.
------------------------------------------------------------------------

                 Key: CAMEL-4334
                 URL: https://issues.apache.org/jira/browse/CAMEL-4334
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.8.0
         Environment: Windows 7, Chinese edition
            Reporter: edge wang
            Priority: Minor
             Fix For: 2.8.1, 2.9.0


the hard coded assertion:

assertEquals("src/test/resources/notfound.txt (No such file or directory)", e.getMessage());

fails in Windows OS (since the seperator is "\") as well as in Non-english language OS (since the OS message does not match).

Solution:

1.Simply comment out the assertion since the correctness is assured by catching the FileNotFoundException.
2.Polish the assertion by use OS file seperator to make the string and use pos() the test whether the string is in the message.

Either way you like, I can make the patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4334) ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.

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

Claus Ibsen updated CAMEL-4334:
-------------------------------

              Patch Info: [Patch Available]
    Estimated Complexity: Novice  (was: Unknown)
           Fix Version/s:     (was: 2.8.1)

> ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-4334
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4334
>             Project: Camel
>          Issue Type: Test
>          Components: camel-core
>    Affects Versions: 2.9.0
>         Environment: Windows 7, Chinese edition
>            Reporter: edge wang
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.9.0
>
>         Attachments: ResourceHelperTest.java.patch
>
>
> the hard coded assertion:
> assertEquals("src/test/resources/notfound.txt (No such file or directory)", e.getMessage());
> fails in Windows OS (since the seperator is "\") as well as in Non-english language OS (since the OS message does not match).
> Solution:
> 1.Simply comment out the assertion since the correctness is assured by catching the FileNotFoundException.
> 2.Polish the assertion by use OS file seperator to make the string and use pos() the test whether the string is in the message.
> Either way you like, I can make the patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4334) ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.

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

Claus Ibsen updated CAMEL-4334:
-------------------------------

    Regression: [Unit Test Broken]
    Issue Type: Test  (was: Bug)

> ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-4334
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4334
>             Project: Camel
>          Issue Type: Test
>          Components: camel-core
>    Affects Versions: 2.8.0
>         Environment: Windows 7, Chinese edition
>            Reporter: edge wang
>            Priority: Minor
>             Fix For: 2.8.1, 2.9.0
>
>
> the hard coded assertion:
> assertEquals("src/test/resources/notfound.txt (No such file or directory)", e.getMessage());
> fails in Windows OS (since the seperator is "\") as well as in Non-english language OS (since the OS message does not match).
> Solution:
> 1.Simply comment out the assertion since the correctness is assured by catching the FileNotFoundException.
> 2.Polish the assertion by use OS file seperator to make the string and use pos() the test whether the string is in the message.
> Either way you like, I can make the patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4334) ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.

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

Claus Ibsen updated CAMEL-4334:
-------------------------------

    Affects Version/s:     (was: 2.8.0)
                       2.9.0

> ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-4334
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4334
>             Project: Camel
>          Issue Type: Test
>          Components: camel-core
>    Affects Versions: 2.9.0
>         Environment: Windows 7, Chinese edition
>            Reporter: edge wang
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.9.0
>
>         Attachments: ResourceHelperTest.java.patch
>
>
> the hard coded assertion:
> assertEquals("src/test/resources/notfound.txt (No such file or directory)", e.getMessage());
> fails in Windows OS (since the seperator is "\") as well as in Non-english language OS (since the OS message does not match).
> Solution:
> 1.Simply comment out the assertion since the correctness is assured by catching the FileNotFoundException.
> 2.Polish the assertion by use OS file seperator to make the string and use pos() the test whether the string is in the message.
> Either way you like, I can make the patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CAMEL-4334) ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.

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

Claus Ibsen resolved CAMEL-4334.
--------------------------------

    Resolution: Fixed
      Assignee: Claus Ibsen

Thanks for the patch

> ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-4334
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4334
>             Project: Camel
>          Issue Type: Test
>          Components: camel-core
>    Affects Versions: 2.8.0
>         Environment: Windows 7, Chinese edition
>            Reporter: edge wang
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.1, 2.9.0
>
>         Attachments: ResourceHelperTest.java.patch
>
>
> the hard coded assertion:
> assertEquals("src/test/resources/notfound.txt (No such file or directory)", e.getMessage());
> fails in Windows OS (since the seperator is "\") as well as in Non-english language OS (since the OS message does not match).
> Solution:
> 1.Simply comment out the assertion since the correctness is assured by catching the FileNotFoundException.
> 2.Polish the assertion by use OS file seperator to make the string and use pos() the test whether the string is in the message.
> Either way you like, I can make the patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4334) ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.

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

edge wang updated CAMEL-4334:
-----------------------------

    Attachment: ResourceHelperTest.java.patch

Ok, I made the modification by changing the assertion to:

assertTrue(e.getMessage().contains("notfound.txt"));

This should work in any OS environments, with more strict checking than simply comment out the assertEquals one.

> ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-4334
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4334
>             Project: Camel
>          Issue Type: Test
>          Components: camel-core
>    Affects Versions: 2.8.0
>         Environment: Windows 7, Chinese edition
>            Reporter: edge wang
>            Priority: Minor
>             Fix For: 2.8.1, 2.9.0
>
>         Attachments: ResourceHelperTest.java.patch
>
>
> the hard coded assertion:
> assertEquals("src/test/resources/notfound.txt (No such file or directory)", e.getMessage());
> fails in Windows OS (since the seperator is "\") as well as in Non-english language OS (since the OS message does not match).
> Solution:
> 1.Simply comment out the assertion since the correctness is assured by catching the FileNotFoundException.
> 2.Polish the assertion by use OS file seperator to make the string and use pos() the test whether the string is in the message.
> Either way you like, I can make the patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4334) ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084969#comment-13084969 ] 

Claus Ibsen commented on CAMEL-4334:
------------------------------------

Thanks for reporting.

A patch without the assertEquals would be good, as testing the exception is of instance FileNotFoundException should be okay.

> ResourceHelperTest.testLoadFileNotFound fails in Windows/non english OS.
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-4334
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4334
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.8.0
>         Environment: Windows 7, Chinese edition
>            Reporter: edge wang
>            Priority: Minor
>             Fix For: 2.8.1, 2.9.0
>
>
> the hard coded assertion:
> assertEquals("src/test/resources/notfound.txt (No such file or directory)", e.getMessage());
> fails in Windows OS (since the seperator is "\") as well as in Non-english language OS (since the OS message does not match).
> Solution:
> 1.Simply comment out the assertion since the correctness is assured by catching the FileNotFoundException.
> 2.Polish the assertion by use OS file seperator to make the string and use pos() the test whether the string is in the message.
> Either way you like, I can make the patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira