public void testDataTypesNotNull() {
char[] c = new char[501];
Arrays.fill(c, 'x');
DataTypes dataTypes = new DataTypes();
dataTypes.typeByte = 1;
dataTypes.typeShort = 2;
dataTypes.typeInt = 3;
dataTypes.typeLong = 4;
dataTypes.typeFloat = 5;
dataTypes.typeDouble = 6;
dataTypes.typeDate = new Date();
dataTypes.typeString = "hello";
dataTypes.typeLargeString = new String(c);
dataTypes.typeJson = map().put("foo", "bar");
dataTypes.addresses = new ArrayList<Address>();
dataTypes.addresses.add(new Address("Castellana", "Madrid"));
dataTypes.addresses.add(new Address("Diagonal", "Barcelona"));
dataTypes.contacts = new HashMap<String, Contact>();
dataTypes.contacts.put("id1", new Contact("Somebody", Arrays.asList("foo", "bar")));
dataTypes.shortShort = Short.MAX_VALUE;
dataTypes.intInt = Integer.MAX_VALUE;
dataTypes.longLong = Long.MAX_VALUE;
dataTypes.boolBool = Boolean.TRUE;
// Blob
dataTypes.typeBlob = new byte[] {
(byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
(byte)0x10, (byte)0X11, (byte)0xF0, (byte)0xF1,
(byte)0xF9, (byte)0xFF };
dataTypes.typeEnum = EnumLong.ALPHA;
pm.insert(dataTypes);
// to test that fields are read back correctly
pm.createQuery(DataTypes.class).filter("id", dataTypes.id).get();
DataTypes same = pm.createQuery(DataTypes.class).get();
assertEqualsDataTypes(dataTypes, same);
}