[jboss-jira] [JBoss JIRA] (DROOLS-2010) Add queries w/assign variables in "Expect" section of Test Scenario editor
Toni Rikkola (Jira)
issues at jboss.org
Fri Jan 11 10:09:01 EST 2019
[ https://issues.jboss.org/browse/DROOLS-2010?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Toni Rikkola updated DROOLS-2010:
---------------------------------
Component/s: Scenario Simulation and Testing
> Add queries w/assign variables in "Expect" section of Test Scenario editor
> --------------------------------------------------------------------------
>
> Key: DROOLS-2010
> URL: https://issues.jboss.org/browse/DROOLS-2010
> Project: Drools
> Issue Type: Enhancement
> Components: Scenario Simulation and Testing, Test Scenarios Editor
> Affects Versions: 6.5.0.Final
> Environment: Tomcat 9 (CLI), Win7 x64, Google Chrome
> Reporter: Russell Morrisey
> Assignee: Toni Rikkola
> Priority: Major
>
> In the Test Scenario editor, I want to be able to set up "Expect" clauses that chain together, like this:
> {code:java}
> $r1: A fact of type FieldValidation has values:
> - fieldCode = "countryCode"
> A fact of type FactAttributeValue has values:
> - fieldValidation = $r1
> - type = "allowedValue"
> - value = "US"
> {code}
> In this case, I want to query for the 1st object, store it in a variable, and use the variable value to verify the 2nd clause of the test. This is necessary to verify relationships between objects, such as master-detail relationships. It seems like the current Test Scenario editor interface does not support this.
> The following rule snippet produces facts like those above, which seem untestable in the current Test Scenario editor:
> {code:java}
> when
> ...
> then
> FieldValidation $r1 = new FieldValidation("countryCode")
> insertLogical( $r1 )
> insertLogical( new FactAttributeValue($r1, "allowedValue", "US") )
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list