aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-03-23 11:42:48 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-03-23 13:23:00 +0100
commit3e016847302d921da2116dbd9daf6e71f3a201bf (patch)
treeb883976156a7bbed609aed766be1bcbd4d494d3f /server
parent31131ead58d8a4d303a356ca960f14f8c69bc7ee (diff)
downloadsonarqube-3e016847302d921da2116dbd9daf6e71f3a201bf.tar.gz
sonarqube-3e016847302d921da2116dbd9daf6e71f3a201bf.zip
SONAR-7428 Remove sonar-views-bridge
Diffstat (limited to 'server')
-rw-r--r--server/pom.xml1
-rw-r--r--server/sonar-server/pom.xml4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java6
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/view/bridge/ViewsBootstrap.java52
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/view/bridge/ViewsStopper.java56
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/view/bridge/package-info.java24
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/platform/ViewsIntegrationTest.java106
-rw-r--r--server/sonar-views-bridge/pom.xml41
-rw-r--r--server/sonar-views-bridge/src/main/java/org/sonar/server/views/ViewsBridge.java51
-rw-r--r--server/sonar-views-bridge/src/main/java/org/sonar/server/views/package-info.java23
10 files changed, 0 insertions, 364 deletions
diff --git a/server/pom.xml b/server/pom.xml
index aedc8bc2271..5f7aab7d92b 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -16,7 +16,6 @@
<module>sonar-search</module>
<module>sonar-server</module>
<module>sonar-ce</module>
- <module>sonar-views-bridge</module>
<module>sonar-dev-cockpit-bridge</module>
<module>sonar-governance-bridge</module>
<module>sonar-web</module>
diff --git a/server/sonar-server/pom.xml b/server/sonar-server/pom.xml
index afa1b8f5c17..36880dd10cd 100644
--- a/server/sonar-server/pom.xml
+++ b/server/sonar-server/pom.xml
@@ -171,10 +171,6 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>sonar-views-bridge</artifactId>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
<artifactId>sonar-dev-cockpit-bridge</artifactId>
</dependency>
<dependency>
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
index 9aecf57ae57..84e8156aa3c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
@@ -299,8 +299,6 @@ import org.sonar.server.user.ws.UsersWs;
import org.sonar.server.usergroups.ws.UserGroupsModule;
import org.sonar.server.usertoken.UserTokenModule;
import org.sonar.server.util.TypeValidationModule;
-import org.sonar.server.view.bridge.ViewsBootstrap;
-import org.sonar.server.view.bridge.ViewsStopper;
import org.sonar.server.view.index.ViewIndex;
import org.sonar.server.view.index.ViewIndexDefinition;
import org.sonar.server.view.index.ViewIndexer;
@@ -690,10 +688,6 @@ public class PlatformLevel4 extends PlatformLevel {
CancelAllAction.class,
PluginsWs.class,
- // Views plugin
- ViewsBootstrap.class,
- ViewsStopper.class,
-
// Developer Cockpit plugin
DevCockpitBootstrap.class,
DevCockpitStopper.class,
diff --git a/server/sonar-server/src/main/java/org/sonar/server/view/bridge/ViewsBootstrap.java b/server/sonar-server/src/main/java/org/sonar/server/view/bridge/ViewsBootstrap.java
deleted file mode 100644
index df4fbb211ba..00000000000
--- a/server/sonar-server/src/main/java/org/sonar/server/view/bridge/ViewsBootstrap.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.view.bridge;
-
-import org.sonar.api.platform.Server;
-import org.sonar.api.platform.ServerStartHandler;
-import org.sonar.api.utils.log.Logger;
-import org.sonar.api.utils.log.Loggers;
-import org.sonar.api.utils.log.Profiler;
-import org.sonar.core.platform.ComponentContainer;
-import org.sonar.server.views.ViewsBridge;
-
-/**
- * Startup task to responsible to bootstrap the Views plugin when it is installed.
- */
-public class ViewsBootstrap implements ServerStartHandler {
- private static final Logger LOGGER = Loggers.get(ViewsBootstrap.class);
-
- private final ComponentContainer componentContainer;
-
- public ViewsBootstrap(ComponentContainer componentContainer) {
- this.componentContainer = componentContainer;
- }
-
- @Override
- public void onServerStart(Server server) {
- ViewsBridge viewsBridge = componentContainer.getComponentByType(ViewsBridge.class);
- if (viewsBridge != null) {
- Profiler profiler = Profiler.create(LOGGER).startInfo("Bootstrapping views");
- viewsBridge.startViews(componentContainer);
- profiler.stopInfo();
- }
- }
-
-}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/view/bridge/ViewsStopper.java b/server/sonar-server/src/main/java/org/sonar/server/view/bridge/ViewsStopper.java
deleted file mode 100644
index 61ec92d3681..00000000000
--- a/server/sonar-server/src/main/java/org/sonar/server/view/bridge/ViewsStopper.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.view.bridge;
-
-import org.picocontainer.Startable;
-import org.sonar.api.utils.log.Logger;
-import org.sonar.api.utils.log.Loggers;
-import org.sonar.api.utils.log.Profiler;
-import org.sonar.core.platform.ComponentContainer;
-import org.sonar.server.views.ViewsBridge;
-
-/**
- * As an component of PlatformLevel4, this class is responsible for notifying shutdown to the Views plugin when its
- * installed.
- */
-public class ViewsStopper implements Startable {
- private static final Logger LOGGER = Loggers.get(ViewsStopper.class);
-
- private final ComponentContainer platformContainer;
-
- public ViewsStopper(ComponentContainer platformContainer) {
- this.platformContainer = platformContainer;
- }
-
- @Override
- public void start() {
- // nothing to do, Views plugins is started by ViewsBootstrap
- }
-
- @Override
- public void stop() {
- ViewsBridge viewsBridge = platformContainer.getComponentByType(ViewsBridge.class);
- if (viewsBridge != null) {
- Profiler profiler = Profiler.create(LOGGER).startInfo("Stopping views");
- viewsBridge.stopViews();
- profiler.stopInfo();
- }
- }
-}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/view/bridge/package-info.java b/server/sonar-server/src/main/java/org/sonar/server/view/bridge/package-info.java
deleted file mode 100644
index c8f449cb43b..00000000000
--- a/server/sonar-server/src/main/java/org/sonar/server/view/bridge/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.server.view.bridge;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ViewsIntegrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ViewsIntegrationTest.java
deleted file mode 100644
index 9a886c49e09..00000000000
--- a/server/sonar-server/src/test/java/org/sonar/server/platform/ViewsIntegrationTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.platform;
-
-import org.junit.After;
-import org.junit.Test;
-import org.sonar.core.platform.ComponentContainer;
-import org.sonar.server.tester.ServerTester;
-import org.sonar.server.views.ViewsBridge;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ViewsIntegrationTest {
- private final ViewsBridgeSimulator viewsBridgeSimulator = new ViewsBridgeSimulator();
-
- private ServerTester serverTester = new ServerTester().withEsIndexes();
-
- @After
- public void tearDown() throws Exception {
- serverTester.stop();
- }
-
- @Test
- public void verify_no_interaction_when_not_added_to_the_server() {
- serverTester.start();
-
- assertThat(viewsBridgeSimulator.isBootstrapCalled()).isFalse();
- assertThat(viewsBridgeSimulator.getStopCalls()).isEqualTo(0);
- assertThat(viewsBridgeSimulator.getUpdateViewsCalls()).isEqualTo(0);
- }
-
- @Test
- public void verify_no_interaction_when_startup_tasks_are_disabled() {
- serverTester.addComponents(viewsBridgeSimulator).start();
-
- assertThat(viewsBridgeSimulator.isBootstrapCalled()).isFalse();
- assertThat(viewsBridgeSimulator.getStopCalls()).isEqualTo(0);
- assertThat(viewsBridgeSimulator.getUpdateViewsCalls()).isEqualTo(0);
- }
-
- @Test
- public void verify_bootstrapped_only_with_startup_tasks_and_stopped_with_the_server() {
- serverTester.addComponents(viewsBridgeSimulator).withStartupTasks().start();
-
- assertThat(viewsBridgeSimulator.isBootstrapCalled()).isTrue();
- assertThat(viewsBridgeSimulator.getStopCalls()).isEqualTo(0);
- assertThat(viewsBridgeSimulator.getUpdateViewsCalls()).isEqualTo(0);
-
- serverTester.stop();
-
- assertThat(viewsBridgeSimulator.getStopCalls()).isEqualTo(1);
- assertThat(viewsBridgeSimulator.getUpdateViewsCalls()).isEqualTo(0);
- }
-
- private static class ViewsBridgeSimulator implements ViewsBridge {
- private boolean bootstrapCalled = false;
- private int stopCalls = 0;
- private int updateViewsCalls = 0;
-
- @Override
- public void startViews(ComponentContainer parent) {
- checkArgument(!bootstrapCalled, "Bootstrap already called");
- this.bootstrapCalled = true;
- }
-
- @Override
- public void stopViews() {
- this.stopCalls += 1;
- }
-
- @Override
- public void updateViews() {
- this.updateViewsCalls += 1;
- }
-
- public boolean isBootstrapCalled() {
- return bootstrapCalled;
- }
-
- public int getStopCalls() {
- return stopCalls;
- }
-
- public int getUpdateViewsCalls() {
- return updateViewsCalls;
- }
- }
-}
diff --git a/server/sonar-views-bridge/pom.xml b/server/sonar-views-bridge/pom.xml
deleted file mode 100644
index 1a01c0d6c55..00000000000
--- a/server/sonar-views-bridge/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.sonarsource.sonarqube</groupId>
- <artifactId>server</artifactId>
- <version>5.5-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>sonar-views-bridge</artifactId>
- <name>SonarQube :: Views Bridge</name>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sonar-plugin-api</artifactId>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sonar-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>${skipServerTests}</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/server/sonar-views-bridge/src/main/java/org/sonar/server/views/ViewsBridge.java b/server/sonar-views-bridge/src/main/java/org/sonar/server/views/ViewsBridge.java
deleted file mode 100644
index e8d5221b14b..00000000000
--- a/server/sonar-views-bridge/src/main/java/org/sonar/server/views/ViewsBridge.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.views;
-
-import org.sonar.core.platform.ComponentContainer;
-
-/**
- * Interface implemented by the Extension point exposed by the Views plugin that serves as the unique access point from
- * the whole SQ instance into the Views plugin.
- */
-public interface ViewsBridge {
-
- /**
- * Bootstraps the Views plugin.
- *
- * @param parent the parent ComponentContainer which provides Platform components for Views to use.
- *
- * @throws IllegalStateException if called more than once
- */
- void startViews(ComponentContainer parent);
-
- /**
- * This method is called when Platform is shutting down.
- */
- void stopViews();
-
- /**
- * Triggers an update of Views tree and measures.
- *
- * @throws IllegalStateException if {@link #startViews(ComponentContainer)} has not been called
- */
- void updateViews();
-
-}
diff --git a/server/sonar-views-bridge/src/main/java/org/sonar/server/views/package-info.java b/server/sonar-views-bridge/src/main/java/org/sonar/server/views/package-info.java
deleted file mode 100644
index 0bf365bcacb..00000000000
--- a/server/sonar-views-bridge/src/main/java/org/sonar/server/views/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.server.views;
-
-import javax.annotation.ParametersAreNonnullByDefault;