Search in sources :

Example 1 with LogicalFile

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;
}
Also used : GATContext(org.gridlab.gat.GATContext) GATObjectCreationException(org.gridlab.gat.GATObjectCreationException) LogicalFile(org.gridlab.gat.io.LogicalFile) Preferences(org.gridlab.gat.Preferences) URI(org.gridlab.gat.URI)

Aggregations

GATContext (org.gridlab.gat.GATContext)1 GATObjectCreationException (org.gridlab.gat.GATObjectCreationException)1 Preferences (org.gridlab.gat.Preferences)1 URI (org.gridlab.gat.URI)1 LogicalFile (org.gridlab.gat.io.LogicalFile)1