@Test public void testInvalidRank() { ETLStatistics etlStatistics = new ETLStatistics(); NsrTaxonTransformer nsrTaxonTransformer = new NsrTaxonTransformer(etlStatistics); Boolean rank = null; Object obj = ReflectionUtil.call(nsrTaxonTransformer, "invalidRank", new Class[]{String.class}, new Object[]{"superfamilia"}); rank = (boolean) obj; assertTrue("01", rank); rank = null; obj = ReflectionUtil.call(nsrTaxonTransformer, "invalidRank", new Class[]{String.class}, new Object[]{null}); rank = (boolean) obj; assertTrue("02", rank); rank = null; obj = ReflectionUtil.call(nsrTaxonTransformer, "invalidRank", new Class[]{String.class}, new Object[]{"species"}); rank = (boolean) obj; assertFalse("03", rank); }
private boolean invalidRank(String rank) { if (rank == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing taxonomic rank"); return true; } if (!allowedTaxonRanks.contains(rank)) { stats.recordsSkipped++; error("Record skipped. Ignoring higher taxon: \"%s\"", rank); return true; } return false; }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private boolean invalidRank(String rank) { if (rank == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing taxonomic rank"); return true; } if (!allowedTaxonRanks.contains(rank)) { stats.recordsSkipped++; error("Record skipped. Ignoring higher taxon: \"%s\"", rank); return true; } return false; } }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private boolean invalidRank(String rank) { if (rank == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing taxonomic rank"); return true; } if (!allowedTaxonRanks.contains(rank)) { stats.recordsSkipped++; error("Record skipped. Ignoring higher taxon: \"%s\"", rank); return true; } return false; } NsrTaxonTransformer(ETLStatistics stats); }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private boolean invalidRank(String rank) { if (rank == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing taxonomic rank"); return true; } if (!allowedTaxonRanks.contains(rank)) { stats.recordsSkipped++; error("Record skipped. Ignoring higher taxon: \"%s\"", rank); return true; } return false; } NsrTaxonTransformer(ETLStatistics stats);  }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private boolean invalidRank(String rank) { if (rank == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing taxonomic rank"); return true; } if (!allowedTaxonRanks.contains(rank)) { stats.recordsSkipped++; error("Record skipped. Ignoring higher taxon: \"%s\"", rank); return true; } return false; } NsrTaxonTransformer(ETLStatistics stats);   }