@Test public void testGetSex() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); Sex sex = 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); Object returned = CommonReflectionUtil.callMethod(null, null, crsSpecimenTransformer, "getSex"); sex = (Sex) returned; if (sex != null) break; } String expectedStage = "male"; assertEquals(expectedStage, sex.toString()); }
private Sex getSex() { String raw = val(input.getRecord(), "abcd:Sex"); try { return sexNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private Sex getSex() { String raw = val(input.getRecord(), "abcd:Sex"); try { return sexNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } } }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private Sex getSex() { String raw = val(input.getRecord(), "abcd:Sex"); try { return sexNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } } CrsSpecimenTransformer(ETLStatistics stats); }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private Sex getSex() { String raw = val(input.getRecord(), "abcd:Sex"); try { return sexNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } } CrsSpecimenTransformer(ETLStatistics stats);  }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private Sex getSex() { String raw = val(input.getRecord(), "abcd:Sex"); try { return sexNormalizer.map(raw); } catch (UnmappedValueException e) { if (logger.isDebugEnabled()) { debug(e.getMessage()); } return null; } } CrsSpecimenTransformer(ETLStatistics stats);   }