}
@Test
public void testDeleteDirectory() throws Exception {
Repository repository = new VFSRepository(producer.getIoService());
((VFSRepository)repository).setDescriptor(descriptor);
profile.setRepository(repository);
repository.createDirectory("/defaultPackage");
// setup parameters
Map<String, String> params = new HashMap<String, String>();
params.put("profile", "jbpm");
params.put("action", "deletedir");
params.put("assetlocation", "/defaultPackage");
params.put("", "");
boolean directoryExits = repository.directoryExists("/defaultPackage");
assertTrue(directoryExits);
AssetServiceServlet assetServiceServlet = new AssetServiceServlet();
assetServiceServlet.setProfile(profile);
assetServiceServlet.init(new TestServletConfig(new TestServletContext(repository)));
TestHttpServletResponse response = new TestHttpServletResponse();
assetServiceServlet.doPost(new TestHttpServletRequest(params), response);
String jsonResponse = new String(response.getContent());
assertNotNull(jsonResponse);
directoryExits = repository.directoryExists("/defaultPackage");
assertFalse(directoryExits);
}