You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/05/07 17:43:08 UTC
svn commit: r772683 -
/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
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));
}