diff options
59 files changed, 499 insertions, 25 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/taskprocessor/ReportTaskProcessor.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/taskprocessor/ReportTaskProcessor.java index 512a5d17e00..9bc1c36570e 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/taskprocessor/ReportTaskProcessor.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/taskprocessor/ReportTaskProcessor.java @@ -27,7 +27,7 @@ import org.sonar.ce.task.CeTaskResult; import org.sonar.ce.task.container.TaskContainer; import org.sonar.ce.task.projectanalysis.container.ContainerFactory; import org.sonar.ce.task.step.ComputationStepExecutor; -import org.sonar.ce.taskprocessor.CeTaskProcessor; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import org.sonar.ce.taskprocessor.TaskResultHolder; import org.sonar.core.platform.ComponentContainer; import org.sonar.db.ce.CeTaskTypes; diff --git a/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessor.java b/server/sonar-ce-task/src/main/java/org/sonar/ce/task/taskprocessor/CeTaskProcessor.java index 441c227d0a3..88140137d37 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessor.java +++ b/server/sonar-ce-task/src/main/java/org/sonar/ce/task/taskprocessor/CeTaskProcessor.java @@ -17,7 +17,7 @@ * 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.ce.taskprocessor; +package org.sonar.ce.task.taskprocessor; import java.util.Set; import javax.annotation.CheckForNull; diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java b/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java index 41f9c883f09..63b0b4b2b07 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java @@ -28,7 +28,7 @@ import org.sonar.api.utils.log.Loggers; import org.sonar.ce.ComputeEngine; import org.sonar.ce.ComputeEngineImpl; import org.sonar.ce.container.ComputeEngineContainerImpl; -import org.sonar.ce.log.CeProcessLogging; +import org.sonar.ce.logging.CeProcessLogging; import org.sonar.process.MinimumViableSystem; import org.sonar.process.Monitored; import org.sonar.process.ProcessEntryPoint; diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java index 1812686e410..275d844fd68 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java @@ -51,7 +51,7 @@ import org.sonar.ce.StandaloneCeDistributedInformation; import org.sonar.ce.async.SynchronousAsyncExecution; import org.sonar.ce.cleaning.CeCleaningModule; import org.sonar.ce.db.ReadOnlyPropertiesDao; -import org.sonar.ce.log.CeProcessLogging; +import org.sonar.ce.logging.CeProcessLogging; import org.sonar.ce.notification.ReportAnalysisFailureNotificationModule; import org.sonar.ce.platform.CECoreExtensionsInstaller; import org.sonar.ce.platform.ComputeEngineExtensionInstaller; diff --git a/server/sonar-server/src/main/java/org/sonar/ce/log/CeProcessLogging.java b/server/sonar-ce/src/main/java/org/sonar/ce/logging/CeProcessLogging.java index 2788981d9a6..0429c4b168e 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/log/CeProcessLogging.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/logging/CeProcessLogging.java @@ -17,13 +17,13 @@ * 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.ce.log; +package org.sonar.ce.logging; import ch.qos.logback.classic.Level; import org.sonar.process.ProcessId; import org.sonar.process.logging.LogDomain; import org.sonar.process.logging.LogLevelConfig; -import org.sonar.server.app.ServerProcessLogging; +import org.sonar.server.log.ServerProcessLogging; import static org.sonar.ce.task.log.CeTaskLogging.MDC_CE_TASK_UUID; diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/notification/package-info.java b/server/sonar-ce/src/main/java/org/sonar/ce/notification/package-info.java index 0e90a860936..a3ca1a7fd1e 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/notification/package-info.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/notification/package-info.java @@ -18,6 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @ParametersAreNonnullByDefault -package org.sonar.ce.notification; +package org.sonar.ce.task.projectanalysis.notification; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepository.java b/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepository.java index 9f9f25112db..2a4e9b5acc8 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepository.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepository.java @@ -21,6 +21,7 @@ package org.sonar.ce.taskprocessor; import java.util.Optional; import org.sonar.ce.task.CeTask; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; public interface CeTaskProcessorRepository { diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryImpl.java index ba0c97d34e9..1d5b936bf35 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryImpl.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Optional; import javax.annotation.Nonnull; import org.sonar.ce.task.CeTask; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.FluentIterable.from; diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java index 06cc90b2546..831d0406913 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java @@ -31,6 +31,7 @@ import org.sonar.api.utils.log.Loggers; import org.sonar.ce.queue.InternalCeQueue; import org.sonar.ce.task.CeTask; import org.sonar.ce.task.CeTaskResult; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import org.sonar.core.util.logs.Profiler; import org.sonar.db.ce.CeActivityDto; diff --git a/server/sonar-server/src/test/java/org/sonar/ce/log/CeProcessLoggingTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/logging/CeProcessLoggingTest.java index 27dcd888502..d151152ca30 100644 --- a/server/sonar-server/src/test/java/org/sonar/ce/log/CeProcessLoggingTest.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/logging/CeProcessLoggingTest.java @@ -17,7 +17,7 @@ * 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.ce.log; +package org.sonar.ce.logging; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryImplTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryImplTest.java index 04cdeac6834..4108af81183 100644 --- a/server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryImplTest.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryImplTest.java @@ -26,6 +26,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.sonar.ce.task.CeTask; import org.sonar.ce.task.CeTaskResult; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import static org.assertj.core.api.Assertions.assertThat; diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryRule.java b/server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryRule.java index 451ebf1fefd..036ccd52ab9 100644 --- a/server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryRule.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeTaskProcessorRepositoryRule.java @@ -26,6 +26,7 @@ import java.util.Set; import org.junit.rules.ExternalResource; import org.sonar.ce.task.CeTask; import org.sonar.ce.task.CeTaskResult; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/ServerProcessLogging.java b/server/sonar-server-common/src/main/java/org/sonar/server/log/ServerProcessLogging.java index cf7fe6bc37e..ad6711df615 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/ServerProcessLogging.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/log/ServerProcessLogging.java @@ -17,7 +17,7 @@ * 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.app; +package org.sonar.server.log; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; diff --git a/server/sonar-server/src/main/java/org/sonar/ce/package-info.java b/server/sonar-server-common/src/main/java/org/sonar/server/log/package-info.java index 530ad8c9cc2..53c0093ae8d 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/package-info.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/log/package-info.java @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @ParametersAreNonnullByDefault -package org.sonar.ce; +package org.sonar.server.log; import javax.annotation.ParametersAreNonnullByDefault; + diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/notification/DefaultNotificationManager.java b/server/sonar-server-common/src/main/java/org/sonar/server/notification/DefaultNotificationManager.java new file mode 100644 index 00000000000..932c8475394 --- /dev/null +++ b/server/sonar-server-common/src/main/java/org/sonar/server/notification/DefaultNotificationManager.java @@ -0,0 +1,217 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 SonarSource SA + * mailto:info 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.notification; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.ImmutableSetMultimap; +import com.google.common.collect.Multimap; +import java.io.IOException; +import java.io.InvalidClassException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.annotation.Nullable; +import org.sonar.api.notifications.Notification; +import org.sonar.api.notifications.NotificationChannel; +import org.sonar.api.utils.SonarException; +import org.sonar.api.utils.log.Logger; +import org.sonar.api.utils.log.Loggers; +import org.sonar.db.DbClient; +import org.sonar.db.DbSession; +import org.sonar.db.notification.NotificationQueueDto; +import org.sonar.db.property.Subscriber; + +import static java.util.Collections.singletonList; +import static java.util.Objects.requireNonNull; + +public class DefaultNotificationManager implements NotificationManager { + + private static final Logger LOG = Loggers.get(DefaultNotificationManager.class); + + private static final String UNABLE_TO_READ_NOTIFICATION = "Unable to read notification"; + + private NotificationChannel[] notificationChannels; + private final DbClient dbClient; + + private boolean alreadyLoggedDeserializationIssue = false; + + /** + * Default constructor used by Pico + */ + public DefaultNotificationManager(NotificationChannel[] channels, + DbClient dbClient) { + this.notificationChannels = channels; + this.dbClient = dbClient; + } + + /** + * {@inheritDoc} + */ + @Override + public void scheduleForSending(Notification notification) { + NotificationQueueDto dto = NotificationQueueDto.toNotificationQueueDto(notification); + dbClient.notificationQueueDao().insert(singletonList(dto)); + } + + /** + * Give the notification queue so that it can be processed + */ + public Notification getFromQueue() { + int batchSize = 1; + List<NotificationQueueDto> notificationDtos = dbClient.notificationQueueDao().selectOldest(batchSize); + if (notificationDtos.isEmpty()) { + return null; + } + dbClient.notificationQueueDao().delete(notificationDtos); + + return convertToNotification(notificationDtos); + } + + private Notification convertToNotification(List<NotificationQueueDto> notifications) { + try { + // If batchSize is increased then we should return a list instead of a single element + return notifications.get(0).toNotification(); + } catch (InvalidClassException e) { + // SONAR-4739 + if (!alreadyLoggedDeserializationIssue) { + logDeserializationIssue(); + alreadyLoggedDeserializationIssue = true; + } + return null; + } catch (IOException | ClassNotFoundException e) { + throw new SonarException(UNABLE_TO_READ_NOTIFICATION, e); + } + } + + @VisibleForTesting + void logDeserializationIssue() { + LOG.warn("It is impossible to send pending notifications which existed prior to the upgrade of SonarQube. They will be ignored."); + } + + public long count() { + return dbClient.notificationQueueDao().count(); + } + + /** + * {@inheritDoc} + */ + @Override + public Multimap<String, NotificationChannel> findSubscribedRecipientsForDispatcher(NotificationDispatcher dispatcher, + String projectKey, SubscriberPermissionsOnProject subscriberPermissionsOnProject) { + requireNonNull(projectKey, "projectKey is mandatory"); + String dispatcherKey = dispatcher.getKey(); + + Set<SubscriberAndChannel> subscriberAndChannels = Arrays.stream(notificationChannels) + .flatMap(notificationChannel -> toSubscriberAndChannels(dispatcherKey, projectKey, notificationChannel)) + .collect(Collectors.toSet()); + + if (subscriberAndChannels.isEmpty()) { + return ImmutableMultimap.of(); + } + + ImmutableSetMultimap.Builder<String, NotificationChannel> builder = ImmutableSetMultimap.builder(); + try (DbSession dbSession = dbClient.openSession(false)) { + Set<String> authorizedLogins = keepAuthorizedLogins(dbSession, projectKey, subscriberAndChannels, subscriberPermissionsOnProject); + subscriberAndChannels.stream() + .filter(subscriberAndChannel -> authorizedLogins.contains(subscriberAndChannel.getSubscriber().getLogin())) + .forEach(subscriberAndChannel -> builder.put(subscriberAndChannel.getSubscriber().getLogin(), subscriberAndChannel.getChannel())); + } + return builder.build(); + } + + private Stream<SubscriberAndChannel> toSubscriberAndChannels(String dispatcherKey, String projectKey, NotificationChannel notificationChannel) { + Set<Subscriber> usersForNotification = dbClient.propertiesDao().findUsersForNotification(dispatcherKey, notificationChannel.getKey(), projectKey); + return usersForNotification + .stream() + .map(login -> new SubscriberAndChannel(login, notificationChannel)); + } + + private Set<String> keepAuthorizedLogins(DbSession dbSession, String projectKey, Set<SubscriberAndChannel> subscriberAndChannels, + SubscriberPermissionsOnProject requiredPermissions) { + if (requiredPermissions.getGlobalSubscribers().equals(requiredPermissions.getProjectSubscribers())) { + return keepAuthorizedLogins(dbSession, projectKey, subscriberAndChannels, null, requiredPermissions.getGlobalSubscribers()); + } else { + return Stream + .concat( + keepAuthorizedLogins(dbSession, projectKey, subscriberAndChannels, true, requiredPermissions.getGlobalSubscribers()).stream(), + keepAuthorizedLogins(dbSession, projectKey, subscriberAndChannels, false, requiredPermissions.getProjectSubscribers()).stream()) + .collect(Collectors.toSet()); + } + } + + private Set<String> keepAuthorizedLogins(DbSession dbSession, String projectKey, Set<SubscriberAndChannel> subscriberAndChannels, + @Nullable Boolean global, String permission) { + Set<String> logins = subscriberAndChannels.stream() + .filter(s -> global == null || s.getSubscriber().isGlobal() == global) + .map(s -> s.getSubscriber().getLogin()) + .collect(Collectors.toSet()); + if (logins.isEmpty()) { + return Collections.emptySet(); + } + return dbClient.authorizationDao().keepAuthorizedLoginsOnProject(dbSession, logins, projectKey, permission); + } + + private static final class SubscriberAndChannel { + private final Subscriber subscriber; + private final NotificationChannel channel; + + private SubscriberAndChannel(Subscriber subscriber, NotificationChannel channel) { + this.subscriber = subscriber; + this.channel = channel; + } + + Subscriber getSubscriber() { + return subscriber; + } + + NotificationChannel getChannel() { + return channel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriberAndChannel that = (SubscriberAndChannel) o; + return Objects.equals(subscriber, that.subscriber) && + Objects.equals(channel, that.channel); + } + + @Override + public int hashCode() { + return Objects.hash(subscriber, channel); + } + } + + @VisibleForTesting + protected List<NotificationChannel> getChannels() { + return Arrays.asList(notificationChannels); + } + +} diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationDispatcher.java b/server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationDispatcher.java new file mode 100644 index 00000000000..2c236373c6a --- /dev/null +++ b/server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationDispatcher.java @@ -0,0 +1,122 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 SonarSource SA + * mailto:info 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.notification; + +import org.apache.commons.lang.StringUtils; +import org.sonar.api.ExtensionPoint; +import org.sonar.api.ce.ComputeEngineSide; +import org.sonar.api.notifications.Notification; +import org.sonar.api.notifications.NotificationChannel; +import org.sonar.api.server.ServerSide; + +/** + * <p> + * Plugins should extend this class to provide logic to determine which users are interested in receiving notifications, + * along with which delivery channels they selected. + * </p> + * For example: + * <ul> + * <li>notify me by email when someone comments an issue reported by me</li> + * <li>notify me by twitter when someone comments an issue assigned to me</li> + * <li>notify me by Jabber when someone mentions me in an issue comment</li> + * <li>send me by SMS when there are system notifications (like password reset, account creation, ...)</li> + * </ul> + */ +@ServerSide +@ComputeEngineSide +@ExtensionPoint +public abstract class NotificationDispatcher { + + private final String notificationType; + + /** + * Additional information related to the notification, which will be used + * to know who should receive the notification. + */ + public interface Context { + /** + * Adds a user that will be notified through the given notification channel. + * + * @param userLogin the user login + * @param notificationChannel the notification channel to use for this user + */ + void addUser(String userLogin, NotificationChannel notificationChannel); + } + + /** + * Creates a new dispatcher for notifications of the given type. + * + * @param notificationType the type of notifications handled by this dispatcher + */ + public NotificationDispatcher(String notificationType) { + this.notificationType = notificationType; + } + + /** + * Creates a new generic dispatcher, used for any kind of notification. + * <p/> + * Should be avoided and replaced by the other constructor - as it is easier to understand that a + * dispatcher listens for a specific type of notification. + */ + public NotificationDispatcher() { + this(""); + } + + /** + * The unique key of this dispatcher. By default it's the class name without the package prefix. + * <p/> + * The related label in l10n bundles is 'notification.dispatcher.<key>', for example 'notification.dispatcher.NewFalsePositive'. + */ + public String getKey() { + return getClass().getSimpleName(); + } + + /** + * @since 5.1 + */ + public String getType() { + return notificationType; + } + + /** + * <p> + * Performs the dispatch. + * </p> + */ + public final void performDispatch(Notification notification, Context context) { + if (StringUtils.equals(notification.getType(), notificationType) || StringUtils.equals("", notificationType)) { + dispatch(notification, context); + } + } + + /** + * <p> + * Implements the logic that defines which users will receive the notification. + * </p> + * The purpose of this method is to populate the context object with users, based on the type of notification and the content of the notification. + */ + public abstract void dispatch(Notification notification, Context context); + + @Override + public String toString() { + return getKey(); + } + +} diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationDispatcherMetadata.java b/server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationDispatcherMetadata.java new file mode 100644 index 00000000000..aceed9efa88 --- /dev/null +++ b/server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationDispatcherMetadata.java @@ -0,0 +1,102 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 SonarSource SA + * mailto:info 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.notification; + +import com.google.common.collect.Maps; +import java.util.Map; +import org.sonar.api.ce.ComputeEngineSide; +import org.sonar.api.server.ServerSide; + +/** + * Notification dispatchers (see {@link NotificationDispatcher}) can define their own metadata class in order + * to tell more about them. + * <p> + * Instances of these classes must be declared by {@link org.sonar.api.Plugin}. + * </p> + */ +@ServerSide +@ComputeEngineSide +public final class NotificationDispatcherMetadata { + + public static final String GLOBAL_NOTIFICATION = "globalNotification"; + public static final String PER_PROJECT_NOTIFICATION = "perProjectNotification"; + + private String dispatcherKey; + private Map<String, String> properties; + + private NotificationDispatcherMetadata(String dispatcherKey) { + this.dispatcherKey = dispatcherKey; + this.properties = Maps.newHashMap(); + } + + /** + * Creates a new metadata instance for the given dispatcher. + * <p/> + * By default the key is the class name without package. It can be changed by overriding + * {@link NotificationDispatcher#getKey()}. + */ + public static NotificationDispatcherMetadata create(String dispatcherKey) { + return new NotificationDispatcherMetadata(dispatcherKey); + } + + /** + * Sets a property on this metadata object. + */ + public NotificationDispatcherMetadata setProperty(String key, String value) { + properties.put(key, value); + return this; + } + + /** + * Gives the property for the given key. + */ + public String getProperty(String key) { + return properties.get(key); + } + + /** + * Returns the unique key of the dispatcher. + */ + public String getDispatcherKey() { + return dispatcherKey; + } + + @Override + public String toString() { + return dispatcherKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationDispatcherMetadata that = (NotificationDispatcherMetadata) o; + return dispatcherKey.equals(that.dispatcherKey); + } + + @Override + public int hashCode() { + return dispatcherKey.hashCode(); + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationManager.java b/server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationManager.java index e7a4ab23501..e7a4ab23501 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationManager.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationManager.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/notification/package-info.java b/server/sonar-server-common/src/main/java/org/sonar/server/notification/package-info.java index 0e90a860936..f6a66524408 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/notification/package-info.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/notification/package-info.java @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @ParametersAreNonnullByDefault -package org.sonar.ce.notification; +package org.sonar.server.notification; import javax.annotation.ParametersAreNonnullByDefault; + diff --git a/server/sonar-server/src/main/java/org/sonar/server/organization/DefaultOrganization.java b/server/sonar-server-common/src/main/java/org/sonar/server/organization/DefaultOrganization.java index 24cce29fca9..24cce29fca9 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/organization/DefaultOrganization.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/organization/DefaultOrganization.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/organization/DefaultOrganizationCache.java b/server/sonar-server-common/src/main/java/org/sonar/server/organization/DefaultOrganizationCache.java index 76168e963c6..76168e963c6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/organization/DefaultOrganizationCache.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/organization/DefaultOrganizationCache.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/organization/DefaultOrganizationProvider.java b/server/sonar-server-common/src/main/java/org/sonar/server/organization/DefaultOrganizationProvider.java index 4cd76b2d623..4cd76b2d623 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/organization/DefaultOrganizationProvider.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/organization/DefaultOrganizationProvider.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/organization/DefaultOrganizationProviderImpl.java b/server/sonar-server-common/src/main/java/org/sonar/server/organization/DefaultOrganizationProviderImpl.java index 72ef09bed1f..72ef09bed1f 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/organization/DefaultOrganizationProviderImpl.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/organization/DefaultOrganizationProviderImpl.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/package-info.java b/server/sonar-server-common/src/main/java/org/sonar/server/organization/package-info.java index 86727e023f3..6af0dea31d7 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/package-info.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/organization/package-info.java @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @ParametersAreNonnullByDefault -package org.sonar.ce.taskprocessor; +package org.sonar.server.organization; import javax.annotation.ParametersAreNonnullByDefault; + diff --git a/server/sonar-server/src/main/java/org/sonar/server/property/InternalProperties.java b/server/sonar-server-common/src/main/java/org/sonar/server/property/InternalProperties.java index 15260eaf075..15260eaf075 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/property/InternalProperties.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/property/InternalProperties.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java b/server/sonar-server-common/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java index 55cc690e93e..55cc690e93e 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/property/InternalPropertiesImpl.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/property/MapInternalProperties.java b/server/sonar-server-common/src/main/java/org/sonar/server/property/MapInternalProperties.java index ff799f47cea..ff799f47cea 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/property/MapInternalProperties.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/property/MapInternalProperties.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/property/package-info.java b/server/sonar-server-common/src/main/java/org/sonar/server/property/package-info.java index d5d722326dc..d5d722326dc 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/property/package-info.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/property/package-info.java diff --git a/server/sonar-server/src/test/java/org/sonar/server/notification/DefaultNotificationManagerTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/notification/DefaultNotificationManagerTest.java index dcd3e1981a5..dcd3e1981a5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/notification/DefaultNotificationManagerTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/notification/DefaultNotificationManagerTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/server/notification/NotificationDispatcherMetadataTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/notification/NotificationDispatcherMetadataTest.java index eea8d05fcf7..eea8d05fcf7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/notification/NotificationDispatcherMetadataTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/notification/NotificationDispatcherMetadataTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/server/notification/NotificationDispatcherTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/notification/NotificationDispatcherTest.java index e3532ce6be1..e3532ce6be1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/notification/NotificationDispatcherTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/notification/NotificationDispatcherTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/server/organization/DefaultOrganizationProviderImplTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/organization/DefaultOrganizationProviderImplTest.java index 75ef3d76540..75ef3d76540 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/organization/DefaultOrganizationProviderImplTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/organization/DefaultOrganizationProviderImplTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/server/organization/DefaultOrganizationTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/organization/DefaultOrganizationTest.java index 88ce2ad1740..88ce2ad1740 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/organization/DefaultOrganizationTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/organization/DefaultOrganizationTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java index c3c5fd7601a..c3c5fd7601a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/property/InternalPropertiesImplTest.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/ReportTaskProcessorDeclaration.java b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/ReportTaskProcessorDeclaration.java index 9c2c6f98b31..c2a19e56b3e 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/ReportTaskProcessorDeclaration.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/ReportTaskProcessorDeclaration.java @@ -17,12 +17,13 @@ * 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.ce.taskprocessor; +package org.sonar.ce.task.projectanalysis; import java.util.Collections; import java.util.Set; import org.sonar.ce.task.CeTask; import org.sonar.ce.task.CeTaskResult; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import org.sonar.db.ce.CeTaskTypes; /** diff --git a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotification.java b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotification.java index a2f446e3eb4..a2f446e3eb4 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotification.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotification.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationDispatcher.java b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationDispatcher.java index c7b956522fc..c7b956522fc 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationDispatcher.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationDispatcher.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationEmailTemplate.java b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationEmailTemplate.java index 01475382e0b..01475382e0b 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationEmailTemplate.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationEmailTemplate.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationModule.java b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationModule.java index 7e84b21f85e..7e84b21f85e 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationModule.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationModule.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationSerializer.java b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationSerializer.java index 50079eb86e1..50079eb86e1 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationSerializer.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationSerializer.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationSerializerImpl.java b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationSerializerImpl.java index 0da6c354eec..0da6c354eec 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationSerializerImpl.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationSerializerImpl.java diff --git a/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/package-info.java b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/package-info.java new file mode 100644 index 00000000000..908ed6991b5 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/ce/task/projectanalysis/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 SonarSource SA + * mailto:info 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.ce.task.projectanalysis; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java b/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java index b79929db34f..2d6f0168455 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/server/app/WebServerProcessLogging.java @@ -23,6 +23,7 @@ import ch.qos.logback.classic.Level; import org.sonar.process.ProcessId; import org.sonar.process.logging.LogDomain; import org.sonar.process.logging.LogLevelConfig; +import org.sonar.server.log.ServerProcessLogging; import static org.sonar.server.platform.web.requestid.RequestIdMDCStorage.HTTP_REQUEST_ID_MDC_KEY; diff --git a/server/sonar-server/src/main/java/org/sonar/ce/CeModule.java b/server/sonar-server/src/main/java/org/sonar/server/ce/CeModule.java index 74e5b22bf6e..00442c1ef3c 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/CeModule.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ce/CeModule.java @@ -17,12 +17,12 @@ * 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.ce; +package org.sonar.server.ce; import org.sonar.ce.http.CeHttpClientImpl; import org.sonar.ce.queue.CeQueueImpl; import org.sonar.ce.task.log.CeTaskLogging; -import org.sonar.ce.taskprocessor.ReportTaskProcessorDeclaration; +import org.sonar.ce.task.projectanalysis.ReportTaskProcessorDeclaration; import org.sonar.core.platform.Module; import org.sonar.server.ce.queue.ReportSubmitter; diff --git a/server/sonar-server/src/main/java/org/sonar/ce/log/package-info.java b/server/sonar-server/src/main/java/org/sonar/server/ce/package-info.java index 7c5ada78eae..259e9b9cbaa 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/log/package-info.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ce/package-info.java @@ -18,6 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @ParametersAreNonnullByDefault -package org.sonar.ce.log; +package org.sonar.server.ce; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityAction.java b/server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityAction.java index 67724db7f62..164ca9fd7c5 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityAction.java @@ -35,7 +35,7 @@ import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.web.UserRole; -import org.sonar.ce.taskprocessor.CeTaskProcessor; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import org.sonar.core.util.Uuids; import org.sonar.db.DbClient; import org.sonar.db.DbSession; diff --git a/server/sonar-server/src/main/java/org/sonar/server/ce/ws/TaskTypesAction.java b/server/sonar-server/src/main/java/org/sonar/server/ce/ws/TaskTypesAction.java index c401e6dbdac..15dd8ad7ef3 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/ce/ws/TaskTypesAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ce/ws/TaskTypesAction.java @@ -24,7 +24,7 @@ import java.util.Set; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; -import org.sonar.ce.taskprocessor.CeTaskProcessor; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import org.sonarqube.ws.Ce; import static org.sonar.server.ws.WsUtils.writeProtobuf; diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java b/server/sonar-server/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java index d252a90156a..8f132fd72ee 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java @@ -27,7 +27,7 @@ import org.sonar.api.utils.log.Loggers; import org.sonar.process.ProcessProperties; import org.sonar.server.platform.db.migration.version.DatabaseVersion; -import static org.sonar.server.app.ServerProcessLogging.STARTUP_LOGGER_NAME; +import static org.sonar.server.log.ServerProcessLogging.STARTUP_LOGGER_NAME; public class DatabaseServerCompatibility implements Startable { diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java index 1473be4594e..c1e4b87780d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java @@ -32,7 +32,7 @@ import org.sonar.api.utils.log.LoggerLevel; import org.sonar.api.utils.log.Loggers; import org.sonar.db.Database; import org.sonar.process.logging.LogbackHelper; -import org.sonar.server.app.ServerProcessLogging; +import org.sonar.server.log.ServerProcessLogging; import static org.sonar.api.utils.log.LoggerLevel.TRACE; import static org.sonar.process.ProcessProperties.Property.PATH_LOGS; 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 3b9dc86758c..0b1e7bcfbab 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 @@ -28,7 +28,7 @@ import org.sonar.api.resources.ResourceTypes; import org.sonar.api.rules.AnnotationRuleParser; import org.sonar.api.rules.XMLRuleParser; import org.sonar.api.server.rule.RulesDefinitionXmlLoader; -import org.sonar.ce.CeModule; +import org.sonar.server.ce.CeModule; import org.sonar.ce.notification.ReportAnalysisFailureNotificationModule; import org.sonar.core.component.DefaultResourceTypes; import org.sonar.core.extension.CoreExtensionsInstaller; diff --git a/server/sonar-server/src/test/java/org/sonar/ce/taskprocessor/ReportTaskProcessorDeclarationTest.java b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/ReportTaskProcessorDeclarationTest.java index fd967656814..971c3e8cf93 100644 --- a/server/sonar-server/src/test/java/org/sonar/ce/taskprocessor/ReportTaskProcessorDeclarationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/ReportTaskProcessorDeclarationTest.java @@ -17,7 +17,7 @@ * 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.ce.taskprocessor; +package org.sonar.ce.task.projectanalysis; import org.junit.Rule; import org.junit.Test; diff --git a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationDispatcherTest.java b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationDispatcherTest.java index 92b1c0b126e..92b1c0b126e 100644 --- a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationDispatcherTest.java +++ b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationDispatcherTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationEmailTemplateTest.java b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationEmailTemplateTest.java index daf31c43421..daf31c43421 100644 --- a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationEmailTemplateTest.java +++ b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationEmailTemplateTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationModuleTest.java b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationModuleTest.java index aa1db53ec57..aa1db53ec57 100644 --- a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationModuleTest.java +++ b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationModuleTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationSerializerImplTest.java b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationSerializerImplTest.java index 81bfbf5233b..81bfbf5233b 100644 --- a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationSerializerImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationSerializerImplTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationTest.java b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationTest.java index 0652c345a45..0652c345a45 100644 --- a/server/sonar-server/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationTest.java diff --git a/server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityActionTest.java index a55739065f3..6a584456b73 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityActionTest.java @@ -29,7 +29,7 @@ import org.junit.rules.ExpectedException; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; -import org.sonar.ce.taskprocessor.CeTaskProcessor; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import org.sonar.core.util.Uuids; import org.sonar.db.DbTester; import org.sonar.db.ce.CeActivityDto; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ce/ws/TaskTypesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/ce/ws/TaskTypesActionTest.java index 18aec801e52..94ce532bb9d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ce/ws/TaskTypesActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ce/ws/TaskTypesActionTest.java @@ -24,7 +24,7 @@ import java.util.Set; import org.junit.Test; import org.sonar.ce.task.CeTask; import org.sonar.ce.task.CeTaskResult; -import org.sonar.ce.taskprocessor.CeTaskProcessor; +import org.sonar.ce.task.taskprocessor.CeTaskProcessor; import org.sonar.server.ws.WsActionTester; import static org.sonar.test.JsonAssert.assertJson; diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java index 5d97692eb8f..c69492a19ee 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java @@ -37,7 +37,7 @@ import org.sonar.api.utils.log.LoggerLevel; import org.sonar.db.Database; import org.sonar.process.logging.LogLevelConfig; import org.sonar.process.logging.LogbackHelper; -import org.sonar.server.app.ServerProcessLogging; +import org.sonar.server.log.ServerProcessLogging; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; |