use of org.xwiki.component.internal.multi.ComponentManagerManager in project xwiki-platform by xwiki.
the class ContextComponentManagerTest method testCreateDocumentComponentManager.
@Test
public void testCreateDocumentComponentManager() throws Exception {
ComponentManagerManager manager = getComponentManager().getInstance(ComponentManagerManager.class);
NamespacedComponentManager componentManager = (NamespacedComponentManager) manager.getComponentManager("document:wiki1:space1.space2.document1", true);
assertNotNull(componentManager);
assertEquals("document:wiki1:space1.space2.document1", componentManager.getNamespace());
assertEquals("space:wiki1:space1.space2", ((NamespacedComponentManager) componentManager.getParent()).getNamespace());
assertEquals("space:wiki1:space1", ((NamespacedComponentManager) componentManager.getParent().getParent()).getNamespace());
assertEquals("wiki:wiki1", ((NamespacedComponentManager) componentManager.getParent().getParent().getParent()).getNamespace());
}
use of org.xwiki.component.internal.multi.ComponentManagerManager in project xwiki-platform by xwiki.
the class ComponentScriptServiceTest method getComponentManagerForNamespaceWhenNoProgrammingRights.
@Test
public void getComponentManagerForNamespaceWhenNoProgrammingRights() throws Exception {
when(this.dab.hasProgrammingRights()).thenReturn(false);
assertNull(this.mocker.getComponentUnderTest().getComponentManager("wiki:xwiki"));
ComponentManagerManager componentManagerManager = this.mocker.getInstance(ComponentManagerManager.class);
verify(componentManagerManager, never()).getComponentManager(any(), anyBoolean());
}
Aggregations