@Test public void testGetBioStratigraphyList() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); List<BioStratigraphy> actualList = null; int listSize = 0; 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); Object returned = CommonReflectionUtil.callMethod(null, null, crsSpecimenTransformer, "getBioStratigraphyList"); actualList = (List<BioStratigraphy>) returned; listSize = actualList.size(); if (listSize > 0) break; } BioStratigraphy expectedBs = new BioStratigraphy(); expectedBs.setYoungBioName("Test Bio Name"); expectedBs.setYoungFossilZone("Test Young Fossil Zone"); expectedBs.setOldBioName("Hiatella arctica Acme Zone"); assertEquals("01",2, listSize); assertEquals("02",expectedBs.getYoungBioName(), actualList.get(0).getYoungBioName()); assertEquals("03",expectedBs.getYoungFossilZone(), actualList.get(0).getYoungFossilZone()); assertEquals("04",expectedBs.getOldBioName(), actualList.get(0).getOldBioName()); }
private List<BioStratigraphy> getBioStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsBioStratigraphy"); if (elems == null) { return null; } List<BioStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { BioStratigraphy one = getBioStratigraphyObject(e); result.add(one); } return result; }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<BioStratigraphy> getBioStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsBioStratigraphy"); if (elems == null) { return null; } List<BioStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { BioStratigraphy one = getBioStratigraphyObject(e); result.add(one); } return result; } }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<BioStratigraphy> getBioStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsBioStratigraphy"); if (elems == null) { return null; } List<BioStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { BioStratigraphy one = getBioStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats); }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<BioStratigraphy> getBioStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsBioStratigraphy"); if (elems == null) { return null; } List<BioStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { BioStratigraphy one = getBioStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats);  }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<BioStratigraphy> getBioStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsBioStratigraphy"); if (elems == null) { return null; } List<BioStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { BioStratigraphy one = getBioStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats);   }