Search in sources :

Example 1 with GroovyKernelMock

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

the class GroovyCommOpenHandlerTest method setUp.

@Before
public void setUp() {
    kernel = new GroovyKernelMock();
    commOpenHandler = new GroovyCommOpenHandler(kernel);
}
Also used : GroovyKernelMock(com.twosigma.beakerx.groovy.kernel.GroovyKernelMock) Before(org.junit.Before)

Example 2 with GroovyKernelMock

use of com.twosigma.beakerx.groovy.kernel.GroovyKernelMock 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)

Example 3 with GroovyKernelMock

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

the class GroovyCompleteHandlerTest method setUpClass.

@BeforeClass
public static void setUpClass() {
    GroovyEvaluator groovyEvaluator = new GroovyEvaluator("id", "sid", cellExecutor(), EvaluatorTest.getTestTempFolderFactory(), new EvaluatorParameters(new HashedMap()));
    groovyKernel = new GroovyKernelMock("sid", groovyEvaluator);
}
Also used : EvaluatorParameters(com.twosigma.beakerx.kernel.EvaluatorParameters) GroovyKernelMock(com.twosigma.beakerx.groovy.kernel.GroovyKernelMock) GroovyEvaluator(com.twosigma.beakerx.groovy.evaluator.GroovyEvaluator) HashedMap(org.apache.commons.collections.map.HashedMap) BeforeClass(org.junit.BeforeClass)

Example 4 with GroovyKernelMock

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

the class GroovyKernelInfoHandlerTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    kernel = new GroovyKernelMock();
    handler = new GroovyKernelInfoHandler(kernel);
}
Also used : GroovyKernelMock(com.twosigma.beakerx.groovy.kernel.GroovyKernelMock) BeforeClass(org.junit.BeforeClass)

Aggregations

GroovyKernelMock (com.twosigma.beakerx.groovy.kernel.GroovyKernelMock)4 BeforeClass (org.junit.BeforeClass)3 EvaluatorParameters (com.twosigma.beakerx.kernel.EvaluatorParameters)2 GroovyEvaluator (com.twosigma.beakerx.groovy.evaluator.GroovyEvaluator)1 GroovyDefaultVariables (com.twosigma.beakerx.groovy.kernel.GroovyDefaultVariables)1 Binding (groovy.lang.Binding)1 HashMap (java.util.HashMap)1 HashedMap (org.apache.commons.collections.map.HashedMap)1 Before (org.junit.Before)1