Search in sources :

Example 1 with PageRepository

use of org.sonar.server.ui.PageRepository in project sonarqube by SonarSource.

the class GlobalActionTest method init.

private void init(org.sonar.api.web.page.Page[] pages, ResourceTypeTree[] resourceTypeTrees) {
    when(dbClient.getDatabase().getDialect()).thenReturn(new H2());
    when(server.getVersion()).thenReturn("6.42");
    PluginRepository pluginRepository = mock(PluginRepository.class);
    when(pluginRepository.hasPlugin(anyString())).thenReturn(true);
    PageRepository pageRepository = new PageRepository(pluginRepository, new PageDefinition[] { context -> {
        for (Page page : pages) {
            context.addPage(page);
        }
    } });
    pageRepository.start();
    ws = new WsActionTester(new GlobalAction(pageRepository, settings, new ResourceTypes(resourceTypeTrees), server, dbClient, organizationFlags));
}
Also used : ResourceTypes(org.sonar.api.resources.ResourceTypes) PluginRepository(org.sonar.core.platform.PluginRepository) PageRepository(org.sonar.server.ui.PageRepository) H2(org.sonar.db.dialect.H2) Page(org.sonar.api.web.page.Page) WsActionTester(org.sonar.server.ws.WsActionTester)

Example 2 with PageRepository

use of org.sonar.server.ui.PageRepository in project sonarqube by SonarSource.

the class SettingsActionTest method init.

private void init(Page... pages) {
    PluginRepository pluginRepository = mock(PluginRepository.class);
    when(pluginRepository.hasPlugin(anyString())).thenReturn(true);
    PageRepository pageRepository = new PageRepository(pluginRepository, new PageDefinition[] { context -> {
        for (Page page : pages) {
            context.addPage(page);
        }
    } });
    ws = new WsActionTester(new SettingsAction(pageRepository, settings, userSessionRule));
    pageRepository.start();
}
Also used : PluginRepository(org.sonar.core.platform.PluginRepository) PageRepository(org.sonar.server.ui.PageRepository) Page(org.sonar.api.web.page.Page) WsActionTester(org.sonar.server.ws.WsActionTester)

Example 3 with PageRepository

use of org.sonar.server.ui.PageRepository in project sonarqube by SonarSource.

the class ComponentActionTest method init.

private void init(Page... pages) {
    PluginRepository pluginRepository = mock(PluginRepository.class);
    when(pluginRepository.hasPlugin(anyString())).thenReturn(true);
    PageRepository pageRepository = new PageRepository(pluginRepository, new PageDefinition[] { context -> {
        for (Page page : pages) {
            context.addPage(page);
        }
    } });
    pageRepository.start();
    ws = new WsActionTester(new ComponentAction(dbClient, pageRepository, resourceTypes, userSession, new ComponentFinder(dbClient), new QualityGateFinder(dbClient)));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) PluginRepository(org.sonar.core.platform.PluginRepository) PageRepository(org.sonar.server.ui.PageRepository) Page(org.sonar.api.web.page.Page) QualityGateFinder(org.sonar.server.qualitygate.QualityGateFinder) WsActionTester(org.sonar.server.ws.WsActionTester)

Aggregations

Page (org.sonar.api.web.page.Page)3 PluginRepository (org.sonar.core.platform.PluginRepository)3 PageRepository (org.sonar.server.ui.PageRepository)3 WsActionTester (org.sonar.server.ws.WsActionTester)3 ResourceTypes (org.sonar.api.resources.ResourceTypes)1 H2 (org.sonar.db.dialect.H2)1 ComponentFinder (org.sonar.server.component.ComponentFinder)1 QualityGateFinder (org.sonar.server.qualitygate.QualityGateFinder)1