int idObiectTest=1;
Date data=new Date();
int nota=8;
int nrPrezente=7;
EntityManager em = emf.createEntityManager();
Catalog c=new Catalog();
Catalog cT=new Catalog();
c.setDataNotei(data);
c.setIdObiect(idObiectTest);
c.setIdStudent(idStudentTest);
c.setNota(nota);
c.setNrPrezente(nrPrezente);
em.getTransaction().begin();
em.persist(c);
em.getTransaction().commit();
cT=(Catalog) em.createQuery("Select c from Catalog c where c.idStudent=1").getSingleResult();
assertTrue(cT.getIdStudent()==c.getIdStudent());
em.getTransaction().begin();
cT.setNota(7);
em.getTransaction().commit();
c=(Catalog) em.createQuery("Select c from Catalog c where c.idStudent=1").getSingleResult();
assertTrue(c.getNota()==7);
em.getTransaction().begin();
int deletedData=em.createQuery("Delete from Catalog c where c.idStudent=1").executeUpdate();