當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。