public void testIsOnlyAttribute() throws Exception { String stringPath = "Department.company"; Path path = new Path(model, stringPath); assertFalse(path.isOnlyAttribute()); stringPath = "Department.employees.name"; path = new Path(model, stringPath); assertFalse(path.isOnlyAttribute()); stringPath = "Department.name"; path = new Path(model, stringPath); assertTrue(path.isOnlyAttribute()); }
public void testIsRootPath() throws Exception { Path path = new Path(model, "Department"); assertTrue(path.isRootPath()); path = new Path(model, "Department.manager"); assertFalse(path.isRootPath()); }
public void testContainsReferences() throws Exception { String stringPath = "Department.company"; Path path = new Path(model, stringPath); assertTrue(path.containsReferences()); stringPath = "Department.employees.name"; path = new Path(model, stringPath); assertFalse(path.containsReferences()); }
public void testContainsCollections() throws Exception { String stringPath = "Department.company"; Path path = new Path(model, stringPath); assertFalse(path.containsCollections()); stringPath = "Department.employees.name"; path = new Path(model, stringPath); assertTrue(path.containsCollections()); }
public void testValid() throws Exception { String stringPath = "Department.company"; Path path = new Path(model, stringPath); ClassDescriptor cld = model.getClassDescriptorByName("org.intermine.pathquery.model.testmodel.Department"); assertEquals(cld, path.getStartClassDescriptor()); FieldDescriptor fld = cld.getFieldDescriptorByName("company"); assertEquals(fld, path.getEndFieldDescriptor()); ClassDescriptor compDesc = model.getClassDescriptorByName("org.intermine.pathquery.model.testmodel.Company"); assertEquals(compDesc, path.getEndClassDescriptor()); assertFalse(path.containsCollections()); assertEquals(stringPath, path.toString()); }