예제 #1
0
  @Test
  public void getFinalFails() {
    final A a = new A();

    try {
      model(from(a).getFinalB().getCharacter());

      fail();
    } catch (NullPointerException expected) {
    }
  }
예제 #2
0
  /**
   * A {@link IObjectClassAwareModel} doesn't provide generic information, thus the type of the
   * model result is {@code List<Object>} only.
   */
  @Test
  public void getEntryFromGenericListInObjectClassAwareModelFails() {
    B b = new B();
    b.cs.add(new C());

    PropertyModel<List<C>> target = new PropertyModel<List<C>>(b, "cs");

    try {
      model(from(target).get(0).getString());

      fail();
    } catch (ClassCastException expected) {
    }
  }