use of es.bsc.compss.types.project.ProjectFile in project compss by bsc-wdc.
the class ProjectFileTest method jclouds_gceXML.
@Test
public void jclouds_gceXML() throws URISyntaxException, JAXBException, SAXException, ProjectFileValidationException, IOException {
// Get XSD Schema path
String xsd_path = new File(SCHEMA_PATH).toURI().getPath();
// Get default resources file
File gceProject = new File(JCLOUDS_GCE_XML_PATH);
// Instantiate ResourcesFile
ProjectFile project = new ProjectFile(gceProject, xsd_path, logger);
// Checkers
assertNotNull(project);
File xml = new File(XML_TMP_PATH);
project.toFile(xml);
boolean compareFile = FileUtils.contentEquals(gceProject, xml);
assertEquals("Dump content not equal", true, compareFile);
}
use of es.bsc.compss.types.project.ProjectFile in project compss by bsc-wdc.
the class ProjectFileTest method servicesXML.
@Test
public void servicesXML() throws URISyntaxException, JAXBException, SAXException, ProjectFileValidationException, IOException {
// Get XSD Schema path
String xsd_path = new File(SCHEMA_PATH).toURI().getPath();
// Get default resources file
File servicesProject = new File(SERVICES_XML_PATH);
// Instantiate ResourcesFile
ProjectFile project = new ProjectFile(servicesProject, xsd_path, logger);
// Checkers
assertNotNull(project);
File xml = new File(XML_TMP_PATH);
project.toFile(xml);
boolean compareFile = FileUtils.contentEquals(servicesProject, xml);
assertEquals("Dump content not equal", true, compareFile);
}
use of es.bsc.compss.types.project.ProjectFile in project compss by bsc-wdc.
the class ProjectFileTest method creation_XMLstring_XSDschema.
@Test
public void creation_XMLstring_XSDschema() throws URISyntaxException, JAXBException, SAXException, ProjectFileValidationException {
// Instantiate XSD Schema
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema xsd = sf.newSchema(new File(SCHEMA_PATH));
// Get default resources file
String defaultProject = buildXMLString();
// Instantiate ResourcesFile
ProjectFile project = new ProjectFile(defaultProject, xsd, logger);
// Checkers
assertNotNull(project);
int numWorkers_byName = project.getComputeNodes_names().size();
assertEquals("Should have a worker", numWorkers_byName, 1);
int numWorkers_byList = project.getComputeNodes_list().size();
assertEquals("Should have a worker", numWorkers_byList, 1);
int numWorkers_byHashMap = project.getComputeNodes_hashMap().size();
assertEquals("Should have a worker", numWorkers_byHashMap, 1);
}
use of es.bsc.compss.types.project.ProjectFile in project compss by bsc-wdc.
the class ProjectFileTest method creation_XMLstring_XSDpath.
@Test
public void creation_XMLstring_XSDpath() throws URISyntaxException, JAXBException, SAXException, ProjectFileValidationException {
// Get XSD Schema path
String xsd_path = new File(SCHEMA_PATH).toURI().getPath();
// Get default resources file
String defaultProject = buildXMLString();
// Instantiate ResourcesFile
ProjectFile project = new ProjectFile(defaultProject, xsd_path, logger);
// Checkers
assertNotNull(project);
int numWorkers_byName = project.getComputeNodes_names().size();
assertEquals("Should have a worker", numWorkers_byName, 1);
int numWorkers_byList = project.getComputeNodes_list().size();
assertEquals("Should have a worker", numWorkers_byList, 1);
int numWorkers_byHashMap = project.getComputeNodes_hashMap().size();
assertEquals("Should have a worker", numWorkers_byHashMap, 1);
}
use of es.bsc.compss.types.project.ProjectFile in project compss by bsc-wdc.
the class ProjectFileTest method creation_XMLfile_XSDschema.
/*
* ***************************************************************
* CONSTRUCTOR TESTS
***************************************************************/
@Test
public void creation_XMLfile_XSDschema() throws URISyntaxException, JAXBException, SAXException, ProjectFileValidationException {
// Instantiate XSD Schema
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema xsd = sf.newSchema(new File(SCHEMA_PATH));
// Get default resources file
File defaultProject = new File(DEFAULT_XML_PATH);
// Instantiate ResourcesFile
ProjectFile project = new ProjectFile(defaultProject, xsd, logger);
// Checkers
assertNotNull(project);
int numWorkers_byName = project.getComputeNodes_names().size();
assertEquals("Should have a worker", numWorkers_byName, 1);
int numWorkers_byList = project.getComputeNodes_list().size();
assertEquals("Should have a worker", numWorkers_byList, 1);
int numWorkers_byHashMap = project.getComputeNodes_hashMap().size();
assertEquals("Should have a worker", numWorkers_byHashMap, 1);
}
Aggregations