camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piotr Klimczak (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-6204) loadResourceAsStream in ObjectHelper could not load resource with leading "/"
Date Sun, 24 Mar 2013 21:17:14 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-6204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Piotr Klimczak updated CAMEL-6204:
----------------------------------

    Attachment: CAMEL6204.diff
    
> loadResourceAsStream in ObjectHelper could not load resource with leading "/"
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-6204
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6204
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.11.1
>            Reporter: Piotr Klimczak
>              Labels: ObjectHelper, camel-core,, load, resource, util
>         Attachments: CAMEL6204.diff
>
>
> As i could not found any test for ObjectHelper.loadResourceAsStream and i have feced
some unexpected behaviur I have created a simple unit test.
> The expected result is to get all resources loaded.
> Unfortunately ObjectHelper.loadResourceAsStream does no allow to load resource from relative
path and for path with leading "/".
> I my opinion it is a bug.
> {code}
>     public void testLoadResourceAsStream() {
>         // ObjectHelperResourceTestFile.properties
>         InputStream res1 = ObjectHelper.loadResourceAsStream("ObjectHelperResourceTestFile.properties");
>         InputStream res2 = ObjectHelper.loadResourceAsStream("org/apache/camel/util/ObjectHelperResourceTestFile.properties");
>         InputStream res3 = ObjectHelper.loadResourceAsStream("/org/apache/camel/util/ObjectHelperResourceTestFile.properties");
>         assertNotNull("Cannot load resource with relative path", res1);
>         assertNotNull("Cannot load resource without leading \"/\"", res2);
>         assertNotNull("Cannot load resource with leading \"/\"", res3);
>     }
> {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

Mime
View raw message