protected void setUp() { try { // Preparamos la base de datos super.setUp(); // Creamos un administrador de prueba DBConnectionManager.clear(); DBConnectionManager.addConnection(new DBConnection()); address = new Address("street", "city", "country", "zip", "address"); company = new Company("456as", "company", "information", address); employee = new Employee("12345678L", "emp1", "emp1", "User1", "emp1", "", "", 2, company); chief = new ChiefProject("65413987L", "emp2", "emp2", "User", "chief", "", "", 12, company); project = new Project("project", "desc1", new Date(), new Date(), 203.36, 458, "bank", "java", 557); pro = new Proposal("pro", "desc", new Date(), Categories.Analysis); topic = new Topic("pro", "desc", new Date()); not = new Notification(topic, "Unread", project, "subject", new HashSet<User>()); DBConnectionManager.initTransaction(); DBConnectionManager.insert(address); DBConnectionManager.insert(company); DBConnectionManager.insert(chief); DBConnectionManager.insert(employee); DBConnectionManager.insert(project); topic.setUser(chief); topic.setProject(project); DBConnectionManager.insert(topic); pro.setUser(chief); DAOProposal.insert(pro, topic.getId()); chiefClient = new DummyClient(); } catch (Exception e) { fail(e.toString()); } }
protected void tearDown() { try { // Cerramos la base de datos super.tearDown(); } catch (Exception e) { fail(e.toString()); } }