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");
}
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");
}
Aggregations