@Test public void testContainmentHasContainer() throws Exception { Property p = new Property(); p.init(null, ParentInterface.class.getMethod("getChildren")); assertTrue(p.isCollection()); }
@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()); }
@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())); } } }
@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()); }
@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()); }