/** * Create an instance of {@link ConditionalSimpleType } * */ public ConditionalSimpleType createConditionalSimpleType() { return new ConditionalSimpleType(); }
@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 testFewOperationsSkipped() { SkipOperationResolver resolver = new SkipOperationResolver(new TemplateParameterResolver(contextProvider)); ConditionalSimpleType trueExec1 = new ExecOnceType(); trueExec1.setUnless("false"); ConditionalComplexType trueExec2 = new ConditionalComplexType(); trueExec2.setIf("true"); ConditionalComplexType falseExec = new ConditionalComplexType(); falseExec.setIf("false"); assertTrue(resolver.setContextInfo(ContextInfo.EMPTY).isSkip(trueExec1, trueExec2, falseExec)); }
@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)); }
/** * Create an instance of {@link ConditionalSimpleType } * */ public ConditionalSimpleType createConditionalSimpleType() { return new ConditionalSimpleType(); }