}
@Test
public void testOrarRelation(){
String numeGrupaTest = "GrupaTest";
Grupa g = new Grupa();
Orar o = new Orar();
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
o=initTest2();
g.setNumeGrupa(numeGrupaTest);
em.persist(g);
o.setIdGrupa(g.getIdGrupa());
g.getOrar().add(o);
em.persist(g);
em.getTransaction().commit();
Query q = em.createQuery("select grT from Grupa grT ");
Grupa grT1=new Grupa();
grT1=(Grupa) q.getSingleResult();
assertTrue("Nu a fost introdus in grupa","GrupaTest".equals(grT1.getNumeGrupa()));
q = em.createQuery("select oT from Orar oT where oT.intervalOrar='12-14' ");
Orar oT = new Orar();
oT=(Orar) q.getSingleResult();
assertTrue("Nu a fost introdus in orar","12-14".equals(oT.getIntervalOrar()));
em.close();
}