use of org.opentosca.toscana.core.transformation.platform.Platform in project TOSCAna by StuPro-TOSCAna.
the class CloudFoundryPlugin method getPlatformDetails.
private static Platform getPlatformDetails() {
String platformId = "cloud-foundry";
String platformName = "CloudFoundry";
Set<PlatformInput> platformProperties = new HashSet<>();
PlatformInput cfUserName = new PlatformInput(CF_PROPERTY_KEY_USERNAME, PropertyType.TEXT, "Username of CloudFoundry provideraccount", true);
PlatformInput cfUserPw = new PlatformInput(CF_PROPERTY_KEY_PASSWORD, PropertyType.SECRET, "Password of CloudFoundry provideraccount", true);
PlatformInput cfEndpoint = new PlatformInput(CF_PROPERTY_KEY_API, PropertyType.TEXT, "The endpoint of the provider", true);
PlatformInput cfSpace = new PlatformInput(CF_PROPERTY_KEY_SPACE, PropertyType.TEXT, "The space of the useraccount which should be used to deploy", true);
PlatformInput cfOrganization = new PlatformInput(CF_PROPERTY_KEY_ORGANIZATION, PropertyType.TEXT, "The organization of the useraccount which should be used to deploy", true);
platformProperties.add(cfUserName);
platformProperties.add(cfUserPw);
platformProperties.add(cfEndpoint);
platformProperties.add(cfSpace);
platformProperties.add(cfOrganization);
return new Platform(platformId, platformName, platformProperties);
}
use of org.opentosca.toscana.core.transformation.platform.Platform in project TOSCAna by StuPro-TOSCAna.
the class TestPlugins method createFakeTransformationsOnDisk.
/**
* In given csarTransformationsDir, creates for every given target platform a fake transformation on disk <p>
* Attention: Best is to use platforms which are supported by a plugin -- use TestPlugins.PLATFORMS
*
* @param csarTransformationsDir the absolute path of {csarid}/transformations
*/
public static void createFakeTransformationsOnDisk(File csarTransformationsDir, Set<Platform> targetPlatforms) {
for (Platform platform : targetPlatforms) {
File transformationDir = new File(csarTransformationsDir, platform.id);
transformationDir.mkdir();
}
}
use of org.opentosca.toscana.core.transformation.platform.Platform in project TOSCAna by StuPro-TOSCAna.
the class TransformationPropertyHandlingTest method setUp.
@Before
public void setUp() throws Exception {
Csar csar = new CsarImpl(new File(""), MOCK_CSAR_NAME, log);
HashSet<PlatformInput> props = new HashSet<>();
for (int i = 0; i < 10; i++) {
props.add(new PlatformInput("prop-" + i, PropertyType.UNSIGNED_INTEGER, "No real Description", // Only mark the first 5 properties as required
i < 5));
}
Platform p = new Platform("test", "Test Platform", props);
transformation = new TransformationImpl(csar, p, log, modelMock());
properties = transformation.getInputs();
}
use of org.opentosca.toscana.core.transformation.platform.Platform in project TOSCAna by StuPro-TOSCAna.
the class TransformationPropertyHandlingTest method checkEmptyProperties.
@Test
public void checkEmptyProperties() throws Exception {
Csar csar = new CsarImpl(new File(""), MOCK_CSAR_NAME, log);
this.transformation = new TransformationImpl(csar, new Platform("test", "test", new HashSet<>()), logMock(), modelMock());
assertEquals(TransformationState.READY, transformation.getState());
assertTrue(transformation.getInputs().isValid());
}
use of org.opentosca.toscana.core.transformation.platform.Platform in project TOSCAna by StuPro-TOSCAna.
the class PropertyInstanceTest method init.
@Before
public void init() {
HashSet<PlatformInput> properties = new HashSet<>();
for (int i = 0; i < 10; i++) {
properties.add(new PlatformInput("p-" + i, PropertyType.INTEGER, "", i < 5));
}
Platform testPlatform = new Platform("test", "test", properties);
transformation = new TransformationImpl(new CsarImpl(new File(""), "test", logMock()), testPlatform, logMock(), modelMock());
this.instance = new PropertyInstance(new HashSet<>(properties), transformation);
}
Aggregations