// executeExperiment("src/test/resources/ForEachEchoWorkflow.xwf", Arrays.asList("10,20", "30,40"), Arrays.asList("10,30", "20,40"));
// }
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 ....");
addHostDescriptor(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 ...");
addServiceDescriptor(serviceDescription, "comma_app");
Assert.assertTrue(airavataAPI.getApplicationManager().isServiceDescriptorExists(
serviceDescription.getType().getName()));
addServiceDescriptor(serviceDescription2, "echo_app");
Assert.assertTrue(airavataAPI.getApplicationManager().isServiceDescriptorExists(
serviceDescription2.getType().getName()));
// Deployment descriptor
File executable;
if (OsUtils.isWindows()) {
executable = getFile("src/test/resources/comma_data.bat");
} else {
executable = getFile("src/test/resources/comma_data.sh");
Runtime.getRuntime().exec("chmod +x " + executable.getAbsolutePath());
}
ApplicationDescription applicationDeploymentDescription = descriptorBuilder
.buildApplicationDeploymentDescription("comma_app_localhost", executable.getAbsolutePath(), OsUtils.getTempFolderPath());
ApplicationDescription applicationDeploymentDescription2 = descriptorBuilder
.buildApplicationDeploymentDescription("echo_app_localhost", OsUtils.getEchoExecutable(), OsUtils.getTempFolderPath());
log("Adding deployment description ...");
addApplicationDescriptor(applicationDeploymentDescription, serviceDescription, hostDescription, "comma_app_localhost");