|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.test.BaseRiceTestCase org.kuali.rice.test.RiceTestCase org.kuali.rice.test.RiceInternalSuiteDataTestCase org.kuali.rice.test.BaseModuleTestCase org.kuali.rice.test.BaselineTestCase org.kuali.rice.krms.test.KRMSTestCase org.kuali.rice.krms.test.RuleManagementBaseTest
public abstract class RuleManagementBaseTest
Base test case and methods for testing RuleManagementServiceImpl
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.kuali.rice.test.BaselineTestCase |
---|
BaselineTestCase.BaselineMode, BaselineTestCase.Mode |
Field Summary | |
---|---|
protected ActionBoService |
actionBoService
|
protected AgendaBoService |
agendaBoService
|
protected String |
CLASS_DISCRIMINATOR
|
protected ContextBoService |
contextRepository
|
protected FunctionBoServiceImpl |
functionBoService
|
protected KrmsAttributeDefinitionService |
krmsAttributeDefinitionService
|
protected KrmsTypeRepositoryService |
krmsTypeRepository
|
protected RuleBoService |
ruleBoService
|
protected RuleManagementService |
ruleManagementService
|
protected TermBoService |
termBoService
|
Fields inherited from class org.kuali.rice.test.BaselineTestCase |
---|
dirty |
Fields inherited from class org.kuali.rice.test.BaseModuleTestCase |
---|
LOG, moduleName |
Fields inherited from class org.kuali.rice.test.RiceTestCase |
---|
DEFAULT_TEST_HARNESS_SPRING_BEANS, failedSuiteTestName, perTestLifeCycles, SUITE_LIFE_CYCLES_FAILED, SUITE_LIFE_CYCLES_RAN, suiteLifeCycles |
Fields inherited from class org.kuali.rice.test.BaseRiceTestCase |
---|
log, method |
Constructor Summary | |
---|---|
RuleManagementBaseTest()
|
Method Summary | |
---|---|
protected AgendaDefinition.Builder |
buildComplexAgenda(RuleManagementBaseTestObjectNames names)
|
protected ActionDefinition |
buildTestActionDefinition(String actionId,
String actionName,
String actionDescr,
int actionSequence,
String ruleId,
String namespace)
buildTestActionDefinition creates Actions in the database for testing |
protected AgendaItemDefinition |
buildTestAgendaItemDefinition(String agendaItemId,
String agendaId,
String ruleId)
buildTestAgendaItemDefinition will build aAgendaItemDefinition for testing |
protected ContextDefinition |
buildTestContext(String objectDiscriminator)
Used to build a ContextDefinition in the database for testing. |
protected NaturalLanguageUsage |
buildTestNaturalLanguageUsage(String namespace,
String nlUsageName)
Used to build a NaturalLanguageUsage entry in the database for testing. |
protected RuleDefinition |
buildTestRuleDefinition(String namespace,
String objectDiscriminator)
buildTestRuleDefinition will create a RuleDefinition entry in the database |
protected AgendaDefinition.Builder |
createComplexAgenda(String namespace,
String namespaceType,
RuleManagementBaseTestObjectNames names)
createComplexAgenda creates a "complex" agenda object in the database for testing Structure of the created agenda is as shown here. |
protected KrmsTypeDefinition |
createKrmsActionTypeDefinition(String nameSpace)
|
protected KrmsTypeDefinition |
createKrmsTypeDefinition(String typeId,
String nameSpace,
String typeName,
String serviceName)
createKrmsTypeDefinition |
protected ReferenceObjectBinding.Builder |
createReferenceObjectBinding(String collectionName,
String krmsObjectId,
String krmsDiscriminatorType,
String namespace,
String referenceObjectId,
String referenceDiscriminatorType,
boolean active)
createReferenceObjectBinding create a ReferenceObjectBinding entry in the database for testing |
protected AgendaDefinition |
createTestAgenda(String objectDiscriminator)
createTestAgenda creates a Agenda set of entries in the database for testing Context ("ContextId0", "Namespace0", "ContextName0") Agenda ("AgendaId0", "AgendaName0") AgendaItem ("AI0") Rule ("RuleId0") where 0 represents a discriminator value |
protected PropositionDefinition |
createTestCompoundProposition(RuleManagementBaseTestObjectNames t0)
createTestCompoundProposition Create a complex Compound Proposition entry in the database // ************************** // Compound Proposition (True if Account is 54321 and Occasion is either a Conference or Training) // *************************** // C1_compound_proposition "COMPOUND" "S1_simple_proposition" "S2_simple_proposition" "&" // S1_simple_proposition "SIMPLE" "Account" "54321" "=" // S2_simple_proposition "SIMPLE" "Occasion" "Conference" "=" |
protected KrmsAttributeDefinition |
createTestKrmsAttribute(String id,
String name,
String namespace)
createTestKrmsAttribute create KrmsAttribute in the database |
protected NaturalLanguageTemplate |
createTestNaturalLanguageTemplate(String namespace,
String langCode,
String nlObjectName,
String template)
Used to create a NaturalLanguageTemplate in the database for testing. |
protected NaturalLanguageTemplate |
createTestNaturalLanguageTemplate(String namespace,
String langCode,
String nlObjectName,
String template,
String nlUsage)
Used to create a NaturalLanguageTemplate in the database for testing. |
protected PropositionDefinition |
createTestPropositionForRule(String objectDiscriminator)
createTestPropositionForRule will create a PropositionDefinition entry in the database for test purposes The form of the Proposition is propId_simple_proposition "SIMPLE" "TSI_" + propId "ABC" "=" |
protected PropositionDefinition |
createTestPropositionForTranslation(String objectDiscriminator,
String namespace,
String typeName)
createTestPropositionForTranslation |
protected ReferenceObjectBinding.Builder |
createTestReferenceObjectBinding(String objectDiscriminator)
createTestReferenceObjectBinding creates a ReferenceObjectBinding entry in the database for testing |
protected PropositionDefinition |
createTestSimpleProposition(String namespace,
String propId,
String termSpecId,
String propConstant,
String propOperator,
String termSpecType,
String ruleId,
String termSpecDescr)
createTestSimpleProposition creates a SIMPLE PropositionDefinition set of entries in the database |
protected TermSpecificationDefinition |
createTestTermSpecification(String termSpecId,
String termSpecName,
String namespace,
String type,
String termSpecDescr)
createTestTermSpecification |
protected List<String> |
getPerTestTablesNotToClear()
Setting it up so that KRMS tables are not reset between test methods to make it run much faster |
void |
setClassDiscriminator()
Extending test classes can override setClassDiscriminator method and set a unique value for the class The override method should be called @before tests to ensure a unique discriminator for the class Test object naming is comprised of class, test and object uniqueness discriminators. |
void |
setup()
|
Methods inherited from class org.kuali.rice.krms.test.KRMSTestCase |
---|
getLoadApplicationLifecycle, getModuleName, getPerTestTablesToClear, getSuiteLifecycles, loadSuiteTestData |
Methods inherited from class org.kuali.rice.test.BaselineTestCase |
---|
getClearDbPerTestLifecycles, getMode, getPerTestLifecycles, getRollbackClearDbPerTestLifecycles, getRollbackTestLifecycles, setUp |
Methods inherited from class org.kuali.rice.test.RiceInternalSuiteDataTestCase |
---|
getKIMDataLoadOrderFile, getKIMSqlFileBaseLocation, getKRADDefaultSuiteTestData |
Methods inherited from class org.kuali.rice.test.BaseRiceTestCase |
---|
getName, getPerTestDataLoaderLifecycle, resetLogLevels, setLogLevel, setName, setTestMethod |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RuleManagementService ruleManagementService
protected TermBoService termBoService
protected ContextBoService contextRepository
protected KrmsTypeRepositoryService krmsTypeRepository
protected RuleBoService ruleBoService
protected AgendaBoService agendaBoService
protected ActionBoService actionBoService
protected FunctionBoServiceImpl functionBoService
protected KrmsAttributeDefinitionService krmsAttributeDefinitionService
protected String CLASS_DISCRIMINATOR
Constructor Detail |
---|
public RuleManagementBaseTest()
Method Detail |
---|
public void setup()
public void setClassDiscriminator()
protected List<String> getPerTestTablesNotToClear()
getPerTestTablesNotToClear
in class KRMSTestCase
protected RuleDefinition buildTestRuleDefinition(String namespace, String objectDiscriminator)
namespace
- objectDiscriminator
-
RuleDefinition
protected AgendaItemDefinition buildTestAgendaItemDefinition(String agendaItemId, String agendaId, String ruleId)
agendaItemId
- agendaId
- ruleId
-
AgendaItemDefinition
protected ActionDefinition buildTestActionDefinition(String actionId, String actionName, String actionDescr, int actionSequence, String ruleId, String namespace)
actionId
- actionName
- actionDescr
- actionSequence
- ruleId
- namespace
-
ActionDefinition
protected PropositionDefinition createTestPropositionForRule(String objectDiscriminator)
objectDiscriminator
-
PropositionDefinition
protected PropositionDefinition createTestPropositionForTranslation(String objectDiscriminator, String namespace, String typeName)
objectDiscriminator
- namespace
- typeId
-
PropositionDefinition
protected PropositionDefinition createTestSimpleProposition(String namespace, String propId, String termSpecId, String propConstant, String propOperator, String termSpecType, String ruleId, String termSpecDescr)
namespace
- of the proposition typepropId
- termSpecId
- propConstant
- propOperator
- termSpecType
- ruleId
- termSpecDescr
-
PropositionDefinition
protected TermSpecificationDefinition createTestTermSpecification(String termSpecId, String termSpecName, String namespace, String type, String termSpecDescr)
termSpecId
- termSpecName
- namespace
- type
- termSpecDescr
-
TermSpecificationDefinition
protected KrmsTypeDefinition createKrmsTypeDefinition(String typeId, String nameSpace, String typeName, String serviceName)
nameSpace
- typeName
- serviceName
-
KrmsTypeDefinition
protected AgendaDefinition createTestAgenda(String objectDiscriminator)
objectDiscriminator
-
AgendaDefinition.Builder
protected AgendaDefinition.Builder buildComplexAgenda(RuleManagementBaseTestObjectNames names)
protected AgendaDefinition.Builder createComplexAgenda(String namespace, String namespaceType, RuleManagementBaseTestObjectNames names)
namespace
- of the KRMS Agenda to be creatednamespaceType
- of the namepace passed (Namespace will be created if it does not exist.){@link
- RuleManagementBaseTestObjectNames} Unique discriminator names to base created Agenda upon
AgendaDefinition.Builder
populated from the built agendaprotected ReferenceObjectBinding.Builder createTestReferenceObjectBinding(String objectDiscriminator)
objectDiscriminator
-
ReferenceObjectBinding.Builder
protected ReferenceObjectBinding.Builder createReferenceObjectBinding(String collectionName, String krmsObjectId, String krmsDiscriminatorType, String namespace, String referenceObjectId, String referenceDiscriminatorType, boolean active)
collectionName
- krmsObjectId
- krmsDiscriminatorType
- namespace
- referenceObjectId
- referenceDiscriminatorType
- active
-
ReferenceObjectBinding.Builder
protected NaturalLanguageTemplate createTestNaturalLanguageTemplate(String namespace, String langCode, String nlObjectName, String template)
namespace
- of the KRMS Type which may be createdlangCode
- The two character code of applicable languagenlObjectName
- Seed value to create unique Template and Usage recordstemplate
- The text of the template for the Template record
NaturalLanguageTemplate
for the created Templateprotected NaturalLanguageTemplate createTestNaturalLanguageTemplate(String namespace, String langCode, String nlObjectName, String template, String nlUsage)
namespace
- of the KRMS Type which may be createdlangCode
- The two character code of applicable languagenlObjectName
- Seed value to create unique Template and Usage recordstemplate
- The text of the template for the Template recordnlUsage
- NaturalLanguateUsageId for the Template record
NaturalLanguageTemplate
for the created Templateprotected KrmsAttributeDefinition createTestKrmsAttribute(String id, String name, String namespace)
id
- name
- namespace
-
KrmsAttributeDefinition
protected NaturalLanguageUsage buildTestNaturalLanguageUsage(String namespace, String nlUsageName)
namespace
- will be used as namespace namenlUsageName
- is the name of the NaturalLanguageUsage to be create
NaturalLanguageUsage
protected ContextDefinition buildTestContext(String objectDiscriminator)
objectDiscriminator
- is a value use to create a unique test Context
ContextDefinition
for the created Templateprotected PropositionDefinition createTestCompoundProposition(RuleManagementBaseTestObjectNames t0)
t0
-
protected KrmsTypeDefinition createKrmsActionTypeDefinition(String nameSpace)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |