DiffAnalyticsRowMapper implements RowMapper<DiffAnalytics> { DifferentialExpression buildDifferentialExpression(double pValue, double foldChange, String tstatistic) { if (foldChange == INFINITY_VALUE) { foldChange = Double.POSITIVE_INFINITY; } if (foldChange == -INFINITY_VALUE) { foldChange = Double.NEGATIVE_INFINITY; } if (tstatistic == null) { return new DifferentialExpression(pValue, foldChange); } return new MicroarrayExpression(pValue, foldChange, Double.parseDouble(tstatistic)); } @Inject  DiffAnalyticsRowMapper(ContrastTrader contrastTrader); @Override DiffAnalytics mapRow(ResultSet rs, int rowNum);  }
@Test public void testBuildDifferentialExpression() { DifferentialExpression expression = subject.buildDifferentialExpression(0.001, 1, null); MatcherAssert.assertThat(expression.getClass().getName(), Is.is(DifferentialExpression.class.getName())); }
@Test public void testBuildMicroarrayExpression() { DifferentialExpression expression = subject.buildDifferentialExpression(0.001, 1, "1.1"); MatcherAssert.assertThat(expression.getClass().getName(), Is.is(MicroarrayExpression.class.getName())); }