@Test public void testGetTitle() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); 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> frmDigitaleBestandenElems = getDescendants(oaiDcElem, "frmDigitalebestanden"); Element frmDigitaleBestandenElem = frmDigitaleBestandenElems.get(0); Object obj = ReflectionUtil.call(crsMultiMediaTransformer, "getTitle", new Class[] {Element.class, String.class}, new Object[] {frmDigitaleBestandenElem, "RMNH.INS.867435"}); String title = (String) obj; assertNotNull("01", obj); assertEquals("02", "RMNH.INS.867435", title); } }
private String getTitle(Element frmDigitalebestandenElem, String unitID) { String title = val(frmDigitalebestandenElem, "dc:title"); if (title == null) { title = unitID; if (logger.isDebugEnabled()) { debug("Missing or empty element <dc:title>"); } } return title; }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private String getTitle(Element frmDigitalebestandenElem, String unitID) { String title = val(frmDigitalebestandenElem, "dc:title"); if (title == null) { title = unitID; if (logger.isDebugEnabled()) { debug("Missing or empty element <dc:title>"); } } return title; } }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private String getTitle(Element frmDigitalebestandenElem, String unitID) { String title = val(frmDigitalebestandenElem, "dc:title"); if (title == null) { title = unitID; if (logger.isDebugEnabled()) { debug("Missing or empty element <dc:title>"); } } return title; } CrsMultiMediaTransformer(ETLStatistics stats); }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private String getTitle(Element frmDigitalebestandenElem, String unitID) { String title = val(frmDigitalebestandenElem, "dc:title"); if (title == null) { title = unitID; if (logger.isDebugEnabled()) { debug("Missing or empty element <dc:title>"); } } return title; } CrsMultiMediaTransformer(ETLStatistics stats);  }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private String getTitle(Element frmDigitalebestandenElem, String unitID) { String title = val(frmDigitalebestandenElem, "dc:title"); if (title == null) { title = unitID; if (logger.isDebugEnabled()) { debug("Missing or empty element <dc:title>"); } } return title; } CrsMultiMediaTransformer(ETLStatistics stats);   }