public void testDecomposePath() throws Exception { String shortPathString = "Company"; Path shortPath = new Path(model, shortPathString); List<Path> decomposedPaths = shortPath.decomposePath(); assertTrue(decomposedPaths != null); assertTrue(decomposedPaths.size() == 1); assertTrue("Company".equals(decomposedPaths.get(0).toString())); String longPathString = "Company.departments.manager.name"; Path longPath = new Path(model, longPathString); decomposedPaths = longPath.decomposePath(); assertTrue(decomposedPaths != null); assertTrue(decomposedPaths.size() == 4); assertTrue("Company".equals(decomposedPaths.get(0).toString())); assertTrue("Company.departments".equals(decomposedPaths.get(1).toString())); assertTrue("Company.departments.manager".equals(decomposedPaths.get(2).toString())); assertTrue("Company.departments.manager.name".equals(decomposedPaths.get(3).toString())); }
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 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 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()); }