@Test public void testGetVernacularNames() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); List<VernacularName> vernacularNames = 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, "getVernacularNames", new Class[] {Element.class}, new Object[] {element}); vernacularNames = (List<VernacularName>) obj; } } String expectedVernecularName = "TestVernacularName"; assertNotNull("01", vernacularNames); assertEquals("02", 1, vernacularNames.size()); assertEquals("03", expectedVernecularName, vernacularNames.get(0).getName()); }
private List<VernacularName> getVernacularNames(Element ncrsDeterminationElem) { String s = val(ncrsDeterminationElem, "dwc:vernacularName"); if (s != null) { return Arrays.asList(new VernacularName(s)); } return null; }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private List<VernacularName> getVernacularNames(Element ncrsDeterminationElem) { String s = val(ncrsDeterminationElem, "dwc:vernacularName"); if (s != null) { return Arrays.asList(new VernacularName(s)); } return null; } }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private List<VernacularName> getVernacularNames(Element ncrsDeterminationElem) { String s = val(ncrsDeterminationElem, "dwc:vernacularName"); if (s != null) { return Arrays.asList(new VernacularName(s)); } return null; } CrsMultiMediaTransformer(ETLStatistics stats); }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private List<VernacularName> getVernacularNames(Element ncrsDeterminationElem) { String s = val(ncrsDeterminationElem, "dwc:vernacularName"); if (s != null) { return Arrays.asList(new VernacularName(s)); } return null; } CrsMultiMediaTransformer(ETLStatistics stats);  }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private List<VernacularName> getVernacularNames(Element ncrsDeterminationElem) { String s = val(ncrsDeterminationElem, "dwc:vernacularName"); if (s != null) { return Arrays.asList(new VernacularName(s)); } return null; } CrsMultiMediaTransformer(ETLStatistics stats);   }