@Test public void testGetTypeStatus() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); SpecimenTypeStatus specimenTypeStatus = null; CrsMultiMediaTransformer crsMultiMediaTransformer = new CrsMultiMediaTransformer(etlStatistics); CrsExtractor extractor = new CrsExtractor(multimediaFile, etlStatistics); for (XMLRecordInfo extracted : extractor) { CommonReflectionUtil.setField(AbstractTransformer.class, crsMultiMediaTransformer, "objectID", "RMNH.INS.867435"); CommonReflectionUtil.setField(AbstractTransformer.class, crsMultiMediaTransformer, "input", extracted); Element oaiDcElem = getDescendant(extracted.getRecord(), "oai_dc:dc"); List<Element> ncsrDeterminationElems = getDescendants(oaiDcElem, "ncrsDetermination"); for (Element element : ncsrDeterminationElems) { Object obj = ReflectionUtil.call(crsMultiMediaTransformer, "getTypeStatus", new Class[] {Element.class}, new Object[] {element}); specimenTypeStatus = (SpecimenTypeStatus) obj; } } String expectedSpecimenTypeStatus = "ISOTYPE"; assertNotNull("01", specimenTypeStatus); assertEquals("02", expectedSpecimenTypeStatus, specimenTypeStatus.name()); }
private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:TypeStatus"); 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; } }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:TypeStatus"); 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; } } }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:TypeStatus"); 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; } } CrsMultiMediaTransformer(ETLStatistics stats); }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:TypeStatus"); 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; } } CrsMultiMediaTransformer(ETLStatistics stats);  }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private SpecimenTypeStatus getTypeStatus(Element elem) { String raw = val(elem, "abcd:TypeStatus"); 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; } } CrsMultiMediaTransformer(ETLStatistics stats);   }