3233343536373839404142
@Test public void addElement() { dao.add(new Media()); Collection<Media>medias = dao.findAll(); Assert.assertNotNull(medias); Assert.assertEquals(1,medias.size());
4344454647484950515253
} @Test public void removeElement() { dao.add(new Media("Autant en emporte le vent")); Collection<Media>medias = dao.findAll(); Assert.assertEquals(1,medias.size()); dao.removeByName("Autant en emporte le vent");
2021222324252627282930
@Override public void init() throws ServletException { dao = new MediaDao(); dao.add(new Media("Fight Club")); dao.add(new Media("Blade Runner")); dao.add(new Media("Dark City")); super.init(); }