runWorkFlow(workflow, inputs,outputs);
}
private void setupDescriptors() throws AiravataAPIInvocationException,
DescriptorAlreadyExistsException, IOException {
DescriptorBuilder descriptorBuilder = airavataAPI.getDescriptorBuilder();
HostDescription hostDescription = descriptorBuilder.buildHostDescription(HostDescriptionType.type, "localhost2",
"127.0.0.1");
log("Adding host description ....");
airavataAPI.getApplicationManager().addHostDescription(hostDescription);
Assert.assertTrue(airavataAPI.getApplicationManager().isHostDescriptorExists(hostDescription.getType().getHostName()));
List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
inputParameters.add(descriptorBuilder.buildInputParameterType("data1", "data1", DataType.STRING));
inputParameters.add(descriptorBuilder.buildInputParameterType("data2", "data2", DataType.STRING));
List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
outputParameters.add(descriptorBuilder.buildOutputParameterType("out", "out", DataType.STD_OUT));
ServiceDescription serviceDescription = descriptorBuilder.buildServiceDescription("comma_app", "comma_app",
inputParameters, outputParameters);
ServiceDescription serviceDescription2 = descriptorBuilder.buildServiceDescription("echo_app", "echo_app",
inputParameters, outputParameters);
log("Adding service description ...");
airavataAPI.getApplicationManager().addServiceDescription(serviceDescription);
Assert.assertTrue(airavataAPI.getApplicationManager().isServiceDescriptorExists(
serviceDescription.getType().getName()));
airavataAPI.getApplicationManager().addServiceDescription(serviceDescription2);
Assert.assertTrue(airavataAPI.getApplicationManager().isServiceDescriptorExists(
serviceDescription2.getType().getName()));
// Deployment descriptor
File executable = getFile("src/test/resources/comma_data.sh");
Runtime.getRuntime().exec("chmod +x "+executable.getAbsolutePath());
ApplicationDescription applicationDeploymentDescription = descriptorBuilder
.buildApplicationDeploymentDescription("comma_app_localhost", executable.getAbsolutePath(), "/tmp");
ApplicationDescription applicationDeploymentDescription2 = descriptorBuilder
.buildApplicationDeploymentDescription("echo_app_localhost", "/bin/echo", "/tmp");
log("Adding deployment description ...");
airavataAPI.getApplicationManager().addApplicationDescription(serviceDescription, hostDescription,
applicationDeploymentDescription);