I need to test more than 100 different situations, and for each of them I need an external xml that needs to be read and analyzed. I use:
String xml = IOUtils.toString(
this.getClass().getResourceAsStream(path),encoding);
For example, my xml test:
<container xmlns:dmc="http://example.com/common">
<object id="1369" checkedParamter="in" class="Class1">
...
</object>
</container>
But I need to check ivalid id with missing id, with existing id. Then I need checkedParamter to have 3-4 values and combine all the combinations with the id attribute. For each test, I now create a new xml , and the only difference is that these are two id and checkedParamter attributes . I wonder if there is an easy way to read xml and use the same structure, but pass these values from my test.
<container xmlns:dmc=" http://example.com/common">
<object id= ${valueId} checkedParamter=${valueChechedParamter} class="Class1">
...
</object>
</container>
xml . ?