use of org.eclipse.winery.common.version.WineryVersion in project winery by eclipse.
the class BackendUtilsTestWithGitBackedRepository method getVersionWithEditableFlagFromComponentWithoutAVersion.
@Test
public void getVersionWithEditableFlagFromComponentWithoutAVersion() throws Exception {
this.setRevisionTo("origin/plain");
PolicyTemplateId policyTemplateId = new PolicyTemplateId("http://plain.winery.opentosca.org/policytemplates", "PolicyTemplateWithoutProperties", false);
List<WineryVersion> versions = WineryVersionUtils.getAllVersionsOfOneDefinition(policyTemplateId, repository);
// For convenience, we accept editing already existing components without versions
assertTrue(versions.get(0).isEditable());
}
use of org.eclipse.winery.common.version.WineryVersion in project winery by eclipse.
the class BackendUtilsTestWithGitBackedRepository method detectPropertyChangesInANodeTemplate.
@Test
public void detectPropertyChangesInANodeTemplate() throws Exception {
this.setRevisionTo("origin/plain");
NodeTypeId newVersion = new NodeTypeId("http://plain.winery.opentosca.org/nodetypes", "NodeTypeWithThreeReqCapPairsCoveringAllReqCapVariants_w1-wip2", false);
WineryVersion oldVersion = new WineryVersion("", 1, 1);
ToscaDiff toscaDiff = BackendUtils.compare(newVersion, oldVersion, repository);
ToscaDiff properties = toscaDiff.getChildrenMap().get("winerysPropertiesDefinition").getChildrenMap().get("propertyDefinitions");
assertEquals(VersionState.CHANGED, toscaDiff.getState());
assertEquals(VersionState.CHANGED, properties.getState());
assertEquals(3, properties.getChildren().size());
}
Aggregations