示例#1
0
 public Interview(Study study) {
   interview_time = new Date();
   study_id = study.getId();
   recordings = new ArrayList<Recording>(study.getPhrases().size());
   for (Phrase phrase : study.getPhrases()) {
     Recording recording = new Recording();
     recording.setPhrase_id(phrase.getId());
     recordings.add(recording);
   }
 }
示例#2
0
  @Test
  public void testStudies() {
    try {
      // get row count of experiments in the dataset
      int expected = getDataSet().getTable("Study").getRowCount();

      // get number of experiments from the DAO
      int actual = getStudyDAO().count();

      // test data contains 2 experiments, check size of returned list
      TestCase.assertEquals("Wrong number of Study", expected, actual);

      System.out.println("Expected number of Study: " + expected + ", actual: " + actual);

      for (Study d : random(getStudyDAO(), actual, 5)) {
        TestCase.assertNotNull(d);
        TestCase.assertNotNull(d.getId());
      }
    } catch (Exception e) {
      e.printStackTrace();
      TestCase.fail();
    }
  }