Example usage for org.apache.commons.scxml2.env.groovy GroovyEvaluator GroovyEvaluator

List of usage examples for org.apache.commons.scxml2.env.groovy GroovyEvaluator GroovyEvaluator

Introduction

In this page you can find the example usage for org.apache.commons.scxml2.env.groovy GroovyEvaluator GroovyEvaluator.

Prototype

public GroovyEvaluator() 

Source Link

Usage

From source file:org.onehippo.repository.scxml.AbstractActionTest.java

@Before
public void before() throws Exception {
    evtDispatcher = new SimpleDispatcher();
    errRep = new SimpleErrorReporter();
    appLog = new SimpleLog(getClass().getName());

    state = new State();
    onEntry = new OnEntry();
    state.addOnEntry(onEntry);//from w w  w  .j  a  v  a2  s  . c om

    context = new GroovyContext();
    Evaluator evaluator = new GroovyEvaluator();
    exctx = EasyMock.createNiceMock(ActionExecutionContext.class);
    EasyMock.expect(exctx.getEventDispatcher()).andReturn(evtDispatcher).anyTimes();
    EasyMock.expect(exctx.getErrorReporter()).andReturn(errRep).anyTimes();
    EasyMock.expect(exctx.getAppLog()).andReturn(appLog).anyTimes();
    EasyMock.expect(exctx.getContext(state)).andReturn(context).anyTimes();
    EasyMock.expect(exctx.getEvaluator()).andReturn(evaluator).anyTimes();
    EasyMock.replay(exctx);
}

From source file:org.onehippo.repository.scxml.AbstractWorkflowTaskActionTest.java

@Before
public void before() throws Exception {
    evtDispatcher = new SimpleDispatcher();
    errRep = new SimpleErrorReporter();
    appLog = new SimpleLog(getClass().getName());

    final State state = new State();
    onEntry = new OnEntry();
    state.addOnEntry(onEntry);//  w ww.  j  a v a  2 s .  c  om

    context = new GroovyContext();
    final Evaluator evaluator = new GroovyEvaluator();
    exctx = EasyMock.createNiceMock(ActionExecutionContext.class);
    EasyMock.expect(exctx.getEventDispatcher()).andReturn(evtDispatcher).anyTimes();
    EasyMock.expect(exctx.getErrorReporter()).andReturn(errRep).anyTimes();
    EasyMock.expect(exctx.getAppLog()).andReturn(appLog).anyTimes();
    EasyMock.expect(exctx.getContext(state)).andReturn(context).anyTimes();
    EasyMock.expect(exctx.getEvaluator()).andReturn(evaluator).anyTimes();
    EasyMock.replay(exctx);
}