Jacek,
Can you make sure to run a full build (with test on) before
committing? There is an incredibly subtle bug in this commit that
you can only find by running the tests. Please fix this ASAP as the
build is currently broken
-dain
See below for details on this specific bug:
On Jul 12, 2007, at 2:31 PM, [EMAIL PROTECTED] wrote:
Modified: openejb/trunk/openejb3/itests/openejb-itests-client/src/
main/java/org/apache/openejb/test/IvmTestServer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/itests/
openejb-itests-client/src/main/java/org/apache/openejb/test/
IvmTestServer.java?view=diff&rev=555774&r1=555773&r2=555774
======================================================================
========
--- openejb/trunk/openejb3/itests/openejb-itests-client/src/main/
java/org/apache/openejb/test/IvmTestServer.java (original)
+++ openejb/trunk/openejb3/itests/openejb-itests-client/src/main/
java/org/apache/openejb/test/IvmTestServer.java Thu Jul 12 14:31:26
2007
@@ -18,12 +18,14 @@
import java.util.Properties;
+import javax.naming.Context;
import javax.naming.InitialContext;
/**
- *
* @author <a href="mailto:[EMAIL PROTECTED]">David Blevins</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Richard
Monson-Haefel</a>
+ *
+ * @version $Rev$ $Date$
*/
public class IvmTestServer implements TestServer {
@@ -31,13 +33,15 @@
public void init(Properties props){
- properties = props;
+ properties = new Properties();
+ properties.putAll(props);
try{
- props.put("java.naming.factory.initial",
"org.apache.openejb.client.LocalInitialContextFactory");
- Properties p = new Properties(props);
+ props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
+ Properties p = new Properties();
+ p.putAll(props);
p.put("openejb.loader", "embed");
- new InitialContext( p );
+ new InitialContext( p ); // initialize openejb via
constructing jndi tree
//OpenEJB.init(properties);
}catch(Exception oe){
In the test code we pass System.getProperties() into this method.
The code then adds the initial context factory property to the passed
in properties, and thus the system properties. Your change makes a
copy of the properties first, so the initial context factory property
never makes it into the system properties. This breaks the itests
because you can no longer create a new InitialContext().
Also, please use Context.INITIAL_CONTEXT_FACTORY, instead of
inlineing the value. It is much harder to make a typo when you use a
constant.