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));
    }

}
@@ -103,47 +103,8 @@
 xt;%0A
-import org.dynjs.runtime.GlobalObject;%0A
 impo
@@ -534,154 +534,69 @@
     
-GlobalObject globalObject = context.getGlobalObject();%0A        globalObject.defineGlobalProperty(%22process%22, new Process(globalObject, defaultArgs)
+Node node = new Node(defaultArgs);%0A        node.start(context
 );%0A 

Initialize a Node(), which should set up process for us