<objs><obj id="myId" type="my.class.Type" hint="bean">...</obj><objs>
To define bean objects you need to know the naming of the field setter
method (without set prefix) and the datatype of the argument used for this
method.
To use this functionality could be interesting in the context of providing
special validation processing or calculation inside of the setter methods.
The structure looks like this:
... <test id="myFirstTestCase"> <objs> <obj id="myObj" type="junitx.ddtunit.resources.SimpleVO" hint="bean"> <doubleValue>12.4</doubleValue> <integerValue>4711</integerValue> </obj> </objs> </test> ...
public class SimpleVO { private Integer integerValue; private String stringValue; private Double doubleValue; /** * Default constructor. */ public SimpleVO() { // no special initialization neccessary } public void setDoubleValue(Double arg){ // whatever check or calculation you like to process ... this.doubleValue = arg; } public void setIntegerValue(Integer arg){ // whatever check or calculation you like to process ... this.integerValue = arg; } ...
If you are using an empty object description
<obj id="myObj" type="junitx.ddtunit.resources.SimpleVO" hint="bean"/>
To specify a "null" assignment use the explizit description
<obj id="myObj" type="junitx.ddtunit.resources.SimpleVO" hint="bean">!NULL!<obj>