/** * Create an instance of {@link ExecEachSequenceType } * */ public ExecEachSequenceType createExecEachSequenceType() { return new ExecEachSequenceType(); }
private void execEachSequenceInPipe(ExecEachSequenceType execSequence, PipeOperationInfo pipeInfo) { if (execSequence.getExecOnce() != null) { getExecSequenceOnceOperations(execSequence).forEach(pipeInfo::addCycleOperation); } else if (execSequence.getPipe() != null) { getExecSequencePipeOperations(execSequence).forEach(pipeInfo::addCycleOperation); } }
SequenceType seqType = execSequence.getType(); if (execSequence.getExecOnce() != null) { OperationInfo operationInfo = new OperationInfo(execSequence.getExecOnce().getValue(), execSequence.getName(), contextInfo, skipOperationResolver .setContextInfo(contextInfo) .isSkip(execSequence.getExecOnce(), execSequence, execEachSegm)); result.add(operationInfo); if (execSequence.getDynamicParameter() != null) { for (DynamicParameterConcatType dynamicParam : execSequence.getDynamicParameter()) { contextProvider.getDynamicContext().addParameter(dynamicParam, contextInfo, skipOperationResolver
SequenceType seqType = execSequence.getType(); if (execSequence.getPipe() != null) { List<OperationInfo> pipeOperations = new ArrayList<>(); for (ExecOnceType execOnceType : execSequence.getPipe().getExecOnce()) { OperationInfo operationInfo = new OperationInfo(execOnceType.getValue(), execOnceType.getName(), contextInfo, skipOperationResolver if (execSequence.getDynamicParameter() != null) { for (DynamicParameterConcatType dynamicParam : execSequence.getDynamicParameter()) { contextProvider.getDynamicContext().addParameter(dynamicParam, contextInfo, skipOperationResolver
/** * Create an instance of {@link ExecEachSequenceType } * */ public ExecEachSequenceType createExecEachSequenceType() { return new ExecEachSequenceType(); }
private void execSequence(ExecEachSequenceType execSequence) throws IOException { if (execSequence.getExecOnce() != null) { for (OperationInfo segmentOperation : getExecSequenceOnceOperations(execSequence)) { executeStrategyFactory.createExecuteOnceStrategy(contextProvider).execute(segmentOperation); } } else if (execSequence.getPipe() != null) { for (List<OperationInfo> pipeOperations : getExecSequencePipeOperations(execSequence)) { PipeOperationInfo pipeInfo = new PipeOperationInfo(); pipeInfo.addTailOperations(pipeOperations); executeStrategyFactory.createExecutePipeStrategy(contextProvider).execute(pipeInfo); } } }
@Test public void testOperationNotSkipped() { SkipOperationResolver resolver = new SkipOperationResolver(new TemplateParameterResolver(contextProvider)); ConditionalSimpleType trueExec = new ExecOnceType(); trueExec.setUnless("false"); ConditionalSimpleType ifParamExec = new ExecOnceType(); ifParamExec.setIf("%{dynamic.trueParam}"); ConditionalComplexType unlessParamExec = new ExecEachSequenceType(); unlessParamExec.setUnless("%{dynamic.falseParam}"); ConditionalComplexType ifUnlessParamExec = new ExecEachSegmentSequenceType(); ifUnlessParamExec.setIf("%{dynamic.trueParam}"); ifUnlessParamExec.setUnless("%{dynamic.falseParam}"); assertFalse(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(trueExec)); assertFalse(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(ifParamExec)); assertFalse(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(unlessParamExec)); assertFalse(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(ifUnlessParamExec)); }
@Test public void testOperationSkipped() { SkipOperationResolver resolver = new SkipOperationResolver(new TemplateParameterResolver(contextProvider)); ConditionalSimpleType falseExec = new ExecOnceType(); falseExec.setIf("false"); ConditionalSimpleType ifParamExec = new ExecOnceType(); ifParamExec.setIf("%{dynamic.falseParam}"); ConditionalComplexType unlessParamExec = new ExecEachSequenceType(); unlessParamExec.setUnless("%{dynamic.trueParam}"); ConditionalComplexType ifUnlessParamExec = new ExecEachSegmentSequenceType(); ifUnlessParamExec.setIf("%{dynamic.trueParam}"); // not skipped ifUnlessParamExec.setUnless("%{dynamic.trueParam}"); // skipped assertTrue(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(falseExec)); assertTrue(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(ifParamExec)); assertTrue(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(unlessParamExec)); assertTrue(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(ifUnlessParamExec)); }