@Ignore
@Test
public void testOperateProject() throws Exception {
DeleteAccessor deleteAction=new DeleteAccessor();
URI projecturi=project.eResource().getURI();
Iterator iter=project.eResource().getResourceSet().getResources().iterator();
while ( iter.hasNext() ){
((Resource) iter.next()).save(null);
}
//test cancel delete
deleteAction.runDoDelete(project,false, Window.CANCEL);
ProjectRegistry registry = ProjectPlugin.getPlugin().getProjectRegistry();
assertEquals(1, registry.getProjects().size());
assertTrue( registry.getProjects().contains(project) );
assertNotNull(project.eResource());
assertEquals(project, project.getElementsInternal().get(0).getProject());
Resource resource = project.eResource();
IProjectElement elem = project.getElements().get(0);
// Test remove project but leave files
deleteAction.runDoDelete(project,false, Window.OK);
assertEquals(0, registry.getProjects().size());
assertTrue( new File(projecturi.toFileString()).exists() );
assertFalse(resource.isLoaded());
Project project=registry.getProject(projecturi);
assertEquals(1, project.getElementsInternal().size());
assertNotSame(elem, project.getElements().get(0));
assertEquals(project, project.getElementsInternal().get(0).getProject());
// Test delete from file System
deleteAction.runDoDelete(project,true, Window.OK);
assertEquals(0, registry.getProjects().size());
assertFalse( new File(projecturi.toFileString()).exists() );
}