Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.10.4
-
Patch Available
-
Unknown
Description
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.
public void testLoadResourceAsStream() { InputStream res1 = ObjectHelper.loadResourceAsStream("org/apache/camel/util/ObjectHelperResourceTestFile.properties"); InputStream res2 = ObjectHelper.loadResourceAsStream("/org/apache/camel/util/ObjectHelperResourceTestFile.properties"); assertNotNull("Cannot load resource without leading \"/\"", res1); assertNotNull("Cannot load resource with leading \"/\"", res2); }