CSWISORecordDataQualityParser { public Map<String, String> getDataQualitiesMap (){ return this.dataQualities; } CSWISORecordDataQualityParser(); Map<String, String> getDataQualitiesMap(); CSWIsoRecord.DataQualityObject parseDataQualities(final NodeList dataQualityNodes, final XPathExpression pathToLoc);  }
@Test public void TestDataQualityParsing() { Node metaDataNode = getMetadataNode(); MathTransform transform = getMathTransform(); Locale locale = new Locale("FI"); CSWISORecordParser parser; try { parser = new CSWISORecordParser(); CSWIsoRecord record = parser.parse(metaDataNode, locale, transform); CSWISORecordDataQualityParser dqParser = new CSWISORecordDataQualityParser(); DataQualityObject object = record.getDataQualityObject(); List<DataQuality> nodeList = object.getDataQualities(); assertTrue("There should be 4 nodes", nodeList.size() == 4); for (DataQuality dq : nodeList){ assertTrue("Data quality's nodename should be in dataQualities map", dqParser.getDataQualitiesMap().containsKey(dq.getNodeName())); if ("topologicalConsistency".equals(dq.getNodeName())){ assertEquals("Topological ", "ELF_ADM06", dq.getNameOfMeasure()); assertNotNull(dq.getMeasureDescription()); assertNotNull(dq.getEvaluationMethodDescription()); DataQualityConformanceResult conformance = dq.getConformanceResultList().get(0); assertEquals("ELF Master LoD1", conformance.getSpecification()); assertNotNull(conformance.getExplanation()); assertFalse(conformance.getPass()); DataQualityQuantitativeResult quantitative = dq.getQuantitativeResultList().get(0); assertEquals("Number of errors", quantitative.getValueType()); assertEquals("54", quantitative.getValue().get(0)); quantitative = dq.getQuantitativeResultList().get(1); assertEquals("Percentage of errors", quantitative.getValueType()); assertEquals("7.96460177%", quantitative.getValue().get(0)); } } List <String> lineages = object.getLineageStatements(); assertTrue("There should be only one lineage statement", lineages.size() == 1); assertTrue("FI lineage statement shold contain 1313 chars", (lineages.get(0).length() == 1313)); } catch (Exception e) { e.printStackTrace(); } }