]
Michael Anstis moved GUVNOR-1152 to DROOLS-1990:
------------------------------------------------
Project: Drools (was: Guvnor)
Key: DROOLS-1990 (was: GUVNOR-1152)
Workflow: GIT Pull Request workflow (was: classic default workflow)
Component/s: Test Scenarios Editor
(was: Test Scenarios)
Affects Version/s: 5.5.0.Final
(was: drools-5.1)
Test Scenarios: Editor not allowing selection from variable for field
value, then corrupts value that I entered as literal after successful test run
----------------------------------------------------------------------------------------------------------------------------------------------------
Key: DROOLS-1990
URL:
https://issues.jboss.org/browse/DROOLS-1990
Project: Drools
Issue Type: Bug
Components: Test Scenarios Editor
Affects Versions: 5.5.0.Final
Environment: Guvnor running under Tomcat (7, I think) on Windows XP dual core.
Guvnor accessed via Firefox 3.x.
Reporter: Chris Clark
Assignee: Toni Rikkola
I have an object mode written in Java and imported as a JAR file. The model contains the
following (actual class names changed for clarity):
interface FlyweightIndicator
{
String getCode();
void setCode(String); // I'd prefer not to have this, but needed it for setting up
my test case
}
abstract class AbstractFlyweightIndicator implements FlyweightIndicator
{
String code;
// basic implementations for get/set Code
}
class ConcreteFlyweight extends AbstractFlyweightIndicator
{
ConcreteFlyweight()
{
code = "Something";
}
}
class ReferencingClass
{
private FlyweightIndicator myInd;
// standard implementations for get/set myInd
// some other properties, some primitives, mostly Objects
}
I have a rule which which is supposed to fire when there is a ReferecingClass that has
myInd set to a specific flyweight object.
When I went to code the test case, I created a GIVEN instance of the
ConcreteFlyweightClass [$fly] (and had to set the code, the constructor didn't seem to
get called to set it?).
Then I created another GIVEN for the ReferencingClass [$ref]. I added the myInd field.
Problem #1
Is that the editor won't give me the option to bind $fly to the field. I only get a
text box.
So I typed in "=$fly".
The test case ran and it passed. Typing in $fly seems to have done what I wanted and set
the variable.
Problem #2
Is that after the one successful run, the GIVEN section changed the myInd field to a
dropdown, but it didn't include $fly as the value. When I clicked on the arrow beside
the dropdown, $fly wasn't listed. So the field is now not set properly and the rule
will fail with a null warning.
I could live with having to type =$fly into the text box, although it should ideally
allow me to bind to the variable. But having that removed and replaced with an empty
dropdown makes the text case unusable. :(