1237123812391240124112421243124412451246
assertFalse(aManager.contains(aCraft)); } @Test(expected=IllegalArgumentException.class) public void testRemoveNonExistingObj() { Spacecraft aCraft = new Spacecraft(); aCraft.setName("Not in the database"); createEntityManager().remove(aCraft); }
1430143114321433143414351436
createEntityManager().remove("not valid"); } @Test(expected=IllegalStateException.class) public void testPersistWhenClosed() { createClosedEntityManager().persist(new Spacecraft()); }
1435143614371438143914401441
createClosedEntityManager().persist(new Spacecraft()); } @Test(expected=IllegalStateException.class) public void testRemoveWhenClosed() { createClosedEntityManager().persist(new Spacecraft()); }