
package org.copperengine.regtest.test.tranzient.simple;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.util.concurrent.TimeUnit;

import org.copperengine.core.EngineState;
import org.copperengine.regtest.test.backchannel.WorkflowResult;
import org.copperengine.regtest.test.tranzient.TransientEngineTestContext;
import org.junit.Test;

public class SubWorkflowTransientEngineTest {

    @Test
    public void testWorkflow() throws Exception {
        try (TransientEngineTestContext ctx = new TransientEngineTestContext()) {
            ctx.startup();
            assertEquals(EngineState.STARTED, ctx.getEngine().getEngineState());
            ctx.getEngine().run("org.copperengine.regtest.test.tranzient.simple.SimpleTestParentWorkflow", "testData");
            WorkflowResult r = ctx.getBackChannelQueue().dequeue(2000, TimeUnit.MILLISECONDS);
            assertNotNull(r);
        }
    }

}
