throws Exception
{
// test getField(int, Class)
for (int i = 0; i < expected.length; i++) {
final int pos = permutation[i];
final Value e = expected[pos];
if (e == null) {
final Value retrieved = rec.getField(pos, IntValue.class);
if (retrieved != null) {
Assert.fail("Value at position " + pos + " expected to be null in " + Arrays.toString(expected));
}
} else {
final Value retrieved = rec.getField(pos, e.getClass());
if (!(e.equals(retrieved))) {
Assert.assertEquals("Wrong value at position " + pos + " in " + Arrays.toString(expected), e, retrieved);
}
}
}
// test getField(int, Value)
for (int i = 0; i < expected.length; i++) {
final int pos = permutation[i];
final Value e = expected[pos];
if (e == null) {
final Value retrieved = rec.getField(pos, new IntValue());
if (retrieved != null) {
Assert.fail("Value at position " + pos + " expected to be null in " + Arrays.toString(expected));
}
} else {
final Value retrieved = rec.getField(pos, e.getClass().newInstance());
if (!(e.equals(retrieved))) {
Assert.assertEquals("Wrong value at position " + pos + " in " + Arrays.toString(expected), e, retrieved);
}
}
}
// test getFieldInto(Value)
for (int i = 0; i < expected.length; i++) {
final int pos = permutation[i];
final Value e = expected[pos];
if (e == null) {
if (rec.getFieldInto(pos, new IntValue())) {
Assert.fail("Value at position " + pos + " expected to be null in " + Arrays.toString(expected));
}
} else {
final Value retrieved = e.getClass().newInstance();
if (!rec.getFieldInto(pos, retrieved)) {
Assert.fail("Value at position " + pos + " expected to be not null in " + Arrays.toString(expected));
}
if (!(e.equals(retrieved))) {