}
@SuppressWarnings("unchecked") @Test
public void missingColumns_and_completeColumns() throws Exception {
MappedSchemaObject entity = persistenceManager.getEntity(IncompleteEntity.class);
Assert.assertEquals(entity.getAttributeNames().size(), 9);
String ddl = entity.getCreateDDL();
// REMOVE SOME COLUMNS
Pattern pattern = Pattern.compile("^ (int_prim|some_enum1|some_enum3|str) .+$", Pattern.MULTILINE);
Matcher m = pattern.matcher(ddl);
String ddlShort = m.replaceAll("");
System.out.println(ddlShort);
persistenceManager.driverSession().execute(ddlShort);
waitEntityAvailable(entity);
PersistenceSession session = persistenceManager.createSession();
try {
IncompleteEntity inst = new IncompleteEntity();
inst.setId(11);
inst.setIntObj(42);
inst.setIntPrim(43);
inst.setSomeEnum1(SomeEnum.ONE);
inst.setSomeEnum2(SomeEnum.TWO);
inst.setSomeEnum3(SomeEnum.THREE);
inst.setStr("str");
inst.setVal(44);
session.insert(inst);
IncompleteEntity loaded = session.loadOne(IncompleteEntity.class, 11);
Assert.assertNotNull(loaded);
Assert.assertEquals(loaded.getId(), 11);
Assert.assertEquals(loaded.getIntObj(), Integer.valueOf(42));
Assert.assertEquals(loaded.getIntPrim(), 0);
Assert.assertNull(loaded.getSomeEnum1());
Assert.assertSame(loaded.getSomeEnum2(), SomeEnum.TWO);
Assert.assertNull(loaded.getSomeEnum3());
Assert.assertNull(loaded.getSomeEnum4());
Assert.assertNull(loaded.getStr());
Assert.assertEquals(loaded.getVal(), 44);
//
CqlStatementList alterDDL = entity.getAlterDDL(cluster);
System.out.println(alterDDL);
persistenceManager.alterEntitySchemaObject(entity);
waitColumnAvailable(entity.getColumnsByAttributePath("str"));
//
inst = new IncompleteEntity();
inst.setId(11);