Search in sources :

Example 56 with DocumentAccessBridge

use of org.xwiki.bridge.DocumentAccessBridge in project xwiki-platform by xwiki.

the class AbstractRefactoringTestCase method registerComponents.

@Override
protected void registerComponents() throws Exception {
    // Document Access Bridge Mock
    final DocumentAccessBridge mockDocumentAccessBridge = this.mockery.mock(DocumentAccessBridge.class);
    DefaultComponentDescriptor<DocumentAccessBridge> descriptorDAB = new DefaultComponentDescriptor<DocumentAccessBridge>();
    descriptorDAB.setRoleType(DocumentAccessBridge.class);
    getComponentManager().registerComponent(descriptorDAB, mockDocumentAccessBridge);
    mockery.checking(new Expectations() {

        {
            allowing(mockDocumentAccessBridge).exists(with(any(String.class)));
            will(returnValue(false));
        }
    });
    this.docBridge = getComponentManager().getInstance(DocumentAccessBridge.class, "default");
    this.xwikiParser = getComponentManager().getInstance(Parser.class, "xwiki/2.0");
}
Also used : Expectations(org.jmock.Expectations) DefaultComponentDescriptor(org.xwiki.component.descriptor.DefaultComponentDescriptor) DocumentAccessBridge(org.xwiki.bridge.DocumentAccessBridge) Parser(org.xwiki.rendering.parser.Parser)

Aggregations

DocumentAccessBridge (org.xwiki.bridge.DocumentAccessBridge)56 DocumentReference (org.xwiki.model.reference.DocumentReference)39 Test (org.junit.Test)33 Expectations (org.jmock.Expectations)17 DocumentModelBridge (org.xwiki.bridge.DocumentModelBridge)15 DefaultParameterizedType (org.xwiki.component.util.DefaultParameterizedType)11 Before (org.junit.Before)10 XDOM (org.xwiki.rendering.block.XDOM)10 Execution (org.xwiki.context.Execution)7 SpaceReference (org.xwiki.model.reference.SpaceReference)7 ResourceReference (org.xwiki.rendering.listener.reference.ResourceReference)7 EntityReferenceResolver (org.xwiki.model.reference.EntityReferenceResolver)6 MacroBlock (org.xwiki.rendering.block.MacroBlock)6 DocumentResourceReference (org.xwiki.rendering.listener.reference.DocumentResourceReference)6 HashMap (java.util.HashMap)5 VelocityContext (org.apache.velocity.VelocityContext)5 Event (org.xwiki.eventstream.Event)5 DefaultEvent (org.xwiki.eventstream.internal.DefaultEvent)5 VelocityEngine (org.xwiki.velocity.VelocityEngine)5 VelocityManager (org.xwiki.velocity.VelocityManager)5