camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piotr Klimczak (JIRA)" <>
Subject [jira] [Created] (CAMEL-6204) loadResourceAsStream in ObjectHelper could not load resource with leading "/"
Date Sun, 24 Mar 2013 20:13:15 GMT
Piotr Klimczak created CAMEL-6204:

             Summary: loadResourceAsStream in ObjectHelper could not load resource with leading
                 Key: CAMEL-6204
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.11.1
            Reporter: Piotr Klimczak

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("");
        InputStream res2 = ObjectHelper.loadResourceAsStream("org/apache/camel/util/");
        InputStream res3 = ObjectHelper.loadResourceAsStream("/org/apache/camel/util/");

        assertNotNull("Cannot load resource with relative path", res1);
        assertNotNull("Cannot load resource without leading \"/\"", res2);
        assertNotNull("Cannot load resource with leading \"/\"", res3);

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:

View raw message