use of com.cosylab.logging.engine.log.ILogEntry.AdditionalData in project ACS by ACS-Community.
the class ConvertersTest method testXML.
/**
* Test the XML conversion
*
* @throws Exception
*/
public void testXML() throws Exception {
XMLConverter converter = new XMLConverter();
assertNotNull(converter);
String ret = converter.convert(logToConvert);
assertNotNull(ret);
ParserTypes type = ParserTypes.VTD;
ACSLogParser parser = ACSLogParserFactory.getParser(type);
ILogEntry log = parser.parse(ret);
assertNotNull(log);
for (LogField f : LogField.values()) {
Object original = logToConvert.getField(f);
Object converted = log.getField(f);
assertEquals(original, converted);
}
Vector<AdditionalData> originalData = logToConvert.getAdditionalData();
assertNotNull(originalData);
Vector<AdditionalData> convertedData = log.getAdditionalData();
assertNotNull(convertedData);
assertEquals(originalData.size(), convertedData.size());
for (AdditionalData ad : originalData) {
boolean found = false;
String name = ad.name;
String val = ad.value;
for (AdditionalData adConverted : convertedData) {
if (name.equals(adConverted.name)) {
found = true;
assertEquals(val, adConverted.value);
break;
}
}
assertTrue("Additional data not found", found);
}
}
Aggregations