assertTrue(exceptionCaught);
}
public void testToArray() {
// From CAS array to Java array.
FloatArrayFS array = this.cas.createFloatArrayFS(3);
float[] fsArray = array.toArray();
for (int i = 0; i < 3; i++) {
assertTrue(fsArray[i] == 0f);
}
array.set(0, 1f);
array.set(1, 2f);
array.set(2, 3f);
fsArray = array.toArray();
assertTrue(fsArray.length == 3);
assertTrue(fsArray[0] == 1f);
assertTrue(fsArray[1] == 2f);
assertTrue(fsArray[2] == 3f);
// From Java array to CAS array.
array = this.cas.createFloatArrayFS(3);
assertTrue(array.get(0) == 0f);
assertTrue(array.get(1) == 0f);
assertTrue(array.get(2) == 0f);
for (int i = 0; i < 3; i++) {
array.set(i, fsArray[i]);
}
assertTrue(array.get(0) == 1f);
assertTrue(array.get(1) == 2f);
assertTrue(array.get(2) == 3f);
array.set(0, 0f);
assertTrue(array.get(0) == 0f);
}