@Test public void testExperiments() { try { // get row count of experiments in the dataset int expected = getDataSet().getTable("Experiment").getRowCount(); // get number of experiments from the DAO int actual = getExperimentDAO().count(); // test data contains 2 experiments, check size of returned list TestCase.assertEquals("Wrong number of experiments", expected, actual); System.out.println("Expected number of experiments: " + expected + ", actual: " + actual); for (Experiment d : random(getExperimentDAO(), actual, 5)) { TestCase.assertNotNull(d); TestCase.assertNotNull(d.getId()); } } catch (Exception e) { e.printStackTrace(); TestCase.fail(); } }
public static ExperimentBuilder aCopyOf(Experiment experiment) { return anExperiment() .withExperimentSnapshot(experiment.getExperimentSnapshot()) .withId(experiment.getId()) .withLastUpdated(experiment.getLastUpdated()); }