Exemple #1
0
  @Test
  public void testSubjectCriteriaCorrect() {
    DichotomousCriterion criterion1 = new DichotomousCriterion();
    criterion1.setName("criterion1");
    DichotomousCriterion criterion2 = new DichotomousCriterion();
    criterion2.setName("criterion2");
    List<
            AbstractCriterion<
                ? extends Serializable, ? extends AbstractConstraint<? extends Serializable>>>
        criteria =
            new ArrayList<
                AbstractCriterion<
                    ? extends Serializable,
                    ? extends AbstractConstraint<? extends Serializable>>>();
    criteria.add(criterion1);
    criteria.add(criterion2);
    validTrial.setCriteria(criteria);
    assertEquals(2, validTrial.getCriteria().size());
    assertTrue(DichotomousCriterion.class.isInstance(validTrial.getCriteria().get(0)));
    assertEquals("criterion1", validTrial.getCriteria().get(0).getName());
    assertTrue(DichotomousCriterion.class.isInstance(validTrial.getCriteria().get(1)));
    assertEquals("criterion2", validTrial.getCriteria().get(1).getName());

    List<
            AbstractCriterion<
                ? extends Serializable, ? extends AbstractConstraint<? extends Serializable>>>
        list =
            new ArrayList<
                AbstractCriterion<
                    ? extends Serializable,
                    ? extends AbstractConstraint<? extends Serializable>>>();
    validTrial.setCriteria(list);
    assertEquals(list, validTrial.getCriteria());
  }
Exemple #2
0
 @Test
 public void testSubjectCriterionNull() {
   validTrial.setCriteria(null);
   assertNull(validTrial.getCriteria());
   assertValid(validTrial);
 }