@Test
public void testDeleteFilesRecursively() {

	File tmpDir = new File( System.getProperty( "java.io.tmpdir" ), UUID.randomUUID().toString());
	if( ! tmpDir.mkdir())
		Assert.fail( "Could not create a temporary directory." );
	String[] dirs = { "dir1", "dir1/dir2", "dir1/dir2/dir3", "dir1/dir2/dir4", "dir2", "dir1/dir54" };
	for( String dir : dirs ) {
		File f = new File( tmpDir, dir );
		if( ! f.mkdir())
			Assert.fail( "Could not create a sub-directory: " + dir );
	}
	String[] files = { "test.txt", "te.txt", "dir1/test.txt", "dir2/some.txt", "dir1/dir2/dir3/pol.txt" };
	try {
		for( String file : files ) {
			File f = new File( tmpDir, file );
			if( ! f.createNewFile())
				Assert.fail( "Could not create a file: " + file );
		}
	} catch( IOException e ) {
		Assert.fail( "Could not create a file. " + e.getMessage());
	}
	Assert.assertTrue( tmpDir.exists());
	try {
		Utils.deleteFilesRecursively( tmpDir );
		Assert.assertFalse( "Temp directory could not be deleted: " + tmpDir.getName(), tmpDir.exists());
	} catch( IOException e ) {
		Assert.fail( "Failed to delete the temporary directory." );
	}
	try {
		Utils.deleteFilesRecursively((File) null);
	} catch( IOException e ) {
		Assert.fail( "Null file must be supported" );
	}
	try {
		Utils.deleteFilesRecursively((File[]) null);
	} catch( IOException e ) {
		Assert.fail( "Null file array must be supported" );
	}
	try {
		File[] nullFiles = new File[] { null, null };
		Utils.deleteFilesRecursively( nullFiles );
	} catch( IOException e ) {
		Assert.fail( "Array of null files must be supported" );
	}
	try {
		Utils.deleteFilesRecursively( new File( "inexisting-file" ));
	} catch( IOException e ) {
		Assert.fail( "Inexisting files must be supported" );
	}
	Utils.deleteFilesRecursivelyAndQuietly( new File( "another-inexisting-file" ));
}