use of es.bsc.compss.types.resources.ResourcesFile in project compss by bsc-wdc.
the class ResourcesFileTest method creation_XMLstring_XSDpath.
@Test
public void creation_XMLstring_XSDpath() throws URISyntaxException, JAXBException, SAXException, ResourcesFileValidationException {
// Get XSD Schema path
String xsd_path = new File(SCHEMA_PATH).toURI().getPath();
// Get default resources file
String defaultResources = buildXMLString();
// Instantiate ResourcesFile
ResourcesFile resources = new ResourcesFile(defaultResources, xsd_path, LOGGER);
// Checkers
assertNotNull(resources);
int numWorkers_byName = resources.getComputeNodes_names().size();
assertEquals("Should have a worker", numWorkers_byName, 1);
int numWorkers_byList = resources.getComputeNodes_list().size();
assertEquals("Should have a worker", numWorkers_byList, 1);
int numWorkers_byHashMap = resources.getComputeNodes_hashMap().size();
assertEquals("Should have a worker", numWorkers_byHashMap, 1);
}
use of es.bsc.compss.types.resources.ResourcesFile in project compss by bsc-wdc.
the class ResourcesFileTest method XMLtoFile.
/*
* ***************************************************************
* Dumpers checkers
***************************************************************/
@Test
public void XMLtoFile() throws URISyntaxException, SAXException, JAXBException, ResourcesFileValidationException, IOException {
// Get XSD Schema path
String xsd_path = new File(SCHEMA_PATH).toURI().getPath();
// Get default resources file
File defaultResources = new File(DEFAULT_XML_PATH);
// Instantiate ResourcesFile
ResourcesFile resources = new ResourcesFile(defaultResources, xsd_path, LOGGER);
// Checkers
assertNotNull(resources);
File xml = new File(XML_TMP_PATH);
resources.toFile(xml);
boolean compareFile = FileUtils.contentEquals(defaultResources, xml);
assertEquals("Dump content not equal", true, compareFile);
}
use of es.bsc.compss.types.resources.ResourcesFile in project compss by bsc-wdc.
the class ResourcesFileTest method gridXML.
@Test
public void gridXML() throws URISyntaxException, JAXBException, SAXException, ResourcesFileValidationException, IOException {
// Get XSD Schema path
String xsd_path = new File(SCHEMA_PATH).toURI().getPath();
// Get default resources file
File gridResources = new File(GRID_XML_PATH);
// Instantiate ResourcesFile
ResourcesFile resources = new ResourcesFile(gridResources, xsd_path, LOGGER);
// Checkers
assertNotNull(resources);
File xml = new File(XML_TMP_PATH);
resources.toFile(xml);
boolean compareFile = FileUtils.contentEquals(gridResources, xml);
assertEquals("Dump content not equal", true, compareFile);
}
use of es.bsc.compss.types.resources.ResourcesFile in project compss by bsc-wdc.
the class ResourcesFileTest method creation_XMLfile_XSDpath.
@Test
public void creation_XMLfile_XSDpath() throws URISyntaxException, JAXBException, SAXException, ResourcesFileValidationException {
// Get XSD Schema path
String xsd_path = new File(SCHEMA_PATH).toURI().getPath();
// Get default resources file
File defaultResources = new File(DEFAULT_XML_PATH);
// Instantiate ResourcesFile
ResourcesFile resources = new ResourcesFile(defaultResources, xsd_path, LOGGER);
// Checkers
assertNotNull(resources);
int numWorkers_byName = resources.getComputeNodes_names().size();
assertEquals("Should have a worker", numWorkers_byName, 1);
int numWorkers_byList = resources.getComputeNodes_list().size();
assertEquals("Should have a worker", numWorkers_byList, 1);
int numWorkers_byHashMap = resources.getComputeNodes_hashMap().size();
assertEquals("Should have a worker", numWorkers_byHashMap, 1);
}
use of es.bsc.compss.types.resources.ResourcesFile in project compss by bsc-wdc.
the class ResourcesFileTest method fullXML.
/*
* ***************************************************************
* Different types of XML checkers
***************************************************************/
@Test
public void fullXML() throws URISyntaxException, JAXBException, SAXException, ResourcesFileValidationException, IOException {
// Get XSD Schema path
String xsd_path = new File(SCHEMA_PATH).toURI().getPath();
// Get default resources file
File fullResources = new File(FULL_XML_PATH);
// Instantiate ResourcesFile
ResourcesFile resources = new ResourcesFile(fullResources, xsd_path, LOGGER);
// Checkers
assertNotNull(resources);
File xml = new File(XML_TMP_PATH);
resources.toFile(xml);
boolean compareFile = FileUtils.contentEquals(fullResources, xml);
assertEquals("Dump content not equal", true, compareFile);
}
Aggregations