camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r772683 - /camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
Date Thu, 07 May 2009 15:43:08 GMT
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));
     }
 



Mime
View raw message