{
PkSchemaData.clearTablesInDatabase();
PkSchemaData testData = PkSchemaData.getDefaultTestData();
testData.save();
Nopk toDelete = testData.getNopkList().get(1);
// check that isDeleted() is false before deletion
assertFalse(toDelete.isDeleted());
// check that three entries are in the Nopk table
List<Nopk> nopkList = getNopkList();
assertEquals(3, nopkList.size());
// check toDelete object is in database
// equals does not work without pk so check intcol
assertEquals(2, nopkList.get(1).getIntcol());
// call delete method and check result.
int deleted = NopkPeer.doDelete(toDelete);
assertEquals(1, deleted);
assertTrue(toDelete.isDeleted());
// check that there are two entries remaining in the database
// and the toDelete object was deleted
// (use intcol for latter as equals does not work)
nopkList = getNopkList();