use of org.objectweb.proactive.extensions.vfsprovider.FileSystemServerDeployer in project scheduling by ow2-proactive.
the class TestDataSpaceConfiguration method runStarter.
public Boolean runStarter() throws Exception {
File spFile = new File(IOSPACE);
File spFileWithUserDir = new File(IOSPACE, username);
spFile.mkdirs();
spFileWithUserDir.mkdirs();
spFileWithUserDir.deleteOnExit();
spFile.deleteOnExit();
filesServerIn = new FileSystemServerDeployer("space", IOSPACE, true, true);
String[] spaceurls = filesServerIn.getVFSRootURLs();
String[] userdirUrls = DataSpaceServiceStarter.urlsWithUserDir(spaceurls, username);
ArrayList<String> expected = new ArrayList<>();
expected.addAll(Arrays.asList(spaceurls));
ArrayList<String> expectedWithUserDir = new ArrayList<>();
expectedWithUserDir.addAll(Arrays.asList(userdirUrls));
PASchedulerProperties.DATASPACE_DEFAULTINPUT_URL.updateProperty(DataSpaceServiceStarter.urlsToDSConfigProperty(spaceurls));
PASchedulerProperties.DATASPACE_DEFAULTINPUT_LOCALPATH.updateProperty(IOSPACE);
PASchedulerProperties.DATASPACE_DEFAULTINPUT_HOSTNAME.updateProperty(HOSTNAME);
PASchedulerProperties.DATASPACE_DEFAULTOUTPUT_URL.updateProperty(DataSpaceServiceStarter.urlsToDSConfigProperty(spaceurls));
PASchedulerProperties.DATASPACE_DEFAULTOUTPUT_LOCALPATH.updateProperty(IOSPACE);
PASchedulerProperties.DATASPACE_DEFAULTOUTPUT_HOSTNAME.updateProperty(HOSTNAME);
PASchedulerProperties.DATASPACE_DEFAULTGLOBAL_URL.updateProperty(DataSpaceServiceStarter.urlsToDSConfigProperty(spaceurls));
PASchedulerProperties.DATASPACE_DEFAULTGLOBAL_LOCALPATH.updateProperty(IOSPACE);
PASchedulerProperties.DATASPACE_DEFAULTGLOBAL_HOSTNAME.updateProperty(HOSTNAME);
PASchedulerProperties.DATASPACE_DEFAULTUSER_URL.updateProperty(DataSpaceServiceStarter.urlsToDSConfigProperty(spaceurls));
PASchedulerProperties.DATASPACE_DEFAULTUSER_LOCALPATH.updateProperty(IOSPACE);
PASchedulerProperties.DATASPACE_DEFAULTUSER_HOSTNAME.updateProperty(HOSTNAME);
DataSpaceServiceStarter dsServiceStarter = DataSpaceServiceStarter.getDataSpaceServiceStarter();
dsServiceStarter.startNamingService();
Set<SpaceInstanceInfo> predefinedSpaces = new HashSet<>();
NamingService namingService = dsServiceStarter.getNamingService();
TaskDataSpaceApplication jdsa = new TaskDataSpaceApplication(appid, dsServiceStarter.getNamingService());
jdsa.startDataSpaceApplication(null, null, null, null, username, null);
DataSpacesNodes.configureApplication(PAActiveObject.getNode(), appid, dsServiceStarter.getNamingServiceURL());
DataSpacesFileObject INPUT = PADataSpaces.resolveDefaultInput();
DataSpacesFileObject OUTPUT = PADataSpaces.resolveDefaultOutput();
DataSpacesFileObject GLOBAL = PADataSpaces.resolveOutput(SchedulerConstants.GLOBALSPACE_NAME);
DataSpacesFileObject USER = PADataSpaces.resolveOutput(SchedulerConstants.USERSPACE_NAME);
Assert.assertEquals(expectedWithUserDir, INPUT.getAllRealURIs());
Assert.assertEquals(expectedWithUserDir, OUTPUT.getAllRealURIs());
Assert.assertEquals(expected, GLOBAL.getAllRealURIs());
Assert.assertEquals(expectedWithUserDir, USER.getAllRealURIs());
jdsa.terminateDataSpaceApplication();
return true;
}
Aggregations