// Test every permutation of different xpath combinations
for (String rootName : sampleRootNames) {
for (int i = 0; i < sampleValueNames.length; i++) {
for (int j = 0; j < sampleInnerValues.length; j = j + 2) {
PipeTest pipeTest = buildPipeTestObject(value, rootName, sampleValueNames[i], sampleInnerNames[i],
sampleInnerValues[j], sampleInnerValues[j + 1]);
assertEquals(value, pipeTest.getValue());
assertEquals(value, pipeTest.getInner().getInnerValue1());
assertEquals(value, pipeTest.getInner().getInnerValue2());
}
}
}
// Test an absolute path
PipeTest pipeTest = buildPipeTestObject(value, "HergyBlergy", "Value3", "inner", "InnerValue1", "InnerValue2");
assertEquals(value, pipeTest.getValue());
assertEquals(value, pipeTest.getInner().getInnerValue1());
assertEquals(value, pipeTest.getInner().getInnerValue2());
// Test negative cases - ensure that Object/Value3, inner/inner4 and
// inner/inner5 resolve to nothing.
pipeTest = buildPipeTestObject(value, "Object", "Value3", "inner", "inner4", "inner5");
assertEquals(null, pipeTest.getValue());
assertEquals(null, pipeTest.getInner().getInnerValue1());
assertEquals(null, pipeTest.getInner().getInnerValue2());
}