Exemplo n.º 1
0
  @Test
  public void testContainmentHasContainer() throws Exception {
    Property p = new Property();
    p.init(null, ParentInterface.class.getMethod("getChildren"));

    assertTrue(p.isCollection());
  }
Exemplo n.º 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());
  }
Exemplo n.º 3
0
  @Test
  public void testTermbindsIncludesMetaproperties() throws URISyntaxException {
    Integer totalResults = null;
    Resource thisMetaPage = createMetadata(false, totalResults);

    for (Property p : expectedTermboundProperties) {
      Model model = thisMetaPage.getModel();
      if (!model.contains(null, API.property, p)) {
        fail("term bindings should include " + model.shortForm(p.getURI()));
      }
    }
  }
Exemplo n.º 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());
  }
Exemplo n.º 5
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());
  }
Exemplo n.º 6
0
 @Test
 public void propertyTest() {
   Property p = new Property("name", "value");
   assertEquals("name", p.getName());
   assertEquals("value", p.getValue());
 }