use of org.gridlab.gat.io.LogicalFile in project compss by bsc-wdc.
the class LogicalFileAdaptorTest method test.
public AdaptorTestResult test(String adaptor, String[] hosts) throws URISyntaxException {
if (hosts.length != 4) {
System.out.println("please provide 4 hosts (comma separated, no spaces)");
System.exit(1);
}
AdaptorTestResult adaptorTestResult = new AdaptorTestResult(adaptor, hosts[0]);
GATContext gatContext = new GATContext();
Preferences preferences = new Preferences();
preferences.put("logicalfile.adaptor.name", adaptor);
LogicalFile logicalFile = null;
try {
logicalFile = GAT.createLogicalFile(gatContext, preferences, "test-logical-file", LogicalFile.CREATE);
} catch (GATObjectCreationException e) {
e.printStackTrace();
GAT.end();
System.exit(1);
}
adaptorTestResult.put("replicate [0]", replicateTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[0] + "/JavaGAT-test-logical-file"), false));
adaptorTestResult.put("add [0]", addTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[0] + "/JavaGAT-test-logical-file"), true));
adaptorTestResult.put("add false [1]", addTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[1] + "/JavaGAT-test-logical-file"), false));
adaptorTestResult.put("replicate [1]", replicateTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[1] + "/JavaGAT-test-logical-file"), true));
adaptorTestResult.put("remove [1]", removeTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[1] + "/JavaGAT-test-logical-file"), true));
adaptorTestResult.put("add true [1]", addTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[1] + "/JavaGAT-test-logical-file"), true));
adaptorTestResult.put("replicate2[1]", replicateTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[1] + "/JavaGAT-test-logical-file"), false));
adaptorTestResult.put("replicate [2]", replicateTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[2] + "/JavaGAT-test-logical-file"), true));
adaptorTestResult.put("closest [3]", closestTest(gatContext, preferences, logicalFile, new URI("any://" + hosts[3] + "/JavaGAT-test-logical-file"), true));
return adaptorTestResult;
}
Aggregations