@Test public void testGetTypeStatus() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); SpecimenTypeStatus specimenTypeStatus = null; CrsSpecimenTransformer crsSpecimenTransformer = new CrsSpecimenTransformer(etlStatistics); CrsExtractor extractor = new CrsExtractor(specimenFile, etlStatistics); for (XMLRecordInfo extracted : extractor) { CommonReflectionUtil.setField(AbstractTransformer.class, crsSpecimenTransformer, "objectID", "RMNH.MAM.TT.5"); CommonReflectionUtil.setField(AbstractTransformer.class, crsSpecimenTransformer, "input", extracted); Element elemet = extracted.getRecord(); List<Element> elems = DOMUtil.getDescendants(elemet, "ncrsDetermination"); for (Element element : elems) { Object returned = CommonReflectionUtil.callMethod(element, Element.class, crsSpecimenTransformer, "getTypeStatus"); specimenTypeStatus = (SpecimenTypeStatus) returned; if (specimenTypeStatus != null) break; } } String expectedSpecimenTypeStatus = "paralectotype"; assertEquals(expectedSpecimenTypeStatus, specimenTypeStatus.toString()); }
private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:NomenclaturalTypeText"); if (raw == null) { if (logger.isDebugEnabled()) { debug("Missing type status"); } return null; } try { return tsNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:NomenclaturalTypeText"); if (raw == null) { if (logger.isDebugEnabled()) { debug("Missing type status"); } return null; } try { return tsNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } } }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:NomenclaturalTypeText"); if (raw == null) { if (logger.isDebugEnabled()) { debug("Missing type status"); } return null; } try { return tsNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } } CrsSpecimenTransformer(ETLStatistics stats); }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:NomenclaturalTypeText"); if (raw == null) { if (logger.isDebugEnabled()) { debug("Missing type status"); } return null; } try { return tsNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } } CrsSpecimenTransformer(ETLStatistics stats);  }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:NomenclaturalTypeText"); if (raw == null) { if (logger.isDebugEnabled()) { debug("Missing type status"); } return null; } try { return tsNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } } CrsSpecimenTransformer(ETLStatistics stats);   }