use of com.walmartlabs.concord.runner.engine.ConcordExecutionContextFactory.ConcordExecutionContext in project concord by walmartlabs.
the class ConcordExecutionContextTest method testProtectedVariable.
@Test
public void testProtectedVariable() {
ConcordExecutionContext ctx = ctx();
varContext.preTask("task", null, null);
ctx.setProtectedVariable("s", "s-var");
varContext.postTask("task", null, null);
assertEquals("s-var", ctx.getVariable("s"));
assertEquals("s-var", ctx.getProtectedVariable("s"));
assertNull(ctx.getVariable("not-found"));
assertNull(ctx.getProtectedVariable("not-found"));
try {
ctx.removeVariable("s");
fail("exception expected");
} catch (RuntimeException e) {
// ignore
}
}
use of com.walmartlabs.concord.runner.engine.ConcordExecutionContextFactory.ConcordExecutionContext in project concord by walmartlabs.
the class ConcordExecutionContextTest method testProtectedVariableWithoutContext.
@Test
public void testProtectedVariableWithoutContext() {
assertThrows(RuntimeException.class, () -> {
ConcordExecutionContext ctx = ctx();
ctx.setProtectedVariable("oops", 1);
});
}
use of com.walmartlabs.concord.runner.engine.ConcordExecutionContextFactory.ConcordExecutionContext in project concord by walmartlabs.
the class ConcordExecutionContextTest method ctx.
private ConcordExecutionContext ctx() {
ExecutionContextFactory<? extends ExecutionContext> ctxFactory = null;
ExpressionManager expressionManager = null;
FormService formService = null;
Variables source = new Variables();
return new ConcordExecutionContext(ctxFactory, expressionManager, source, varContext, formService);
}
Aggregations