[
https://issues.apache.org/jira/browse/CAMEL-6204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13612253#comment-13612253
]
Piotr Klimczak commented on CAMEL-6204:
---------------------------------------
Test result
Tests run: 4469, Failures: 0, Errors: 0, Skipped: 1
The above tests includes the new test for loadResourceAsStream.
> 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