当前位置: 首页>>代码示例>>Java>>正文


Java ValidationRuleType类代码示例

本文整理汇总了Java中org.kuali.rice.krms.framework.type.ValidationRuleType的典型用法代码示例。如果您正苦于以下问题:Java ValidationRuleType类的具体用法?Java ValidationRuleType怎么用?Java ValidationRuleType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ValidationRuleType类属于org.kuali.rice.krms.framework.type包,在下文中一共展示了ValidationRuleType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testValidWarning

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Transactional
@Test
public void testValidWarning() {
    KrmsAttributeTypeDefinitionAndBuilders ruleDefs = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationRuleTypeService.VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationRuleType.VALID.toString(), true, ValidationRuleType.VALID.toString(),
            ValidationRuleType.VALID.getCode(), VALIDATION_RULE_TYPE_SERVICE, krmsTypeBoService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationActionType.WARNING.toString(), true, ValidationActionType.WARNING.toString(),
            ValidationActionType.WARNING.getCode(), VALIDATION_ACTION_TYPE_SERVICE, krmsTypeBoService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionMessageDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_MESSAGE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            "Valdiation Action Message", true, "Valdiation Action Message",
            WARNING_MESSAGE, VALIDATION_ACTION_TYPE_SERVICE, krmsTypeBoService, 1);

    List<KrmsAttributeTypeDefinitionAndBuilders> actionDefs = new LinkedList<KrmsAttributeTypeDefinitionAndBuilders>();
    actionDefs.add(actionDef);
    actionDefs.add(actionMessageDef);
    ContextBo contextBo = createContext();
    RuleBo ruleBo = createRuleWithAction(ruleDefs, actionDefs, contextBo, WARNING_MESSAGE);
    createAgenda(ruleBo, contextBo, createEventAttributeDefinition());

    EngineResults results = engineExecute();
    assertTrue(results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE) == null);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:ValidationIntegrationTest.java

示例2: testValidError

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Transactional
@Test
public void testValidError() {
    KrmsAttributeTypeDefinitionAndBuilders ruleDefs = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationRuleTypeService.VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationRuleType.VALID.toString(), true, ValidationRuleType.VALID.toString(),
            ValidationRuleType.VALID.getCode(), VALIDATION_RULE_TYPE_SERVICE, krmsTypeBoService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationActionType.ERROR.toString(), true, ValidationActionType.ERROR.toString(),
            ValidationActionType.ERROR.getCode(), VALIDATION_ACTION_TYPE_SERVICE, krmsTypeBoService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionMessageDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_MESSAGE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            "Valdiation Action Message", true, "Valdiation Action Message",
            ERROR_MESSAGE, VALIDATION_ACTION_TYPE_SERVICE, krmsTypeBoService, 1);
    List<KrmsAttributeTypeDefinitionAndBuilders> actionDefs = new LinkedList<KrmsAttributeTypeDefinitionAndBuilders>();
    actionDefs.add(actionDef);
    actionDefs.add(actionMessageDef);

    ContextBo contextBo = createContext();
    RuleBo ruleBo = createRuleWithAction(ruleDefs, actionDefs, contextBo, ERROR_MESSAGE);
    createAgenda(ruleBo, contextBo, createEventAttributeDefinition());

    EngineResults results = engineExecute();
    assertTrue(results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE) == null);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:ValidationIntegrationTest.java

示例3: testValidWarning

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Transactional
@Test
public void testValidWarning() {
    KrmsAttributeTypeDefinitionAndBuilders ruleDefs = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationRuleTypeService.VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationRuleType.VALID.toString(), true, ValidationRuleType.VALID.toString(),
            ValidationRuleType.VALID.getCode(), VALIDATION_RULE_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationActionType.WARNING.toString(), true, ValidationActionType.WARNING.toString(),
            ValidationActionType.WARNING.getCode(), VALIDATION_ACTION_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionMessageDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_MESSAGE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            "Valdiation Action Message", true, "Valdiation Action Message",
            WARNING_MESSAGE, VALIDATION_ACTION_TYPE_SERVICE, krmsTypeRepositoryService, 1);

    List<KrmsAttributeTypeDefinitionAndBuilders> actionDefs = new LinkedList<KrmsAttributeTypeDefinitionAndBuilders>();
    actionDefs.add(actionDef);
    actionDefs.add(actionMessageDef);
    ContextBo contextBo = createContext();
    RuleBo ruleBo = createRuleWithAction(ruleDefs, actionDefs, contextBo, WARNING_MESSAGE);
    createAgenda(ruleBo, contextBo, createEventAttributeDefinition());

    EngineResults results = engineExecute();
    assertTrue(results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE) == null);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:27,代码来源:ValidationIntegrationTest.java

