Search in sources :

Example 6 with FileSystemServerDeployer

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;
}
Also used : FileSystemServerDeployer(org.objectweb.proactive.extensions.vfsprovider.FileSystemServerDeployer) DataSpaceServiceStarter(org.ow2.proactive.scheduler.core.DataSpaceServiceStarter) SpaceInstanceInfo(org.objectweb.proactive.extensions.dataspaces.core.SpaceInstanceInfo) DataSpacesFileObject(org.objectweb.proactive.extensions.dataspaces.api.DataSpacesFileObject) ArrayList(java.util.ArrayList) TaskDataSpaceApplication(org.ow2.proactive.scheduler.job.TaskDataSpaceApplication) NamingService(org.objectweb.proactive.extensions.dataspaces.core.naming.NamingService) File(java.io.File) HashSet(java.util.HashSet)

Aggregations

FileSystemServerDeployer (org.objectweb.proactive.extensions.vfsprovider.FileSystemServerDeployer)6 File (java.io.File)5 HashSet (java.util.HashSet)2 SpaceInstanceInfo (org.objectweb.proactive.extensions.dataspaces.core.SpaceInstanceInfo)2 SchedulerTHelper (functionaltests.utils.SchedulerTHelper)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 BeforeClass (org.junit.BeforeClass)1 ProActiveException (org.objectweb.proactive.core.ProActiveException)1 DataSpacesFileObject (org.objectweb.proactive.extensions.dataspaces.api.DataSpacesFileObject)1 BaseScratchSpaceConfiguration (org.objectweb.proactive.extensions.dataspaces.core.BaseScratchSpaceConfiguration)1 NamingService (org.objectweb.proactive.extensions.dataspaces.core.naming.NamingService)1 NamingServiceDeployer (org.objectweb.proactive.extensions.dataspaces.core.naming.NamingServiceDeployer)1 FileSystemException (org.objectweb.proactive.extensions.dataspaces.exceptions.FileSystemException)1 SpaceAlreadyRegisteredException (org.objectweb.proactive.extensions.dataspaces.exceptions.SpaceAlreadyRegisteredException)1 FileSelector (org.objectweb.proactive.extensions.dataspaces.vfs.selector.FileSelector)1 JobId (org.ow2.proactive.scheduler.common.job.JobId)1