use of org.eclipse.winery.common.version.WineryVersion in project winery by eclipse.
the class BackendUtilsTestWithGitBackedRepository method getVersionsOfOneDefinition.
@Test
public void getVersionsOfOneDefinition() throws Exception {
this.setRevisionTo("origin/plain");
DefinitionsChildId id = new NodeTypeId("http://opentosca.org/nodetypes", "NodeTypeWith5Versions_0.3.4-w3", false);
List<WineryVersion> versions = WineryVersionUtils.getAllVersionsOfOneDefinition(id, repository);
assertEquals(5, versions.size());
}
use of org.eclipse.winery.common.version.WineryVersion in project winery by eclipse.
the class BackendUtilsTestWithGitBackedRepository method getVersionWithNonEditableFlag.
@Test
public void getVersionWithNonEditableFlag() throws Exception {
this.setRevisionTo("origin/plain");
DefinitionsChildId id = new NodeTypeId("http://opentosca.org/nodetypes", "NodeTypeWith5Versions_0.3.4-w3", false);
List<WineryVersion> versions = WineryVersionUtils.getAllVersionsOfOneDefinition(id, repository);
versions.forEach(wineryVersion -> assertFalse(wineryVersion.isEditable()));
}
use of org.eclipse.winery.common.version.WineryVersion in project winery by eclipse.
the class BackendUtilsTestWithGitBackedRepository method detectChangesInANodeTemplate.
@Test
public void detectChangesInANodeTemplate() throws Exception {
this.setRevisionTo("origin/plain");
NodeTypeId newVersion = new NodeTypeId("http://plain.winery.opentosca.org/nodetypes", "NodeTypeWithThreeReqCapPairsCoveringAllReqCapVariants_w1-wip1", false);
WineryVersion oldVersion = new WineryVersion("", 0, 0);
ToscaDiff toscaDiff = BackendUtils.compare(newVersion, oldVersion, repository);
ToscaDiff properties = toscaDiff.getChildrenMap().get("winerysPropertiesDefinition");
assertEquals(VersionState.CHANGED, toscaDiff.getState());
assertEquals(VersionState.ADDED, properties.getState());
}
use of org.eclipse.winery.common.version.WineryVersion in project winery by eclipse.
the class VersionUtilsTest method getVersionWithNoVersionInTheName.
@Test
public void getVersionWithNoVersionInTheName() {
WineryVersion version = VersionUtils.getVersion("myExampleComponent");
assertEquals("", version.toString());
}
use of org.eclipse.winery.common.version.WineryVersion in project winery by eclipse.
the class VersionUtilsTest method getVersion.
private void getVersion(String cVersion, int wVersion, int wipVersion) {
WineryVersion wineryVersion = VersionUtils.getVersion(getComponentName("name", cVersion, wVersion, wipVersion));
assertEquals(cVersion, wineryVersion.getComponentVersion());
assertEquals(wVersion, wineryVersion.getWineryVersion());
assertEquals(wipVersion, wineryVersion.getWorkInProgressVersion());
}
Aggregations