示例4: testValidError

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Transactional
@Test
public void testValidError() {
    KrmsAttributeTypeDefinitionAndBuilders ruleDefs = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationRuleTypeService.VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationRuleType.VALID.toString(), true, ValidationRuleType.VALID.toString(),
            ValidationRuleType.VALID.getCode(), VALIDATION_RULE_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationActionType.ERROR.toString(), true, ValidationActionType.ERROR.toString(),
            ValidationActionType.ERROR.getCode(), VALIDATION_ACTION_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionMessageDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_MESSAGE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            "Valdiation Action Message", true, "Valdiation Action Message",
            ERROR_MESSAGE, VALIDATION_ACTION_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    List<KrmsAttributeTypeDefinitionAndBuilders> actionDefs = new LinkedList<KrmsAttributeTypeDefinitionAndBuilders>();
    actionDefs.add(actionDef);
    actionDefs.add(actionMessageDef);

    ContextBo contextBo = createContext();
    RuleBo ruleBo = createRuleWithAction(ruleDefs, actionDefs, contextBo, ERROR_MESSAGE);
    createAgenda(ruleBo, contextBo, createEventAttributeDefinition());

    EngineResults results = engineExecute();
    assertTrue(results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE) == null);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:27,代码来源:ValidationIntegrationTest.java

