/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package dao; import com.tecgraf.dao.FacadeJPA; import negocio.Disciplina; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author 42071020585 */ public class DisciplinaDAOTest { static FacadeJPA facJPA; public DisciplinaDAOTest() { } @BeforeClass public static void setUpClass() throws Exception { // identifica a Unidade de Persistência String persistUnitStr = "ExemploAulaPU"; // inicializa Facade JPA facJPA = FacadeJPA.getInstance(persistUnitStr); } @AfterClass public static void tearDownClass() throws Exception { } @Before public void setUp() { } /** * Teste do método findByName, da classe DisciplinaDAO. */ @Test public void findByNameTest() { Disciplina d = new Disciplina(); DisciplinaDAO dDao = DisciplinaDAO.getInstance(facJPA); // Testa matrícula existente d = dDao.findByName("Algoritimo"); assertNotNull(d); } @After public void tearDown() { } }