Пример #1
0
  @Test
  public void testContainmentHasContainer() throws Exception {
    Property p = new Property();
    p.init(null, ParentInterface.class.getMethod("getChildren"));

    assertTrue(p.isCollection());
  }
Пример #2
0
  @Test
  public void testContainment() throws Exception {
    Property p = new Property();
    p.init(null, ParentInterface.class.getMethod("getChildren"));

    assertTrue(p.isCollection());
    assertEquals("ChildInterface", p.containedType);
    assertEquals("java.util.Collection<ChildInterface>", p.getFQN());
  }
Пример #3
0
  @Test
  public void testPropertyIsRequired() throws Exception {
    Property p = new Property();
    p.init(null, TestInterface.class.getMethod("getID"));

    assertEquals("ID", p.getName());
    assertEquals("iD", p.getNameCc());
    assertEquals("java.math", p.getPkg());
    assertEquals("BigInteger", p.getType());
    assertFalse(p.isRequired());
  }
Пример #4
0
  @Test
  public void testPropertyAll() throws Exception {
    Property p = new Property();
    p.init(null, TestInterface.class.getMethod("getName"));

    assertEquals("Name", p.getName());
    assertEquals("name", p.getNameCc());
    assertEquals("java.lang", p.getPkg());
    assertEquals("String", p.getType());
    assertTrue(p.isRequired());
    assertFalse(p.isCollection());
  }