public void testPrimitiveArrays() throws Exception {
OpenJPAEntityManager newEm = (OpenJPAEntityManager) factory
.createEntityManager();
try {
startTx(newEm);
CacheObjectA a = (CacheObjectA) newEm.find(CacheObjectA.class, oid);
a.setPrimitiveArray(new float[]{ 0, 1, 2 });
endTx(newEm);
}
finally {
endEm(newEm);
}
newEm = (OpenJPAEntityManager) factory.createEntityManager();
try {
a = (CacheObjectA) newEm.find(CacheObjectA.class, oid);
float[] array = a.getPrimitiveArray();
assertEquals(3, array.length);
assertEquals(0.0F, array[0], 0);
assertEquals(1.0F, array[1], 0);
assertEquals(2.0f, array[2], 0);
}