Search in sources :

Example 1 with XWikiVersioningStoreInterface

use of com.xpn.xwiki.store.XWikiVersioningStoreInterface in project xwiki-platform by xwiki.

the class XWikiMockitoTest method setUp.

@Before
public void setUp() throws Exception {
    this.mocker.registerMockComponent(ResourceReferenceManager.class);
    this.mocker.registerMockComponent(Environment.class);
    this.mocker.registerMockComponent(ObservationManager.class);
    this.mocker.registerMockComponent(ConfigurationSource.class, XWikiCfgConfigurationSource.ROLEHINT);
    this.mocker.registerMockComponent(StoreConfiguration.class);
    this.mocker.registerMockComponent(WikiDescriptorManager.class);
    Utils.setComponentManager(mocker);
    xwiki = new XWiki();
    this.context.setWiki(this.xwiki);
    this.storeMock = mock(XWikiStoreInterface.class);
    xwiki.setStore(storeMock);
    XWikiVersioningStoreInterface versioningStore = mock(XWikiVersioningStoreInterface.class);
    xwiki.setVersioningStore(versioningStore);
    this.documentRevisionProvider = this.mocker.registerMockComponent(DocumentRevisionProvider.class);
    this.xwikiCfgConfigurationSource = this.mocker.registerMockComponent(ConfigurationSource.class, "xwikicfg");
    Execution execution = this.mocker.getInstance(Execution.class);
    ExecutionContext executionContext = new ExecutionContext();
    execution.setContext(executionContext);
}
Also used : XWikiVersioningStoreInterface(com.xpn.xwiki.store.XWikiVersioningStoreInterface) XWikiCfgConfigurationSource(com.xpn.xwiki.internal.XWikiCfgConfigurationSource) ConfigurationSource(org.xwiki.configuration.ConfigurationSource) DefaultExecution(org.xwiki.context.internal.DefaultExecution) Execution(org.xwiki.context.Execution) ExecutionContext(org.xwiki.context.ExecutionContext) DocumentRevisionProvider(com.xpn.xwiki.doc.DocumentRevisionProvider) XWikiStoreInterface(com.xpn.xwiki.store.XWikiStoreInterface) Before(org.junit.Before)

Aggregations

DocumentRevisionProvider (com.xpn.xwiki.doc.DocumentRevisionProvider)1 XWikiCfgConfigurationSource (com.xpn.xwiki.internal.XWikiCfgConfigurationSource)1 XWikiStoreInterface (com.xpn.xwiki.store.XWikiStoreInterface)1 XWikiVersioningStoreInterface (com.xpn.xwiki.store.XWikiVersioningStoreInterface)1 Before (org.junit.Before)1 ConfigurationSource (org.xwiki.configuration.ConfigurationSource)1 Execution (org.xwiki.context.Execution)1 ExecutionContext (org.xwiki.context.ExecutionContext)1 DefaultExecution (org.xwiki.context.internal.DefaultExecution)1