示例#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 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()));
      }
    }
  }
示例#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());
  }
示例#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());
  }
 @Test
 public void propertyTest() {
   Property p = new Property("name", "value");
   assertEquals("name", p.getName());
   assertEquals("value", p.getValue());
 }