Search in sources :

Example 1 with Project

use of org.eclipse.che.api.core.model.workspace.devfile.Project in project devspaces-images by redhat-developer.

the class ProjectConverterTest method testConvertingProjectConfigToDevfileProject.

@Test
public void testConvertingProjectConfigToDevfileProject() {
    ProjectConfigImpl workspaceProject = new ProjectConfigImpl();
    workspaceProject.setName("myProject");
    workspaceProject.setPath("/clone/path");
    SourceStorageImpl sourceStorage = new SourceStorageImpl();
    sourceStorage.setType("git");
    sourceStorage.setLocation("https://github.com/eclipse/che.git");
    sourceStorage.setParameters(ImmutableMap.of(TAG_PARAMETER_NAME, "v1.0", BRANCH_PARAMETER_NAME, "develop"));
    workspaceProject.setSource(sourceStorage);
    Project devfileProject = projectConverter.toDevfileProject(workspaceProject);
    assertEquals(devfileProject.getName(), "myProject");
    Source source = devfileProject.getSource();
    assertEquals(source.getType(), "git");
    assertEquals(source.getLocation(), "https://github.com/eclipse/che.git");
    assertEquals(source.getBranch(), "develop");
    assertEquals(source.getTag(), "v1.0");
    assertEquals(devfileProject.getClonePath(), "clone/path");
}
Also used : SourceStorageImpl(org.eclipse.che.api.workspace.server.model.impl.SourceStorageImpl) Project(org.eclipse.che.api.core.model.workspace.devfile.Project) ProjectConfigImpl(org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl) Source(org.eclipse.che.api.core.model.workspace.devfile.Source) Test(org.testng.annotations.Test)

Example 2 with Project

use of org.eclipse.che.api.core.model.workspace.devfile.Project in project che-server by eclipse-che.

the class ProjectConverterTest method testConvertingProjectConfigToDevfileProject.

@Test
public void testConvertingProjectConfigToDevfileProject() {
    ProjectConfigImpl workspaceProject = new ProjectConfigImpl();
    workspaceProject.setName("myProject");
    workspaceProject.setPath("/clone/path");
    SourceStorageImpl sourceStorage = new SourceStorageImpl();
    sourceStorage.setType("git");
    sourceStorage.setLocation("https://github.com/eclipse/che.git");
    sourceStorage.setParameters(ImmutableMap.of(TAG_PARAMETER_NAME, "v1.0", BRANCH_PARAMETER_NAME, "develop"));
    workspaceProject.setSource(sourceStorage);
    Project devfileProject = projectConverter.toDevfileProject(workspaceProject);
    assertEquals(devfileProject.getName(), "myProject");
    Source source = devfileProject.getSource();
    assertEquals(source.getType(), "git");
    assertEquals(source.getLocation(), "https://github.com/eclipse/che.git");
    assertEquals(source.getBranch(), "develop");
    assertEquals(source.getTag(), "v1.0");
    assertEquals(devfileProject.getClonePath(), "clone/path");
}
Also used : SourceStorageImpl(org.eclipse.che.api.workspace.server.model.impl.SourceStorageImpl) Project(org.eclipse.che.api.core.model.workspace.devfile.Project) ProjectConfigImpl(org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl) Source(org.eclipse.che.api.core.model.workspace.devfile.Source) Test(org.testng.annotations.Test)

Aggregations

Project (org.eclipse.che.api.core.model.workspace.devfile.Project)2 Source (org.eclipse.che.api.core.model.workspace.devfile.Source)2 ProjectConfigImpl (org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl)2 SourceStorageImpl (org.eclipse.che.api.workspace.server.model.impl.SourceStorageImpl)2 Test (org.testng.annotations.Test)2