/** Test of selectByStatus method, of class PublicationDAO. */ @Test public void testSelectByStatus_3args_2() throws Exception { IDatabaseConnection connection = getConnection(); try { Connection con = connection.getConnection(); List<String> componentIds = new ArrayList<String>(); componentIds.add("kmelia200"); componentIds.add("kmelia201"); String status = "Valid"; Collection<PublicationDetail> result = PublicationDAO.selectByStatus(con, componentIds, status); assertEquals(result.size(), 2); status = "Draft"; result = PublicationDAO.selectByStatus(con, componentIds, status); assertEquals(result.size(), 0); status = "Valid"; componentIds.remove("kmelia200"); result = PublicationDAO.selectByStatus(con, componentIds, status); assertEquals(result.size(), 0); } finally { connection.close(); } }
/** Test of selectByStatus method, of class PublicationDAO. */ @Test public void testSelectByStatus_3args_1() throws Exception { IDatabaseConnection connection = getConnection(); try { Connection con = connection.getConnection(); PublicationPK pubPK = new PublicationPK("useless", "kmelia200"); String status = "Valid"; Collection<PublicationDetail> result = PublicationDAO.selectByStatus(con, pubPK, status); assertEquals(result.size(), 2); status = "Draft"; result = PublicationDAO.selectByStatus(con, pubPK, status); assertEquals(result.size(), 0); } finally { connection.close(); } }