@Test public void testGetIdentification() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); CSVRecordInfo<BrahmsCsvField> record = mock(CSVRecordInfo.class); when(record.get(BrahmsCsvField.SPECIES)).thenReturn("Rhododendron ferrugineum L."); when(record.get(BrahmsCsvField.AUTHOR2)).thenReturn("L."); when(record.get(BrahmsCsvField.GENUS)).thenReturn("Rhododendron"); when(record.get(BrahmsCsvField.SP1)).thenReturn("ferrugineum"); when(record.get(BrahmsCsvField.RANK2)).thenReturn("testInfraSpecifc"); when(record.get(BrahmsCsvField.SP2)).thenReturn(""); when(record.get(BrahmsCsvField.BARCODE)).thenReturn("L.3355550"); when(record.get(BrahmsCsvField.NOTONLINE)).thenReturn(""); when(record.get(BrahmsCsvField.PLANTDESC)).thenReturn("TestDesc"); when(record.get(BrahmsCsvField.CATEGORY)).thenReturn("L"); when(record.get(BrahmsCsvField.COLLECTOR, false)).thenReturn("Unknown "); when(record.get(BrahmsCsvField.PREFIX, false)).thenReturn(" "); when(record.get(BrahmsCsvField.NUMBER, false)).thenReturn("s.n. "); when(record.get(BrahmsCsvField.SUFFIX, false)).thenReturn(" "); when(record.get(BrahmsCsvField.TYPE)).thenReturn(""); when(record.get(BrahmsCsvField.DETBY)).thenReturn(""); when(record.get(BrahmsCsvField.VERNACULAR)).thenReturn(""); when(record.get(BrahmsCsvField.YEARIDENT)).thenReturn(" 0.000000"); when(record.get(BrahmsCsvField.MONTHIDENT)).thenReturn(" 0.000000"); when(record.get(BrahmsCsvField.DAYIDENT)).thenReturn(" 0.000000"); when(record.get(BrahmsCsvField.IMAGELIST)).thenReturn("http: when(record.get(BrahmsCsvField.CONTINENT)).thenReturn("Europe"); when(record.get(BrahmsCsvField.COUNTRY)).thenReturn("Netherlands"); when(record.get(BrahmsCsvField.MAJORAREA)).thenReturn(""); when(record.get(BrahmsCsvField.LOCNOTES)).thenReturn("Io een rotsachtige rij vochtige berghelling bij het Kolmhans."); when(record.get(BrahmsCsvField.YEAR)).thenReturn(" 0.000000"); when(record.get(BrahmsCsvField.MONTH)).thenReturn(" 8.000000"); when(record.get(BrahmsCsvField.DAY)).thenReturn(" 3.000000"); when(record.get(BrahmsCsvField.LATITUDE)).thenReturn(" 0.000000"); when(record.get(BrahmsCsvField.LONGITUDE)).thenReturn(" 0.000000"); when(record.get(BrahmsCsvField.BRAHMS)).thenReturn("1993139.000000"); BrahmsMultiMediaTransformer brahmsMultiMediaTransformer = new BrahmsMultiMediaTransformer(etlStatistics); CommonReflectionUtil.setField(AbstractTransformer.class, brahmsMultiMediaTransformer, "objectID", "L.3355550"); CommonReflectionUtil.setField(AbstractTransformer.class, brahmsMultiMediaTransformer, "input", record); String expectedScientificNameGroup = "rhododendron ferrugineum "; String expectedTaxonGroup = "L."; Object obj = CommonReflectionUtil.callMethod(null, CSVRecordInfo.class, brahmsMultiMediaTransformer, "getIdentification"); MultiMediaContentIdentification contentIdentification = (MultiMediaContentIdentification) obj; assertNotNull("01", contentIdentification); assertEquals("02", expectedScientificNameGroup, contentIdentification.getScientificName().getScientificNameGroup()); assertEquals("03", expectedTaxonGroup, contentIdentification.getScientificName().getAuthorshipVerbatim()); }
private MultiMediaContentIdentification getIdentification() { MultiMediaContentIdentification identification = new MultiMediaContentIdentification(); identification.setTypeStatus(getTypeStatus()); String s = input.get(VERNACULAR); if (s != null) { identification.setVernacularNames(Arrays.asList(new VernacularName(s))); } String y = input.get(YEARIDENT); String m = input.get(MONTHIDENT); String d = input.get(DAYIDENT); identification.setDateIdentified(getDate(y, m, d)); ScientificName sn = getScientificName(input); DefaultClassification dc = getDefaultClassification(input, sn); identification.setScientificName(sn); identification.setDefaultClassification(dc); return identification; }
BrahmsMultiMediaTransformer extends BrahmsTransformer<MultiMediaObject> { private MultiMediaContentIdentification getIdentification() { MultiMediaContentIdentification identification = new MultiMediaContentIdentification(); identification.setTypeStatus(getTypeStatus()); String s = input.get(VERNACULAR); if (s != null) { identification.setVernacularNames(Arrays.asList(new VernacularName(s))); } String y = input.get(YEARIDENT); String m = input.get(MONTHIDENT); String d = input.get(DAYIDENT); identification.setDateIdentified(getDate(y, m, d)); ScientificName sn = getScientificName(input); DefaultClassification dc = getDefaultClassification(input, sn); identification.setScientificName(sn); identification.setDefaultClassification(dc); return identification; } }
BrahmsMultiMediaTransformer extends BrahmsTransformer<MultiMediaObject> { private MultiMediaContentIdentification getIdentification() { MultiMediaContentIdentification identification = new MultiMediaContentIdentification(); identification.setTypeStatus(getTypeStatus()); String s = input.get(VERNACULAR); if (s != null) { identification.setVernacularNames(Arrays.asList(new VernacularName(s))); } String y = input.get(YEARIDENT); String m = input.get(MONTHIDENT); String d = input.get(DAYIDENT); identification.setDateIdentified(getDate(y, m, d)); ScientificName sn = getScientificName(input); DefaultClassification dc = getDefaultClassification(input, sn); identification.setScientificName(sn); identification.setDefaultClassification(dc); return identification; } BrahmsMultiMediaTransformer(ETLStatistics stats); }
BrahmsMultiMediaTransformer extends BrahmsTransformer<MultiMediaObject> { private MultiMediaContentIdentification getIdentification() { MultiMediaContentIdentification identification = new MultiMediaContentIdentification(); identification.setTypeStatus(getTypeStatus()); String s = input.get(VERNACULAR); if (s != null) { identification.setVernacularNames(Arrays.asList(new VernacularName(s))); } String y = input.get(YEARIDENT); String m = input.get(MONTHIDENT); String d = input.get(DAYIDENT); identification.setDateIdentified(getDate(y, m, d)); ScientificName sn = getScientificName(input); DefaultClassification dc = getDefaultClassification(input, sn); identification.setScientificName(sn); identification.setDefaultClassification(dc); return identification; } BrahmsMultiMediaTransformer(ETLStatistics stats);  }
BrahmsMultiMediaTransformer extends BrahmsTransformer<MultiMediaObject> { private MultiMediaContentIdentification getIdentification() { MultiMediaContentIdentification identification = new MultiMediaContentIdentification(); identification.setTypeStatus(getTypeStatus()); String s = input.get(VERNACULAR); if (s != null) { identification.setVernacularNames(Arrays.asList(new VernacularName(s))); } String y = input.get(YEARIDENT); String m = input.get(MONTHIDENT); String d = input.get(DAYIDENT); identification.setDateIdentified(getDate(y, m, d)); ScientificName sn = getScientificName(input); DefaultClassification dc = getDefaultClassification(input, sn); identification.setScientificName(sn); identification.setDefaultClassification(dc); return identification; } BrahmsMultiMediaTransformer(ETLStatistics stats);   }