示例5: testInvalidWarning

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Transactional
@Test
public void testInvalidWarning() {
    KrmsAttributeTypeDefinitionAndBuilders ruleDefs = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationRuleTypeService.VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationRuleType.INVALID.toString(), true, ValidationRuleType.INVALID.toString(),
            ValidationRuleType.INVALID.getCode(), VALIDATION_RULE_TYPE_SERVICE, krmsTypeBoService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationActionType.WARNING.toString(), true, ValidationActionType.WARNING.toString(),
            ValidationActionType.WARNING.getCode(), VALIDATION_ACTION_TYPE_SERVICE, krmsTypeBoService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionMessageDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_MESSAGE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            "Valdiation Action Message", true, "Valdiation Action Message",
            WARNING_MESSAGE, VALIDATION_ACTION_TYPE_SERVICE, krmsTypeBoService, 1);

    List<KrmsAttributeTypeDefinitionAndBuilders> actionDefs = new LinkedList<KrmsAttributeTypeDefinitionAndBuilders>();
    actionDefs.add(actionDef);
    actionDefs.add(actionMessageDef);

    ContextBo contextBo = createContext();
    RuleBo ruleBo = createRuleWithAction(ruleDefs, actionDefs, contextBo, WARNING_MESSAGE);
    createAgenda(ruleBo, contextBo, createEventAttributeDefinition());

    EngineResults results = engineExecute();
    assertNotNull(results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE));
    assertEquals(ValidationActionType.WARNING.getCode() + ":" + WARNING_MESSAGE,
            results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:30,代码来源:ValidationIntegrationTest.java

示例6: testInvalidError

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Transactional
@Test
public void testInvalidError() {
    KrmsAttributeTypeDefinitionAndBuilders ruleDefs = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationRuleTypeService.VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationRuleType.INVALID.toString(), true, ValidationRuleType.INVALID.toString(),
            ValidationRuleType.INVALID.getCode(), VALIDATION_RULE_TYPE_SERVICE, krmsTypeBoService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationActionType.ERROR.toString(), true, ValidationActionType.ERROR.toString(),
            ValidationActionType.ERROR.getCode(), VALIDATION_ACTION_TYPE_SERVICE, krmsTypeBoService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionMessageDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_MESSAGE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            "Valdiation Action Message", true, "Valdiation Action Message",
            ERROR_MESSAGE, VALIDATION_ACTION_TYPE_SERVICE, krmsTypeBoService, 1);
    List<KrmsAttributeTypeDefinitionAndBuilders> actionDefs = new LinkedList<KrmsAttributeTypeDefinitionAndBuilders>();
    actionDefs.add(actionDef);
    actionDefs.add(actionMessageDef);

    ContextBo contextBo = createContext();
    RuleBo ruleBo = createRuleWithAction(ruleDefs, actionDefs, contextBo, ERROR_MESSAGE);
    createAgenda(ruleBo, contextBo, createEventAttributeDefinition());

    EngineResults results = engineExecute();
    assertNotNull(results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE));
    assertEquals(ValidationActionType.ERROR.getCode() + ":" + ERROR_MESSAGE, results.getAttribute(
            ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:ValidationIntegrationTest.java

示例7: shouldExecuteAction

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
/**
 * Valid Validation Rules execute when the ruleExecutionResult is false.
 * Invalid Validation Rules execute when the ruleExecutionResult is true.
 * @param ruleExecutionResult result of the rules execution
 * @return should the actions be executed
 */
@Override
protected boolean shouldExecuteAction(boolean ruleExecutionResult) {
    if (type == null || type.equals(ValidationRuleType.VALID)) {
        return !ruleExecutionResult;
    }
    return ruleExecutionResult;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:ValidationRule.java

示例8: loadRule

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Override
public Rule loadRule(RuleDefinition validationRuleDefinition) {
    if (validationRuleDefinition == null) { throw new RiceIllegalArgumentException("validationRuleDefinition must not be null"); }
    if (validationRuleDefinition.getAttributes() == null) { throw new RiceIllegalArgumentException("validationRuleDefinition must not be null");}

    if (!validationRuleDefinition.getAttributes().containsKey(VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE)) {

        throw new RiceIllegalArgumentException("validationRuleDefinition does not contain an " +
                VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE + " attribute");
    }
    String validationRuleTypeCode = validationRuleDefinition.getAttributes().get(VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE);

    if (StringUtils.isBlank(validationRuleTypeCode)) {
        throw new RiceIllegalArgumentException(VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE + " attribute must not be null or blank");
    }

    if (ValidationRuleType.VALID.getCode().equals(validationRuleTypeCode)) {
        return new ValidationRule(ValidationRuleType.VALID, validationRuleDefinition.getName(),
                translator.translatePropositionDefinition(validationRuleDefinition.getProposition()),
                translator.translateActionDefinitions(validationRuleDefinition.getActions()));
    }
    if (ValidationRuleType.INVALID.getCode().equals(validationRuleTypeCode)) {
        return new ValidationRule(ValidationRuleType.INVALID, validationRuleDefinition.getName(),
                translator.translatePropositionDefinition(validationRuleDefinition.getProposition()),
                translator.translateActionDefinitions(validationRuleDefinition.getActions()));
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:ValidationRuleTypeServiceImpl.java

示例9: getAttributeFields

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
/**
 *
 * @return List<RemotableAttributeField>
 * @throws RiceIllegalArgumentException
 */
@Override
public List<RemotableAttributeField> getAttributeFields(@WebParam(name = "krmsTypeId") String krmsTypeId) throws RiceIllegalArgumentException {
    Map<String, String> keyLabels = new TreeMap<String, String>();
    keyLabels.put(ValidationRuleType.VALID.getCode(), "Valid - action executed when false");
    keyLabels.put(ValidationRuleType.INVALID.getCode(), "Invalid - action executed when true");
    return getAttributeFields(krmsTypeId, keyLabels);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:ValidationRuleTypeServiceImpl.java

示例10: testValidRulePassesActionDoesntFire

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Test
public void testValidRulePassesActionDoesntFire() {
    Rule validationRule = new ValidationRule(ValidationRuleType.VALID, "testValidRulePassesActionDoesntFire",
            new ComparableTermBasedProposition(operatorEquals, term, "true"), Collections
            .<Action>singletonList(actionMock));
    assertTrue(validationRule.evaluate(new BasicExecutionEnvironment(testEvent, facts, executionOptions,
            termResolutionEngine)));
    assertFalse(actionMock.actionFired("a1"));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:ValidationRuleTest.java

示例11: testValidRuleFailsActionFires

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Test
public void testValidRuleFailsActionFires() {
    Rule validationRule = new ValidationRule(ValidationRuleType.VALID, "testValidRuleFailsActionFires",
            new ComparableTermBasedProposition(operatorEquals, term, "false"), Collections
            .<Action>singletonList(actionMock));
    assertFalse(validationRule.evaluate(new BasicExecutionEnvironment(testEvent, facts, executionOptions,
            termResolutionEngine)));
    assertTrue(actionMock.actionFired("a1"));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:ValidationRuleTest.java

示例12: testInvalidRulePassesActionFires

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Test
public void testInvalidRulePassesActionFires() {
    Rule validationRule = new ValidationRule(ValidationRuleType.INVALID, "testInvalidRulePassesActionFires",
            new ComparableTermBasedProposition(operatorEquals, term, "true"), Collections
            .<Action>singletonList(actionMock));
    assertTrue(validationRule.evaluate(new BasicExecutionEnvironment(testEvent, facts, executionOptions,
            termResolutionEngine)));
    assertTrue(actionMock.actionFired("a1"));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:ValidationRuleTest.java

示例13: testInvalidRuleFalseActionDoesntFire

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Test
public void testInvalidRuleFalseActionDoesntFire() {
    Rule validationRule = new ValidationRule(ValidationRuleType.INVALID, "testInvalidRuleFalseActionDoesntFire",
            new ComparableTermBasedProposition(operatorEquals, term, "false"), Collections
            .<Action>singletonList(actionMock));
    assertFalse(validationRule.evaluate(new BasicExecutionEnvironment(testEvent, facts, executionOptions,
            termResolutionEngine)));
    assertFalse(actionMock.actionFired("a1"));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:ValidationRuleTest.java

示例14: testInvalidWarning

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Transactional
@Test
public void testInvalidWarning() {
    KrmsAttributeTypeDefinitionAndBuilders ruleDefs = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationRuleTypeService.VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationRuleType.INVALID.toString(), true, ValidationRuleType.INVALID.toString(),
            ValidationRuleType.INVALID.getCode(), VALIDATION_RULE_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationActionType.WARNING.toString(), true, ValidationActionType.WARNING.toString(),
            ValidationActionType.WARNING.getCode(), VALIDATION_ACTION_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionMessageDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_MESSAGE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            "Valdiation Action Message", true, "Valdiation Action Message",
            WARNING_MESSAGE, VALIDATION_ACTION_TYPE_SERVICE, krmsTypeRepositoryService, 1);

    List<KrmsAttributeTypeDefinitionAndBuilders> actionDefs = new LinkedList<KrmsAttributeTypeDefinitionAndBuilders>();
    actionDefs.add(actionDef);
    actionDefs.add(actionMessageDef);

    ContextBo contextBo = createContext();
    RuleBo ruleBo = createRuleWithAction(ruleDefs, actionDefs, contextBo, WARNING_MESSAGE);
    createAgenda(ruleBo, contextBo, createEventAttributeDefinition());

    EngineResults results = engineExecute();
    assertNotNull(results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE));
    assertEquals(ValidationActionType.WARNING.getCode() + ":" + WARNING_MESSAGE,
            results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:30,代码来源:ValidationIntegrationTest.java

示例15: testInvalidError

import org.kuali.rice.krms.framework.type.ValidationRuleType; //导入依赖的package包/类
@Transactional
@Test
public void testInvalidError() {
    KrmsAttributeTypeDefinitionAndBuilders ruleDefs = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationRuleTypeService.VALIDATIONS_RULE_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationRuleType.INVALID.toString(), true, ValidationRuleType.INVALID.toString(),
            ValidationRuleType.INVALID.getCode(), VALIDATION_RULE_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_TYPE_CODE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            ValidationActionType.ERROR.toString(), true, ValidationActionType.ERROR.toString(),
            ValidationActionType.ERROR.getCode(), VALIDATION_ACTION_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    KrmsAttributeTypeDefinitionAndBuilders actionMessageDef = createKrmsAttributeTypeDefinitionAndBuilders(
            ValidationActionTypeService.VALIDATIONS_ACTION_MESSAGE_ATTRIBUTE, KrmsConstants.KRMS_NAMESPACE,
            "Valdiation Action Message", true, "Valdiation Action Message",
            ERROR_MESSAGE, VALIDATION_ACTION_TYPE_SERVICE, krmsTypeRepositoryService, 1);
    List<KrmsAttributeTypeDefinitionAndBuilders> actionDefs = new LinkedList<KrmsAttributeTypeDefinitionAndBuilders>();
    actionDefs.add(actionDef);
    actionDefs.add(actionMessageDef);

    ContextBo contextBo = createContext();
    RuleBo ruleBo = createRuleWithAction(ruleDefs, actionDefs, contextBo, ERROR_MESSAGE);
    createAgenda(ruleBo, contextBo, createEventAttributeDefinition());

    EngineResults results = engineExecute();
    assertNotNull(results.getAttribute(ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE));
    assertEquals(ValidationActionType.ERROR.getCode() + ":" + ERROR_MESSAGE, results.getAttribute(
            ValidationActionTypeService.VALIDATIONS_ACTION_ATTRIBUTE));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:29,代码来源:ValidationIntegrationTest.java


注:本文中的org.kuali.rice.krms.framework.type.ValidationRuleType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。