public void testPropertiesMappingsAbsolute() throws Exception {
String mappingFileNameRelativeProperties = "AppSchemaFileDataTest.xml";
String configFilePathRelativeProperties = getTestDirPath(mappingFileNameRelativeProperties);
String mappingFileNameAbsoluteProperties = "AppSchemaFileDataTestAbsolute.xml";
String configFilePathAbsoluteProperties = getTestDirPath(mappingFileNameAbsoluteProperties);
AppSchemaDataAccess dSAbsolute = null;
try {
// now let's test a mapping file with an absolute path to the properties file
// because we don't know the absolute path in advance, we must create the mapping file
copyRelativeToAbsolute(configFilePathRelativeProperties,
configFilePathAbsoluteProperties);
// create the DataAccess based on properties file configured with a absolute path
dSAbsolute = buildDataAccess(mappingFileNameAbsoluteProperties);
// there should be a single target feature in this data access
assertEquals(1, dSAbsolute.getNames().size());
// there should be 2 features in this data access
assertEquals(2, countFeatures(dSAbsolute));
} finally {
if (dSAbsolute != null) {
dSAbsolute.dispose();
}
}
}