Search in sources :

Example 1 with ProjectCreatedEvent

use of org.eclipse.che.api.project.server.ProjectCreatedEvent in project che by eclipse.

the class BaseTest method createTestProject.

protected FolderEntry createTestProject() throws ServerException, NotFoundException, ConflictException, ForbiddenException {
    String classpath = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<classpath>\n" + "\t<classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER\"/>\n" + "</classpath>";
    FolderEntry parent = projectManager.getProjectsRoot().createFolder("project");
    parent.createFolder("bin");
    parent.createFolder("src");
    FolderEntry codenvyFolder = parent.createFolder(".che");
    FolderEntry libFolder = parent.createFolder("lib");
    libFolder.createFile("a.jar", "text".getBytes());
    codenvyFolder.createFile("classpath", classpath.getBytes());
    projectRegistry.setProjectType(parent.getPath().toString(), PlainJavaProjectConstants.JAVAC_PROJECT_ID, false);
    //inform DeltaProcessingStat about new project
    JavaModelManager.getJavaModelManager().deltaState.resourceChanged(new ResourceChangedEvent(root, new ProjectCreatedEvent("", parent.getPath().toString())));
    return parent;
}
Also used : ProjectCreatedEvent(org.eclipse.che.api.project.server.ProjectCreatedEvent) FolderEntry(org.eclipse.che.api.project.server.FolderEntry) ResourceChangedEvent(org.eclipse.che.jdt.core.resources.ResourceChangedEvent)

Example 2 with ProjectCreatedEvent

use of org.eclipse.che.api.project.server.ProjectCreatedEvent in project che by eclipse.

the class BaseTest method createTestProject.

protected FolderEntry createTestProject(String name, String pomContent) throws ServerException, NotFoundException, ConflictException, ForbiddenException {
    FolderEntry folder = pm.getProjectsRoot().createFolder(name);
    folder.createFile("pom.xml", getPomContent(pomContent).getBytes());
    projectRegistry.setProjectType(folder.getPath().toString(), MAVEN_ID, false);
    //inform DeltaProcessingStat about new project
    JavaModelManager.getJavaModelManager().deltaState.resourceChanged(new ResourceChangedEvent(root, new ProjectCreatedEvent("", folder.getPath().toString())));
    return folder;
}
Also used : ProjectCreatedEvent(org.eclipse.che.api.project.server.ProjectCreatedEvent) FolderEntry(org.eclipse.che.api.project.server.FolderEntry) ResourceChangedEvent(org.eclipse.che.jdt.core.resources.ResourceChangedEvent)

Aggregations

FolderEntry (org.eclipse.che.api.project.server.FolderEntry)2 ProjectCreatedEvent (org.eclipse.che.api.project.server.ProjectCreatedEvent)2 ResourceChangedEvent (org.eclipse.che.jdt.core.resources.ResourceChangedEvent)2