Search in sources :

Example 1 with GroovyDefaultVariables

use of com.twosigma.beakerx.groovy.kernel.GroovyDefaultVariables in project beakerx by twosigma.

the class GroovyEvaluatorTest method initClassStubData.

@BeforeClass
public static void initClassStubData() throws IOException {
    GroovyDefaultVariables var = new GroovyDefaultVariables();
    HashMap<String, Object> params = new HashMap<>();
    params.put(IMPORTS, var.getImports());
    params.put(CLASSPATH, var.getClassPath());
    EvaluatorParameters kernelParameters = new EvaluatorParameters(params);
    GroovyEvaluator groovyEvaluator = new GroovyEvaluator("123", "345", cellExecutor(), getTestTempFolderFactory(), kernelParameters);
    groovyEvaluator.setShellOptions(kernelParameters);
    groovyClassLoader = newEvaluator(groovyEvaluator.getImports(), groovyEvaluator.getClasspath(), groovyEvaluator.getOutDir(), icz, newParentClassLoader(groovyEvaluator.getClasspath()));
    scriptBinding = new Binding();
    scriptBinding.setVariable("beaker", NamespaceClient.getBeaker("345"));
    groovyKernel = new GroovyKernelMock("groovyEvaluatorTest", groovyEvaluator);
    KernelManager.register(groovyKernel);
}
Also used : EvaluatorParameters(com.twosigma.beakerx.kernel.EvaluatorParameters) Binding(groovy.lang.Binding) GroovyDefaultVariables(com.twosigma.beakerx.groovy.kernel.GroovyDefaultVariables) GroovyKernelMock(com.twosigma.beakerx.groovy.kernel.GroovyKernelMock) HashMap(java.util.HashMap) BeforeClass(org.junit.BeforeClass)

Aggregations

GroovyDefaultVariables (com.twosigma.beakerx.groovy.kernel.GroovyDefaultVariables)1 GroovyKernelMock (com.twosigma.beakerx.groovy.kernel.GroovyKernelMock)1 EvaluatorParameters (com.twosigma.beakerx.kernel.EvaluatorParameters)1 Binding (groovy.lang.Binding)1 HashMap (java.util.HashMap)1 BeforeClass (org.junit.BeforeClass)1