columnDao.delete(column);
}
@Test
public void testTwo() {
Column column1, column2;
List<Column> columns;
column1 = columnDao.insert("column1");
verifyPersistedColumn(column1, "column1");
column2 = columnDao.insert("column2", column1);
verifyPersistedColumn(column2, "column2");
column1 = columnDao.selectOne(column1.getId());
verifyPersistedColumn(column1, "column1");
column2 = columnDao.selectOne(column2.getId());
verifyPersistedColumn(column2, "column2");
columns = columnDao.selectAll();
assertEquals(2, columns.size());
column1 = columns.get(0);
column2 = columns.get(1);
verifyPersistedColumn(column1, "column1");
verifyPersistedColumn(column2, "column2");
assertNull(column1.getParent());
assertEquals(1, column1.getChildren().size());
assertEquals(column2, column1.getChildren().get(0));
assertEquals(column1, column2.getParent());
assertEquals(0, column2.getChildren().size());
columnDao.delete(column1);