Closed surecloud-malokaidi closed 4 weeks ago
@surecloud-malokaidi Hello.
Sorry, currently Fixture Monkey does not support setPostCondition
to filter subclasses.
The features related to subclasses are planned to be supported since 1.1.x
. It would be two parts.
interfaceImplements
, abstractExtends
(the name is same as the option in FixtureMonkeyBuilder)setPostCondition
) to support subclassesIn 1.0.x you should use set
API to set subclasses instead.
Thank you.
@surecloud-malokaidi Hi, thanks for waiting. The problem is fixed in 1.0.22.
Please let me know if you experience any further problems.
Thank you very much.
The issue is closed as it has been fixed since 1.0.22. If you have any problems, please reopen the issue.
Describe the bug
When using
setPostCondition
to select a subset acceptable subclasses the generator seems to get stuck in infinite loop if the predicate evaluates tofalse
on the class typeYour environment
Steps to reproduce
Run
FixtureMonkeyTest.java
from https://github.com/surecloud-malokaidi/fixture-monkey-bugExpected behaviour
I would expect FixtureMonkey to generate a different type of class if the predicate evaluates to false
Actual behaviour
The same class type is used and only it's attributes values change each time the predicate is false resulting in an infinite number of attempts (maxing out at max tries) at creating an object satisfying the condition.