use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.
the class DeploymentPropertyTest method check.
@Test
public void check() {
try {
File input = new File(this.tmpdir, "in");
File output = new File(this.tmpdir, "out");
PropertyInstance instance = new PropertyInstance(new HashSet<>(platform.properties), mock(Transformation.class));
if (this.input != null) {
instance.set(Platform.DEPLOY_AFTER_TRANSFORMATION_KEY, this.input);
}
Csar csar = new CsarImpl(input, "csarId", logMock());
Transformation t = new TransformationImpl(csar, platform, logMock(), mock(EffectiveModel.class));
Transformation transformation = spy(t);
when(transformation.getInputs()).thenReturn(instance);
TransformationContext context = new TransformationContext(transformation, output);
Assert.assertEquals(expected, context.performDeployment());
} catch (Exception e) {
e.printStackTrace(System.out);
if (expectedException == null || !expectedException.isInstance(e)) {
fail();
}
}
}
use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.
the class CloudFormationLampIT method getInputs.
@Override
protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
PropertyInstance props = new PropertyInstance(new HashSet<>(plugin.getPlatform().properties), mock(Transformation.class));
props.set(AWS_ACCESS_KEY_ID_KEY, accessKey);
props.set(AWS_SECRET_KEY_KEY, secretKey);
props.set(AWS_KEYPAIR_KEY, "true");
return props;
}
use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.
the class CloudFoundryJavaIT method getInputs.
@Override
protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
PropertyInstance props = super.getInputs(model);
props.set("database_name", "name");
props.set("database_user", "user");
props.set("database_port", "3333");
props.set("database_password", "secrets");
props.set(CF_PROPERTY_KEY_USERNAME, envUser);
props.set(CF_PROPERTY_KEY_PASSWORD, envPw);
props.set(CF_PROPERTY_KEY_API, envHost);
props.set(CF_PROPERTY_KEY_ORGANIZATION, envOrga);
props.set(CF_PROPERTY_KEY_SPACE, envSpace);
return props;
}
use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.
the class CloudFoundryLampIT method getInputs.
protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
Set<InputProperty> prop = new HashSet<>(plugin.getPlatform().properties);
prop.addAll(model.getInputs().values());
PropertyInstance props = new PropertyInstance(prop, mock(Transformation.class));
props.set(CF_PROPERTY_KEY_USERNAME, envUser);
props.set(CF_PROPERTY_KEY_PASSWORD, envPw);
props.set(CF_PROPERTY_KEY_API, envHost);
props.set(CF_PROPERTY_KEY_ORGANIZATION, envOrga);
props.set(CF_PROPERTY_KEY_SPACE, envSpace);
return props;
}
use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.
the class KubernetesLampIT method getInputs.
@Override
protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
Set<InputProperty> prop = new HashSet<>(plugin.getPlatform().properties);
prop.addAll(model.getInputs().values());
PropertyInstance instance = new PropertyInstance(prop, mock(Transformation.class));
if (System.getenv("DH_USERNAME") != null) {
// This Transformation is performed by pushing to a registry
instance.set(DOCKER_PUSH_TO_REGISTRY_PROPERTY_KEY, "true");
instance.set(DOCKER_REGISTRY_USERNAME_PROPERTY_KEY, System.getenv("DH_USERNAME"));
instance.set(DOCKER_REGISTRY_PASSWORD_PROPERTY_KEY, System.getenv("DH_PASSWORD"));
instance.set(DOCKER_REGISTRY_URL_PROPERTY_KEY, System.getenv("DH_URL"));
instance.set(DOCKER_REGISTRY_REPOSITORY_PROPERTY_KEY, System.getenv("DH_REPOSITORY"));
} else {
// This Transformation is performed by storing the files in Tar archives
instance.set(DOCKER_PUSH_TO_REGISTRY_PROPERTY_KEY, "false");
}
return instance;
}
Aggregations