public void testValidate() throws Exception
{
int nbFiles = FileUtils.listFiles(directory, FileFileFilter.FILE, null)
.size();
Resource resource = new Resource("image3.png", "png", "La image3");
FileInputStream fis = new FileInputStream(image3);
getResourceService().upload(fis, resource);
fis.close();
File file = getResourceService().getFile(resource);
file.delete();
Assert.assertEquals(nbFiles, FileUtils.listFiles(directory,
FileFileFilter.FILE, null).size());
getResourceService().validate();
resource = getResourceService().findByName("image3.png").get(0);
Assert.assertFalse(resource.isValid());
}