package org.projectodd.nodej;

import org.dynjs.runtime.DynJS;
import org.dynjs.runtime.ExecutionContext;
import org.junit.Before;

public class NodejTestSupport {

    protected DynJS runtime;
    protected ExecutionContext context;
    protected String[] defaultArgs = { "node", "somearg" };

    @Before
    public void setUp() {
        System.setProperty("dynjs.require.path", System.getProperty("user.dir") + "/src/main/javascript/node/lib");
        runtime = new DynJS();
        context = runtime.getExecutionContext();
        Node node = new Node(defaultArgs);
        node.start(context);
    }

}
package org.projectodd.nodej;

import org.dynjs.runtime.DynJS;
import org.dynjs.runtime.ExecutionContext;
import org.dynjs.runtime.GlobalObject;
import org.junit.Before;

public class NodejTestSupport {

    protected DynJS runtime;
    protected ExecutionContext context;
    protected String[] defaultArgs = { "node", "somearg" };

    @Before
    public void setUp() {
        System.setProperty("dynjs.require.path", System.getProperty("user.dir") + "/src/main/javascript/node/lib");
        runtime = new DynJS();
        context = runtime.getExecutionContext();
        GlobalObject globalObject = context.getGlobalObject();
        globalObject.defineGlobalProperty("process", new Process(globalObject, defaultArgs));
    }

}
--- 
+++ 
@@ -2,7 +2,6 @@
 
 import org.dynjs.runtime.DynJS;
 import org.dynjs.runtime.ExecutionContext;
-import org.dynjs.runtime.GlobalObject;
 import org.junit.Before;
 
 public class NodejTestSupport {
@@ -16,8 +15,8 @@
         System.setProperty("dynjs.require.path", System.getProperty("user.dir") + "/src/main/javascript/node/lib");
         runtime = new DynJS();
         context = runtime.getExecutionContext();
-        GlobalObject globalObject = context.getGlobalObject();
-        globalObject.defineGlobalProperty("process", new Process(globalObject, defaultArgs));
+        Node node = new Node(defaultArgs);
+        node.start(context);
     }
 
 }
Initialize a Node(), which should set up process for us
