コード例 #1
0
  @Test
  public void shouldfindOneAbstractMethod() {
    PojoClass pojoClass = PojoClassFactory.getPojoClass(AnAbstractClassWithOneAbstractMethod.class);
    for (PojoMethod pojoMethod : pojoClass.getPojoMethods()) {
      if (!pojoMethod.isConstructor()) Assert.assertTrue(pojoMethod.isAbstract());
    }

    Assert.assertEquals(1 + 1 /* constructor */, pojoClass.getPojoMethods().size());
  }
コード例 #2
0
  @Test
  public void shouldFindNoAbstractMethods() {
    PojoClass pojoClass = PojoClassFactory.getPojoClass(AnAbstractClassEmpty.class);
    for (PojoMethod pojoMethod : pojoClass.getPojoMethods()) {
      Assert.assertTrue(pojoMethod.isConstructor());
      Assert.assertFalse(pojoMethod.isAbstract());
    }

    Assert.assertEquals(1, pojoClass.getPojoMethods().size());
  }