svn commit: r772683 - /camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r772683 - /camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java

davsclaus-2
Author: davsclaus
Date: Thu May  7 15:43:07 2009
New Revision: 772683

URL: http://svn.apache.org/viewvc?rev=772683&view=rev
Log:
CAMEL-1590: jndi.properties should be optional for camel-test.jar

Modified:
    camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java

Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java?rev=772683&r1=772682&r2=772683&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java Thu May  7 15:43:07 2009
@@ -151,10 +151,14 @@
     }
 
     protected Context createJndiContext() throws Exception {
-        InputStream in = getClass().getClassLoader().getResourceAsStream("jndi.properties");
-        assertNotNull("Cannot find jndi.properties on the classpath!", in);
         Properties properties = new Properties();
-        properties.load(in);
+
+        // jndi.properties is optional
+        InputStream in = getClass().getClassLoader().getResourceAsStream("jndi.properties");
+        if (in != null) {
+            log.debug("Using jndi.properties from classpath root");
+            properties.load(in);
+        }
         return new InitialContext(new Hashtable(properties));
     }