try { persistentSupport.iniciarTransaccao(); teacher = persistentTeacher.readTeacherByNumber(new Integer("1")); persistentSupport.confirmarTransaccao(); } catch(ExcepcaoPersistencia ex) { fail("testDeleteTeacher: readTeacherByNumber existing"); } assertNotNull(teacher);   try { persistentSupport.iniciarTransaccao(); persistentTeacher.delete(teacher); persistentSupport.confirmarTransaccao(); } catch(ExcepcaoPersistencia ex2) { fail("testDeleteTeacher: delete"); }
    public void testDeleteTeacher() {        ITeacher teacher = null;		//read existing                try {            persistentSupport.iniciarTransaccao();            teacher = persistentTeacher.readTeacherByNumber(new Integer("1"));            persistentSupport.confirmarTransaccao();        } catch(ExcepcaoPersistencia ex) {            fail("testDeleteTeacher: readTeacherByNumber existing");        }        assertNotNull(teacher);		//erase it        try {            persistentSupport.iniciarTransaccao();            persistentTeacher.delete(teacher);            persistentSupport.confirmarTransaccao();        } catch(ExcepcaoPersistencia ex2) {            fail("testDeleteTeacher: delete");        }                //read it again		try {			persistentSupport.iniciarTransaccao();			teacher = persistentTeacher.readTeacherByNumber(new Integer("1"));			persistentSupport.confirmarTransaccao();		} catch(ExcepcaoPersistencia ex) {			fail("testDeleteTeacher: readTeacherByNumber unexisting");		}		assertNull(teacher);            }