AuthorizationContext implements Context, AccessControlConstants, PermissionConstants { static Context getInstance() { return INSTANCE; } private  AuthorizationContext(); @Override boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property); @Override boolean definesContextRoot(@NotNull Tree tree); @Override boolean definesTree(@NotNull Tree tree); @Override boolean definesLocation(@NotNull TreeLocation location); @Override boolean definesInternal(@NotNull Tree tree);  }
@Test public void testGetType() throws Exception { TreeTypeProvider ttp = new TreeTypeProvider(AuthorizationContext.getInstance()); for (TypeTest test : TypeTest.createTests(root)) { assertEquals(test.path, test.type, ttp.getType(root.getTree(test.path))); } }
@Test public void testGetTypeWithParentType() throws Exception { TreeTypeProvider ttp = new TreeTypeProvider(AuthorizationContext.getInstance()); for (TypeTest test : TypeTest.createTests(root)) { assertEquals(test.path, test.type, ttp.getType(root.getTree(test.path), test.parentType)); } }
@Test public void testGetTypeWithDefaultParentType() throws Exception { TreeTypeProvider ttp = new TreeTypeProvider(AuthorizationContext.getInstance()); for (TypeTest test : TypeTest.createTests(root)) { TreeType typeIfParentDefault = ttp.getType(root.getTree(test.path), TreeType.DEFAULT); if (TreeType.DEFAULT == test.parentType) { assertEquals(test.path, test.type, typeIfParentDefault); } else { assertNotEquals(test.path, test.type, typeIfParentDefault); } } }