aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2015-08-13 09:54:48 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-08-13 15:34:18 +0200
commitfc575b3db63edd279a8b8cdda69331b4382b68d8 (patch)
treedfbde4ecbcae6aa763e8cc3dd74a54894c533c7a /sonar-batch
parent542b5c9d4e53be42ba3343cbc2ab62a764d4e904 (diff)
downloadsonarqube-fc575b3db63edd279a8b8cdda69331b4382b68d8.tar.gz
sonarqube-fc575b3db63edd279a8b8cdda69331b4382b68d8.zip
refactor batch class names/packages
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisProperties.java (renamed from sonar-batch/src/main/java/org/sonar/batch/bootstrap/AnalysisProperties.java)4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisTempFolderProvider.java (renamed from sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectTempFolderProvider.java)6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisWSLoaderProvider.java (renamed from sonar-batch/src/main/java/org/sonar/batch/scan/ProjectWSLoaderProvider.java)9
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/analysis/DefaultAnalysisMode.java (renamed from sonar-batch/src/main/java/org/sonar/batch/scan/ProjectAnalysisMode.java)12
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/analysis/package-info.java23
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginInstaller.java2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalContainer.java16
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalMode.java2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalProperties.java (renamed from sonar-batch/src/main/java/org/sonar/batch/bootstrap/BootstrapProperties.java)4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalSettings.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalTempFolderProvider.java (renamed from sonar-batch/src/main/java/org/sonar/batch/bootstrap/TempFolderProvider.java)12
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cache/PersistentCacheProvider.java (renamed from sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java)6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cache/ProjectCacheSynchronizer.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cache/ProjectSyncContainer.java8
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cache/StrategyWSLoaderProvider.java5
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cache/WSLoader.java (renamed from sonar-batch/src/main/java/org/sonar/batch/bootstrap/WSLoader.java)8
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/index/IndexFactory.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoader.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/phases/PhaseExecutor.java8
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/repository/DefaultGlobalRepositoriesLoader.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoader.java12
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/repository/DefaultServerIssuesLoader.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesLoader.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesProvider.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/repository/user/UserRepositoryLoader.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/rule/DefaultRulesLoader.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilder.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/MutableProjectReactorProvider.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java15
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/report/IssuesReports.java6
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/analysis/AnalysisTempFolderProviderTest.java (renamed from sonar-batch/src/test/java/org/sonar/batch/bootstrap/ProjectTempFolderProviderTest.java)14
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/analysis/AnalysisWSLoaderProviderTest.java (renamed from sonar-batch/src/test/java/org/sonar/batch/scan/ProjectWSLoaderProviderTest.java)16
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/analysis/DefaultAnalysisModeTest.java (renamed from sonar-batch/src/test/java/org/sonar/batch/scan/ProjectAnalysisModeTest.java)28
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginInstallerTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalModeTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalPropertiesTest.java (renamed from sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapPropertiesTest.java)4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalTempFolderProviderTest.java (renamed from sonar-batch/src/test/java/org/sonar/batch/bootstrap/TempFolderProviderTest.java)14
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/ServerClientTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cache/PersistentCacheProviderTest.java (renamed from sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java)11
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java9
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cache/StrategyWSLoaderProviderTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cache/WSLoaderTest.java (renamed from sonar-batch/src/test/java/org/sonar/batch/bootstrap/WSLoaderTest.java)9
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cache/WSLoaderTestWithServer.java (renamed from sonar-batch/src/test/java/org/sonar/batch/bootstrap/WSLoaderTestWithServer.java)14
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cpd/index/IndexFactoryTest.java6
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java6
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoaderTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java3
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/platform/DefaultServerTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java6
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java12
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/repository/DefaultServerIssuesLoaderTest.java3
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/repository/user/UserRepositoryLoaderTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/rule/DefaultRulesLoaderTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest.java3
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/ModuleSettingsTest.java6
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java3
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java13
66 files changed, 269 insertions, 186 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/AnalysisProperties.java b/sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisProperties.java
index 8a514c6db45..aa834f77c57 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/AnalysisProperties.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisProperties.java
@@ -17,7 +17,9 @@
* 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.batch.bootstrap;
+package org.sonar.batch.analysis;
+
+import org.sonar.batch.bootstrap.UserProperties;
import javax.annotation.Nullable;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectTempFolderProvider.java b/sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisTempFolderProvider.java
index 5627faf5abf..639a932fb36 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectTempFolderProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisTempFolderProvider.java
@@ -17,7 +17,9 @@
* 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.batch.bootstrap;
+package org.sonar.batch.analysis;
+
+import org.sonar.batch.bootstrap.LifecycleProviderAdapter;
import org.sonar.api.utils.TempFolder;
import org.apache.commons.lang.StringUtils;
@@ -29,7 +31,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-public class ProjectTempFolderProvider extends LifecycleProviderAdapter {
+public class AnalysisTempFolderProvider extends LifecycleProviderAdapter {
static final String TMP_NAME = ".sonartmp";
private DefaultTempFolder projectTempFolder;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectWSLoaderProvider.java b/sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisWSLoaderProvider.java
index 7af51a25cc8..dc91e97a2be 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectWSLoaderProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/analysis/AnalysisWSLoaderProvider.java
@@ -17,20 +17,19 @@
* 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.batch.scan;
+package org.sonar.batch.analysis;
+import org.sonar.batch.cache.WSLoader;
+import org.sonar.batch.cache.WSLoader.LoadStrategy;
import org.picocontainer.injectors.ProviderAdapter;
import java.util.Map;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.bootstrap.ServerClient;
-import org.sonar.batch.bootstrap.WSLoader;
import org.sonar.home.cache.PersistentCache;
import org.sonar.api.batch.AnalysisMode;
-import org.sonar.batch.bootstrap.WSLoader.LoadStrategy;
-public class ProjectWSLoaderProvider extends ProviderAdapter {
+public class AnalysisWSLoaderProvider extends ProviderAdapter {
private WSLoader wsLoader;
public WSLoader provide(AnalysisProperties props, AnalysisMode mode, PersistentCache cache, ServerClient client) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectAnalysisMode.java b/sonar-batch/src/main/java/org/sonar/batch/analysis/DefaultAnalysisMode.java
index 58f9b1ccc1d..74e32685711 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectAnalysisMode.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/analysis/DefaultAnalysisMode.java
@@ -17,13 +17,11 @@
* 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.batch.scan;
+package org.sonar.batch.analysis;
import org.sonar.batch.mediumtest.FakePluginInstaller;
-
import org.apache.commons.lang.StringUtils;
-import org.sonar.batch.bootstrap.BootstrapProperties;
-import org.sonar.batch.bootstrap.AnalysisProperties;
+import org.sonar.batch.bootstrap.GlobalProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.CoreProperties;
@@ -34,15 +32,15 @@ import java.util.Map;
/**
* @since 4.0
*/
-public class ProjectAnalysisMode implements AnalysisMode {
+public class DefaultAnalysisMode implements AnalysisMode {
- private static final Logger LOG = LoggerFactory.getLogger(ProjectAnalysisMode.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultAnalysisMode.class);
private boolean preview;
private boolean issues;
private boolean mediumTestMode;
- public ProjectAnalysisMode(BootstrapProperties globalProps, AnalysisProperties props) {
+ public DefaultAnalysisMode(GlobalProperties globalProps, AnalysisProperties props) {
init(globalProps.properties(), props.properties());
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/analysis/package-info.java b/sonar-batch/src/main/java/org/sonar/batch/analysis/package-info.java
new file mode 100644
index 00000000000..fb87cb6ffb3
--- /dev/null
+++ b/sonar-batch/src/main/java/org/sonar/batch/analysis/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube 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.
+ *
+ * SonarQube 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.batch.analysis;
+
+import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginInstaller.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginInstaller.java
index fb278f7ea85..dfe0a1405dc 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginInstaller.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginInstaller.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.bootstrap;
+import org.sonar.batch.cache.WSLoader;
+
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalContainer.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalContainer.java
index aa9faaf72e6..7fdba09eeb4 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalContainer.java
@@ -19,10 +19,12 @@
*/
package org.sonar.batch.bootstrap;
-import org.sonar.batch.bootstrap.WSLoader.LoadStrategy;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+import org.sonar.batch.cache.PersistentCacheProvider;
+import org.sonar.batch.cache.WSLoader.LoadStrategy;
+import org.sonar.batch.analysis.AnalysisProperties;
import org.sonar.batch.cache.StrategyWSLoaderProvider;
-import org.sonar.batch.scan.ProjectAnalysisMode;
import org.sonar.batch.cache.ProjectSyncContainer;
import org.sonar.batch.rule.RulesLoader;
import org.sonar.batch.rule.DefaultRulesLoader;
@@ -71,7 +73,7 @@ public class GlobalContainer extends ComponentContainer {
@Override
protected void doBeforeStart() {
- BootstrapProperties bootstrapProps = new BootstrapProperties(bootstrapProperties);
+ GlobalProperties bootstrapProps = new GlobalProperties(bootstrapProperties);
StrategyWSLoaderProvider wsLoaderProvider = forceSync ? new StrategyWSLoaderProvider(LoadStrategy.SERVER_ONLY) : new StrategyWSLoaderProvider(LoadStrategy.SERVER_FIRST);
add(wsLoaderProvider);
add(bootstrapProps);
@@ -95,7 +97,7 @@ public class GlobalContainer extends ComponentContainer {
ServerClient.class,
Logback.class,
DefaultServer.class,
- new TempFolderProvider(),
+ new GlobalTempFolderProvider(),
DefaultHttpDownloader.class,
UriReader.class,
new FileCacheProvider(),
@@ -124,7 +126,7 @@ public class GlobalContainer extends ComponentContainer {
}
public void executeAnalysis(Map<String, String> analysisProperties, Object... components) {
- AnalysisProperties props = new AnalysisProperties(analysisProperties, this.getComponentByType(BootstrapProperties.class).property(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
+ AnalysisProperties props = new AnalysisProperties(analysisProperties, this.getComponentByType(GlobalProperties.class).property(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
if (isIssuesMode(props)) {
new ProjectSyncContainer(this, props, false).execute();
}
@@ -132,12 +134,12 @@ public class GlobalContainer extends ComponentContainer {
}
public void syncProject(Map<String, String> analysisProperties, boolean force) {
- AnalysisProperties props = new AnalysisProperties(analysisProperties, this.getComponentByType(BootstrapProperties.class).property(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
+ AnalysisProperties props = new AnalysisProperties(analysisProperties, this.getComponentByType(GlobalProperties.class).property(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
new ProjectSyncContainer(this, props, force).execute();
}
private boolean isIssuesMode(AnalysisProperties props) {
- ProjectAnalysisMode mode = new ProjectAnalysisMode(this.getComponentByType(BootstrapProperties.class), props);
+ DefaultAnalysisMode mode = new DefaultAnalysisMode(this.getComponentByType(GlobalProperties.class), props);
return mode.isIssues();
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalMode.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalMode.java
index a4341c96fe2..245ca4d5688 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalMode.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalMode.java
@@ -42,7 +42,7 @@ public class GlobalMode {
return !preview && !issues;
}
- public GlobalMode(BootstrapProperties props) {
+ public GlobalMode(GlobalProperties props) {
String mode = props.property(CoreProperties.ANALYSIS_MODE);
validate(mode);
preview = CoreProperties.ANALYSIS_MODE_PREVIEW.equals(mode);
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BootstrapProperties.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalProperties.java
index 97db4c2b3df..c132d7f4a40 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BootstrapProperties.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalProperties.java
@@ -27,9 +27,9 @@ import java.util.Map;
* Immutable batch properties that are not specific to a task (for example
* coming from global configuration file of sonar-runner).
*/
-public class BootstrapProperties extends UserProperties {
+public class GlobalProperties extends UserProperties {
- public BootstrapProperties(Map<String, String> properties) {
+ public GlobalProperties(Map<String, String> properties) {
super(properties, properties.get(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalSettings.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalSettings.java
index 5acd980e3a3..4469efd3767 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalSettings.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalSettings.java
@@ -46,11 +46,11 @@ public class GlobalSettings extends Settings {
"sonar.jdbc.password", JDBC_SPECIFIC_MESSAGE
);
- private final BootstrapProperties bootstrapProps;
+ private final GlobalProperties bootstrapProps;
private final GlobalRepositories globalReferentials;
private final GlobalMode mode;
- public GlobalSettings(BootstrapProperties bootstrapProps, PropertyDefinitions propertyDefinitions,
+ public GlobalSettings(GlobalProperties bootstrapProps, PropertyDefinitions propertyDefinitions,
GlobalRepositories globalReferentials, GlobalMode mode) {
super(propertyDefinitions);
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TempFolderProvider.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalTempFolderProvider.java
index b703c01a724..e86114efb2e 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TempFolderProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalTempFolderProvider.java
@@ -36,8 +36,8 @@ import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.concurrent.TimeUnit;
-public class TempFolderProvider extends LifecycleProviderAdapter {
- private static final Logger LOG = Loggers.get(TempFolderProvider.class);
+public class GlobalTempFolderProvider extends LifecycleProviderAdapter {
+ private static final Logger LOG = Loggers.get(GlobalTempFolderProvider.class);
private static final long CLEAN_MAX_AGE = TimeUnit.DAYS.toMillis(21);
static final String TMP_NAME_PREFIX = ".sonartmp_";
@@ -45,15 +45,15 @@ public class TempFolderProvider extends LifecycleProviderAdapter {
private System2 system;
private DefaultTempFolder tempFolder;
- public TempFolderProvider() {
+ public GlobalTempFolderProvider() {
this(new System2());
}
- TempFolderProvider(System2 system) {
+ GlobalTempFolderProvider(System2 system) {
this.system = system;
}
- public TempFolder provide(BootstrapProperties bootstrapProps) {
+ public TempFolder provide(GlobalProperties bootstrapProps) {
if (tempFolder == null) {
String workingPathName = StringUtils.defaultIfBlank(bootstrapProps.property(CoreProperties.GLOBAL_WORKING_DIRECTORY), CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE);
@@ -90,7 +90,7 @@ public class TempFolderProvider extends LifecycleProviderAdapter {
}
}
- private Path findHome(BootstrapProperties props) {
+ private Path findHome(GlobalProperties props) {
String home = props.property("sonar.userHome");
if (home != null) {
return Paths.get(home);
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java
index ef24962e6a8..0faef082627 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java
@@ -57,10 +57,10 @@ import org.sonar.core.util.DefaultHttpDownloader;
public class ServerClient {
private static final String GET = "GET";
- private BootstrapProperties props;
+ private GlobalProperties props;
private DefaultHttpDownloader.BaseHttpDownloader downloader;
- public ServerClient(BootstrapProperties settings, EnvironmentInformation env) {
+ public ServerClient(GlobalProperties settings, EnvironmentInformation env) {
this.props = settings;
this.downloader = new DefaultHttpDownloader.BaseHttpDownloader(settings.properties(), env.toString());
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java b/sonar-batch/src/main/java/org/sonar/batch/cache/PersistentCacheProvider.java
index 05b3e058bc1..878554d2499 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cache/PersistentCacheProvider.java
@@ -17,7 +17,10 @@
* 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.batch.bootstrap;
+package org.sonar.batch.cache;
+
+import org.sonar.batch.bootstrap.Slf4jLogger;
+import org.sonar.batch.bootstrap.UserProperties;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
@@ -56,6 +59,7 @@ public class PersistentCacheProvider extends ProviderAdapter {
private String getVersion() {
InputStream is = this.getClass().getClassLoader().getResourceAsStream("sq-version.txt");
if (is == null) {
+ LOG.warn("Failed to get SQ version");
return null;
}
try (BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/cache/ProjectCacheSynchronizer.java b/sonar-batch/src/main/java/org/sonar/batch/cache/ProjectCacheSynchronizer.java
index 58c98c52f68..a813b0817e9 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/cache/ProjectCacheSynchronizer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cache/ProjectCacheSynchronizer.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.cache;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import org.apache.commons.lang.mutable.MutableBoolean;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.utils.log.Loggers;
@@ -26,7 +28,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.utils.log.Profiler;
import org.sonar.api.batch.bootstrap.ProjectReactor;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.protocol.input.BatchInput.ServerIssue;
import com.google.common.base.Function;
import org.sonar.batch.protocol.input.FileData;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/cache/ProjectSyncContainer.java b/sonar-batch/src/main/java/org/sonar/batch/cache/ProjectSyncContainer.java
index ad599572315..dc4957bac92 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/cache/ProjectSyncContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cache/ProjectSyncContainer.java
@@ -19,13 +19,13 @@
*/
package org.sonar.batch.cache;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+import org.sonar.batch.cache.WSLoader.LoadStrategy;
+import org.sonar.batch.analysis.AnalysisProperties;
import org.apache.commons.lang.StringUtils;
-import org.sonar.batch.bootstrap.WSLoader.LoadStrategy;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.bootstrap.ProjectReactor;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.repository.user.UserRepositoryLoader;
import org.sonar.batch.issue.tracking.ServerLineHashesLoader;
import org.sonar.batch.repository.DefaultProjectRepositoriesLoader;
@@ -71,7 +71,7 @@ public class ProjectSyncContainer extends ComponentContainer {
private void addComponents() {
add(new StrategyWSLoaderProvider(LoadStrategy.SERVER_FIRST),
properties,
- ProjectAnalysisMode.class,
+ DefaultAnalysisMode.class,
ProjectCacheSynchronizer.class,
UserRepositoryLoader.class);
diff --git a/sonar-batch/src/main/java/org/sonar/batch/cache/StrategyWSLoaderProvider.java b/sonar-batch/src/main/java/org/sonar/batch/cache/StrategyWSLoaderProvider.java
index c8b96b2e599..ecd7ef8f405 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/cache/StrategyWSLoaderProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cache/StrategyWSLoaderProvider.java
@@ -19,11 +19,10 @@
*/
package org.sonar.batch.cache;
-import org.picocontainer.injectors.ProviderAdapter;
+import org.sonar.batch.cache.WSLoader.LoadStrategy;
+import org.picocontainer.injectors.ProviderAdapter;
import org.sonar.batch.bootstrap.ServerClient;
-import org.sonar.batch.bootstrap.WSLoader;
-import org.sonar.batch.bootstrap.WSLoader.LoadStrategy;
import org.sonar.home.cache.PersistentCache;
public class StrategyWSLoaderProvider extends ProviderAdapter {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/WSLoader.java b/sonar-batch/src/main/java/org/sonar/batch/cache/WSLoader.java
index 9e2e7da5244..4b1eed504f0 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/WSLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cache/WSLoader.java
@@ -17,7 +17,10 @@
* 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.batch.bootstrap;
+package org.sonar.batch.cache;
+
+import org.sonar.batch.bootstrap.ServerClient;
+import org.sonar.batch.bootstrap.WSLoaderResult;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
@@ -32,7 +35,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
-import static org.sonar.batch.bootstrap.WSLoader.ServerStatus.*;
+import static org.sonar.batch.cache.WSLoader.ServerStatus.*;
+
import org.sonar.home.cache.PersistentCache;
public class WSLoader {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/cpd/index/IndexFactory.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/IndexFactory.java
index a1d37f682db..31a4b03ce55 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/cpd/index/IndexFactory.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/IndexFactory.java
@@ -19,7 +19,7 @@
*/
package org.sonar.batch.cpd.index;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
import com.google.common.annotations.VisibleForTesting;
@@ -36,9 +36,9 @@ import org.sonar.api.resources.Project;
public class IndexFactory {
private final Settings settings;
- private final ProjectAnalysisMode mode;
+ private final DefaultAnalysisMode mode;
- public IndexFactory(ProjectAnalysisMode mode, Settings settings) {
+ public IndexFactory(DefaultAnalysisMode mode, Settings settings) {
this.mode = mode;
this.settings = settings;
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoader.java b/sonar-batch/src/main/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoader.java
index 411651dc990..95838a13806 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoader.java
@@ -19,13 +19,14 @@
*/
package org.sonar.batch.issue.tracking;
+import org.sonar.batch.cache.WSLoader;
+
import org.apache.commons.lang.mutable.MutableBoolean;
import javax.annotation.Nullable;
import org.sonar.batch.bootstrap.WSLoaderResult;
import org.sonar.batch.util.BatchUtils;
-import org.sonar.batch.bootstrap.WSLoader;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterators;
import org.sonar.api.utils.log.Loggers;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/phases/PhaseExecutor.java b/sonar-batch/src/main/java/org/sonar/batch/phases/PhaseExecutor.java
index 780c39cc3cb..54ff9c59f68 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/phases/PhaseExecutor.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/phases/PhaseExecutor.java
@@ -19,9 +19,9 @@
*/
package org.sonar.batch.phases;
-import org.sonar.batch.issue.IssueCallback;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.issue.IssueCallback;
import org.sonar.api.batch.SensorContext;
import org.sonar.api.resources.Project;
import org.sonar.batch.events.BatchStepEvent;
@@ -50,7 +50,7 @@ public final class PhaseExecutor {
private final QProfileVerifier profileVerifier;
private final IssueExclusionsLoader issueExclusionsLoader;
private final IssuesReports issuesReport;
- private final ProjectAnalysisMode analysisMode;
+ private final DefaultAnalysisMode analysisMode;
private final LocalIssueTracking localIssueTracking;
private final IssueCallback issueCallback;
@@ -58,7 +58,7 @@ public final class PhaseExecutor {
SensorContext sensorContext, DefaultIndex index,
EventBus eventBus, ReportPublisher reportPublisher, ProjectInitializer pi,
FileSystemLogger fsLogger, IssuesReports jsonReport, DefaultModuleFileSystem fs, QProfileVerifier profileVerifier,
- IssueExclusionsLoader issueExclusionsLoader, ProjectAnalysisMode analysisMode, LocalIssueTracking localIssueTracking, IssueCallback issueCallback) {
+ IssueExclusionsLoader issueExclusionsLoader, DefaultAnalysisMode analysisMode, LocalIssueTracking localIssueTracking, IssueCallback issueCallback) {
this.postJobsExecutor = postJobsExecutor;
this.initializersExecutor = initializersExecutor;
this.sensorsExecutor = sensorsExecutor;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java b/sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java
index 0102366217d..152ff874f27 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java
@@ -21,7 +21,7 @@ package org.sonar.batch.platform;
import org.apache.commons.lang.StringUtils;
-import org.sonar.batch.bootstrap.BootstrapProperties;
+import org.sonar.batch.bootstrap.GlobalProperties;
import org.slf4j.LoggerFactory;
import org.sonar.api.batch.BatchSide;
import org.sonar.api.CoreProperties;
@@ -39,9 +39,9 @@ import java.util.Date;
public class DefaultServer extends Server {
private Settings settings;
- private BootstrapProperties props;
+ private GlobalProperties props;
- public DefaultServer(Settings settings, BootstrapProperties props) {
+ public DefaultServer(Settings settings, GlobalProperties props) {
this.settings = settings;
this.props = props;
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java b/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
index 1da5585e762..a76c4b216c9 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
@@ -46,7 +46,7 @@ import org.sonar.api.batch.events.SensorsPhaseHandler;
import org.sonar.api.resources.Project;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.TimeUtils;
-import org.sonar.batch.bootstrap.BootstrapProperties;
+import org.sonar.batch.bootstrap.GlobalProperties;
import org.sonar.batch.events.BatchStepHandler;
import org.sonar.batch.util.BatchUtils;
@@ -85,7 +85,7 @@ public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorEx
println(sb.toString());
}
- public PhasesSumUpTimeProfiler(System2 system, BootstrapProperties bootstrapProps) {
+ public PhasesSumUpTimeProfiler(System2 system, GlobalProperties bootstrapProps) {
String workingDirPath = StringUtils.defaultIfBlank(bootstrapProps.property(CoreProperties.WORKING_DIRECTORY), CoreProperties.WORKING_DIRECTORY_DEFAULT_VALUE);
File workingDir = new File(workingDirPath).getAbsoluteFile();
this.out = new File(workingDir, "profiling");
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java
index 0772cbda31f..6638fbd4721 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java
@@ -19,7 +19,7 @@
*/
package org.sonar.batch.report;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
import org.sonar.batch.util.BatchUtils;
import com.github.kevinsawicki.http.HttpRequest;
@@ -60,7 +60,7 @@ public class ReportPublisher implements Startable {
private final Server server;
private final Settings settings;
private final ImmutableProjectReactor projectReactor;
- private final ProjectAnalysisMode analysisMode;
+ private final DefaultAnalysisMode analysisMode;
private final TempFolder temp;
private ReportPublisherStep[] publishers;
@@ -69,7 +69,7 @@ public class ReportPublisher implements Startable {
private BatchReportWriter writer;
public ReportPublisher(Settings settings, ServerClient serverClient, Server server,
- ImmutableProjectReactor projectReactor, ProjectAnalysisMode analysisMode, TempFolder temp, ReportPublisherStep[] publishers) {
+ ImmutableProjectReactor projectReactor, DefaultAnalysisMode analysisMode, TempFolder temp, ReportPublisherStep[] publishers) {
this.serverClient = serverClient;
this.server = server;
this.projectReactor = projectReactor;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultGlobalRepositoriesLoader.java b/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultGlobalRepositoriesLoader.java
index a26d110646f..3052c4a68b1 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultGlobalRepositoriesLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultGlobalRepositoriesLoader.java
@@ -19,11 +19,12 @@
*/
package org.sonar.batch.repository;
+import org.sonar.batch.cache.WSLoader;
+
import javax.annotation.Nullable;
import org.apache.commons.lang.mutable.MutableBoolean;
import org.sonar.batch.bootstrap.WSLoaderResult;
-import org.sonar.batch.bootstrap.WSLoader;
import org.sonar.batch.protocol.input.GlobalRepositories;
public class DefaultGlobalRepositoriesLoader implements GlobalRepositoriesLoader {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoader.java b/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoader.java
index 4481de42aec..8be04c95de0 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoader.java
@@ -19,17 +19,19 @@
*/
package org.sonar.batch.repository;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+
+import org.sonar.batch.cache.WSLoader;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import javax.annotation.Nullable;
import org.apache.commons.lang.mutable.MutableBoolean;
-import org.sonar.batch.scan.ProjectAnalysisMode;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.batch.bootstrap.WSLoaderResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.utils.MessageException;
-import org.sonar.batch.bootstrap.AnalysisProperties;
-import org.sonar.batch.bootstrap.WSLoader;
import org.sonar.batch.protocol.input.ProjectRepositories;
import org.sonar.batch.rule.ModuleQProfiles;
import org.sonar.batch.util.BatchUtils;
@@ -40,9 +42,9 @@ public class DefaultProjectRepositoriesLoader implements ProjectRepositoriesLoad
private static final String BATCH_PROJECT_URL = "/batch/project";
private final WSLoader wsLoader;
- private final ProjectAnalysisMode analysisMode;
+ private final DefaultAnalysisMode analysisMode;
- public DefaultProjectRepositoriesLoader(WSLoader wsLoader, ProjectAnalysisMode analysisMode) {
+ public DefaultProjectRepositoriesLoader(WSLoader wsLoader, DefaultAnalysisMode analysisMode) {
this.wsLoader = wsLoader;
this.analysisMode = analysisMode;
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultServerIssuesLoader.java b/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultServerIssuesLoader.java
index 048f869e316..edc160daf66 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultServerIssuesLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/repository/DefaultServerIssuesLoader.java
@@ -19,11 +19,11 @@
*/
package org.sonar.batch.repository;
-import org.sonar.batch.bootstrap.WSLoaderResult;
+import org.sonar.batch.cache.WSLoader;
+import org.sonar.batch.bootstrap.WSLoaderResult;
import org.sonar.batch.util.BatchUtils;
import com.google.common.io.ByteSource;
-import org.sonar.batch.bootstrap.WSLoader;
import com.google.common.base.Function;
import org.sonar.batch.protocol.input.BatchInput.ServerIssue;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesLoader.java b/sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesLoader.java
index e0f120f503c..444af1a3b62 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesLoader.java
@@ -19,11 +19,12 @@
*/
package org.sonar.batch.repository;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import javax.annotation.Nullable;
import org.apache.commons.lang.mutable.MutableBoolean;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.protocol.input.ProjectRepositories;
public interface ProjectRepositoriesLoader {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesProvider.java b/sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesProvider.java
index 34c4f14f0e0..b2c86b9e2c0 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/repository/ProjectRepositoriesProvider.java
@@ -19,15 +19,15 @@
*/
package org.sonar.batch.repository;
-import org.apache.commons.lang.mutable.MutableBoolean;
+import org.sonar.batch.analysis.AnalysisProperties;
+import org.apache.commons.lang.mutable.MutableBoolean;
import org.picocontainer.injectors.ProviderAdapter;
import org.sonar.api.batch.AnalysisMode;
import org.sonar.api.batch.bootstrap.ProjectReactor;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.api.utils.log.Profiler;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.protocol.input.ProjectRepositories;
public class ProjectRepositoriesProvider extends ProviderAdapter {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/repository/user/UserRepositoryLoader.java b/sonar-batch/src/main/java/org/sonar/batch/repository/user/UserRepositoryLoader.java
index 82e8ec1b991..d76d420161d 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/repository/user/UserRepositoryLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/repository/user/UserRepositoryLoader.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.repository.user;
+import org.sonar.batch.cache.WSLoader;
+
import javax.annotation.Nullable;
import org.apache.commons.lang.mutable.MutableBoolean;
@@ -26,7 +28,6 @@ import com.google.common.collect.Lists;
import com.google.common.base.Joiner;
import org.sonar.batch.bootstrap.WSLoaderResult;
import org.sonar.batch.util.BatchUtils;
-import org.sonar.batch.bootstrap.WSLoader;
import com.google.common.io.ByteSource;
import com.google.common.base.Function;
import org.sonar.batch.protocol.input.BatchInput;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/rule/DefaultRulesLoader.java b/sonar-batch/src/main/java/org/sonar/batch/rule/DefaultRulesLoader.java
index 8837e326946..a84e02e9bf7 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/rule/DefaultRulesLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/rule/DefaultRulesLoader.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.rule;
+import org.sonar.batch.cache.WSLoader;
+
import javax.annotation.Nullable;
import org.apache.commons.lang.mutable.MutableBoolean;
@@ -31,8 +33,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.List;
-import org.sonar.batch.bootstrap.WSLoader;
-
public class DefaultRulesLoader implements RulesLoader {
private static final String RULES_SEARCH_URL = "/api/rules/list";
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilder.java
index fd978602829..38388b50ede 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilder.java
@@ -19,8 +19,9 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import org.sonar.api.batch.bootstrap.ProjectDefinition;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import java.io.File;
import java.io.IOException;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java
index a5e2e20d6f4..f8b770f59dd 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleSettings.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+
import com.google.common.collect.Lists;
import java.util.List;
@@ -36,10 +38,10 @@ import org.sonar.batch.protocol.input.ProjectRepositories;
public class ModuleSettings extends Settings {
private final ProjectRepositories projectReferentials;
- private ProjectAnalysisMode analysisMode;
+ private DefaultAnalysisMode analysisMode;
public ModuleSettings(GlobalSettings batchSettings, ProjectDefinition moduleDefinition, ProjectRepositories projectReferentials,
- ProjectAnalysisMode analysisMode) {
+ DefaultAnalysisMode analysisMode) {
super(batchSettings.getDefinitions());
this.projectReferentials = projectReferentials;
this.analysisMode = analysisMode;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/MutableProjectReactorProvider.java b/sonar-batch/src/main/java/org/sonar/batch/scan/MutableProjectReactorProvider.java
index 412da07aef6..b9a8a1cf460 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/MutableProjectReactorProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/MutableProjectReactorProvider.java
@@ -19,11 +19,12 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import org.picocontainer.injectors.ProviderAdapter;
import org.sonar.api.batch.bootstrap.ProjectBootstrapper;
import org.sonar.api.batch.bootstrap.ProjectReactor;
import org.sonar.api.utils.SonarException;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import javax.annotation.Nullable;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
index 9729e8c51b7..7b5cd129fac 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
@@ -19,8 +19,11 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
+
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
@@ -33,8 +36,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
+
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
+
import org.apache.commons.io.filefilter.AndFileFilter;
import org.apache.commons.io.filefilter.FileFileFilter;
import org.apache.commons.io.filefilter.IOFileFilter;
@@ -47,7 +52,6 @@ import org.sonar.api.batch.bootstrap.ProjectReactor;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.api.utils.log.Profiler;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.util.BatchUtils;
/**
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java
index 508af5d6b52..869a64b4c93 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectScanContainer.java
@@ -19,6 +19,11 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+
+import org.sonar.batch.analysis.AnalysisWSLoaderProvider;
+import org.sonar.batch.analysis.AnalysisTempFolderProvider;
+import org.sonar.batch.analysis.AnalysisProperties;
import org.sonar.batch.repository.user.UserRepositoryLoader;
import org.sonar.batch.issue.tracking.DefaultServerLineHashesLoader;
import org.sonar.batch.issue.tracking.ServerLineHashesLoader;
@@ -41,12 +46,10 @@ import org.sonar.api.utils.log.Loggers;
import org.sonar.batch.DefaultFileLinesContextFactory;
import org.sonar.batch.DefaultProjectTree;
import org.sonar.batch.ProjectConfigurator;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.bootstrap.ExtensionInstaller;
import org.sonar.batch.bootstrap.ExtensionMatcher;
import org.sonar.batch.bootstrap.ExtensionUtils;
import org.sonar.batch.bootstrap.MetricProvider;
-import org.sonar.batch.bootstrap.ProjectTempFolderProvider;
import org.sonar.batch.bootstrapper.EnvironmentInformation;
import org.sonar.batch.deprecated.components.DefaultResourceCreationLock;
import org.sonar.batch.duplication.DuplicationCache;
@@ -127,7 +130,7 @@ public class ProjectScanContainer extends ComponentContainer {
private void addBatchComponents() {
add(
props,
- ProjectAnalysisMode.class,
+ DefaultAnalysisMode.class,
projectReactorBuilder(),
new MutableProjectReactorProvider(getComponentByType(ProjectBootstrapper.class)),
new ImmutableProjectReactorProvider(),
@@ -139,7 +142,7 @@ public class ProjectScanContainer extends ComponentContainer {
ProjectExclusions.class,
ProjectReactorValidator.class,
new ProjectRepositoriesProvider(),
- new ProjectWSLoaderProvider(),
+ new AnalysisWSLoaderProvider(),
DefaultResourceCreationLock.class,
CodeColorizers.class,
MetricProvider.class,
@@ -151,7 +154,7 @@ public class ProjectScanContainer extends ComponentContainer {
DefaultIssueCallback.class,
// temp
- new ProjectTempFolderProvider(),
+ new AnalysisTempFolderProvider(),
// file system
InputPathCache.class,
@@ -214,7 +217,7 @@ public class ProjectScanContainer extends ComponentContainer {
@Override
protected void doAfterStart() {
- ProjectAnalysisMode analysisMode = getComponentByType(ProjectAnalysisMode.class);
+ DefaultAnalysisMode analysisMode = getComponentByType(DefaultAnalysisMode.class);
analysisMode.printMode();
LOG.debug("Start recursive analysis of project modules");
DefaultProjectTree tree = getComponentByType(DefaultProjectTree.class);
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java
index 07e86e07b24..7cd20223d20 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectSettings.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+
import com.google.common.collect.ImmutableMap;
import java.util.Map;
@@ -44,10 +46,10 @@ public class ProjectSettings extends Settings {
private final GlobalSettings globalSettings;
private final ProjectRepositories projectRepositories;
- private final ProjectAnalysisMode mode;
+ private final DefaultAnalysisMode mode;
public ProjectSettings(ProjectReactor reactor, GlobalSettings globalSettings, PropertyDefinitions propertyDefinitions,
- ProjectRepositories projectRepositories, ProjectAnalysisMode mode) {
+ ProjectRepositories projectRepositories, DefaultAnalysisMode mode) {
super(propertyDefinitions);
this.mode = mode;
getEncryption().setPathToSecretKey(globalSettings.getString(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/report/IssuesReports.java b/sonar-batch/src/main/java/org/sonar/batch/scan/report/IssuesReports.java
index f2b0c18d61a..848680dafd8 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/report/IssuesReports.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/report/IssuesReports.java
@@ -19,17 +19,17 @@
*/
package org.sonar.batch.scan.report;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
import org.sonar.api.batch.BatchSide;
@BatchSide
public class IssuesReports {
- private final ProjectAnalysisMode analysisMode;
+ private final DefaultAnalysisMode analysisMode;
private final Reporter[] reporters;
- public IssuesReports(ProjectAnalysisMode analysisMode, Reporter... reporters) {
+ public IssuesReports(DefaultAnalysisMode analysisMode, Reporter... reporters) {
this.reporters = reporters;
this.analysisMode = analysisMode;
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ProjectTempFolderProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/analysis/AnalysisTempFolderProviderTest.java
index ac969e6e714..601f90d876c 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ProjectTempFolderProviderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/analysis/AnalysisTempFolderProviderTest.java
@@ -17,10 +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.batch.bootstrap;
+package org.sonar.batch.analysis;
-import org.sonar.api.utils.TempFolder;
+import org.sonar.batch.analysis.AnalysisTempFolderProvider;
+import org.sonar.batch.analysis.AnalysisProperties;
+import org.sonar.api.utils.TempFolder;
import org.apache.commons.io.FileUtils;
import com.google.common.collect.ImmutableMap;
import org.junit.Rule;
@@ -33,17 +35,17 @@ import java.io.IOException;
import static org.assertj.core.api.Assertions.assertThat;
-public class ProjectTempFolderProviderTest {
+public class AnalysisTempFolderProviderTest {
@Rule
public TemporaryFolder temp = new TemporaryFolder();
- private ProjectTempFolderProvider tempFolderProvider = new ProjectTempFolderProvider();
+ private AnalysisTempFolderProvider tempFolderProvider = new AnalysisTempFolderProvider();
@Test
public void createTempFolderWithProps() throws Exception {
File workingDir = temp.newFolder();
- File tmpDir = new File(workingDir, ProjectTempFolderProvider.TMP_NAME);
+ File tmpDir = new File(workingDir, AnalysisTempFolderProvider.TMP_NAME);
TempFolder tempFolder = tempFolderProvider.provide(new AnalysisProperties(ImmutableMap.of(CoreProperties.WORKING_DIRECTORY, workingDir.getAbsolutePath()), ""));
tempFolder.newDir();
@@ -55,7 +57,7 @@ public class ProjectTempFolderProviderTest {
@Test
public void createTempFolder() throws IOException {
File workingDir = temp.newFolder();
- File defaultDir = new File(new File(workingDir, CoreProperties.WORKING_DIRECTORY_DEFAULT_VALUE), ProjectTempFolderProvider.TMP_NAME);
+ File defaultDir = new File(new File(workingDir, CoreProperties.WORKING_DIRECTORY_DEFAULT_VALUE), AnalysisTempFolderProvider.TMP_NAME);
try {
TempFolder tempFolder = tempFolderProvider.provide(new AnalysisProperties(ImmutableMap.of("sonar.projectBaseDir", workingDir.getAbsolutePath()), ""));
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectWSLoaderProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/analysis/AnalysisWSLoaderProviderTest.java
index d4fe0b2e109..77cd2311311 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectWSLoaderProviderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/analysis/AnalysisWSLoaderProviderTest.java
@@ -17,17 +17,19 @@
* 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.batch.scan;
+package org.sonar.batch.analysis;
+import org.sonar.batch.analysis.AnalysisWSLoaderProvider;
+
+import org.sonar.batch.cache.WSLoader;
+import org.sonar.batch.cache.WSLoader.LoadStrategy;
+import org.sonar.batch.analysis.AnalysisProperties;
import org.sonar.api.batch.AnalysisMode;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.bootstrap.ServerClient;
-import org.sonar.batch.bootstrap.WSLoader;
-import org.sonar.batch.bootstrap.WSLoader.LoadStrategy;
import org.sonar.home.cache.PersistentCache;
import java.util.HashMap;
@@ -35,7 +37,7 @@ import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
-public class ProjectWSLoaderProviderTest {
+public class AnalysisWSLoaderProviderTest {
@Mock
private PersistentCache cache;
@@ -45,14 +47,14 @@ public class ProjectWSLoaderProviderTest {
@Mock
private AnalysisMode mode;
- private ProjectWSLoaderProvider loaderProvider;
+ private AnalysisWSLoaderProvider loaderProvider;
private Map<String, String> propMap;
private AnalysisProperties props;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- loaderProvider = new ProjectWSLoaderProvider();
+ loaderProvider = new AnalysisWSLoaderProvider();
propMap = new HashMap<>();
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectAnalysisModeTest.java b/sonar-batch/src/test/java/org/sonar/batch/analysis/DefaultAnalysisModeTest.java
index 1f050b8fc7a..571760dc1b6 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectAnalysisModeTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/analysis/DefaultAnalysisModeTest.java
@@ -17,13 +17,15 @@
* 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.batch.scan;
+package org.sonar.batch.analysis;
+
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+
+import org.sonar.batch.analysis.AnalysisProperties;
import javax.annotation.Nullable;
-import org.sonar.batch.bootstrap.BootstrapProperties;
-import org.sonar.batch.bootstrap.AnalysisProperties;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.bootstrap.GlobalProperties;
import org.junit.Test;
import org.sonar.api.CoreProperties;
@@ -32,11 +34,11 @@ import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
-public class ProjectAnalysisModeTest {
+public class DefaultAnalysisModeTest {
@Test
public void regular_analysis_by_default() {
- ProjectAnalysisMode mode = createMode(null, null);
+ DefaultAnalysisMode mode = createMode(null, null);
assertThat(mode.isPreview()).isFalse();
assertThat(mode.isPublish()).isTrue();
}
@@ -48,7 +50,7 @@ public class ProjectAnalysisModeTest {
@Test
public void support_pulblish_mode() {
- ProjectAnalysisMode mode = createMode(CoreProperties.ANALYSIS_MODE_PUBLISH);
+ DefaultAnalysisMode mode = createMode(CoreProperties.ANALYSIS_MODE_PUBLISH);
assertThat(mode.isPreview()).isFalse();
assertThat(mode.isPublish()).isTrue();
@@ -61,14 +63,14 @@ public class ProjectAnalysisModeTest {
@Test
public void support_preview_mode() {
- ProjectAnalysisMode mode = createMode(CoreProperties.ANALYSIS_MODE_PREVIEW);
+ DefaultAnalysisMode mode = createMode(CoreProperties.ANALYSIS_MODE_PREVIEW);
assertThat(mode.isPreview()).isTrue();
}
@Test
public void default_publish_mode() {
- ProjectAnalysisMode mode = createMode(CoreProperties.ANALYSIS_MODE_PREVIEW);
+ DefaultAnalysisMode mode = createMode(CoreProperties.ANALYSIS_MODE_PREVIEW);
assertThat(mode.isPublish()).isFalse();
mode = createMode(CoreProperties.ANALYSIS_MODE_ISSUES);
@@ -81,16 +83,16 @@ public class ProjectAnalysisModeTest {
@Test
public void support_issues_mode() {
- ProjectAnalysisMode mode = createMode(CoreProperties.ANALYSIS_MODE_ISSUES);
+ DefaultAnalysisMode mode = createMode(CoreProperties.ANALYSIS_MODE_ISSUES);
assertThat(mode.isIssues()).isTrue();
}
- private static ProjectAnalysisMode createMode(@Nullable String mode) {
+ private static DefaultAnalysisMode createMode(@Nullable String mode) {
return createMode(mode, mode);
}
- private static ProjectAnalysisMode createMode(@Nullable String bootstrapMode, @Nullable String analysisMode) {
+ private static DefaultAnalysisMode createMode(@Nullable String bootstrapMode, @Nullable String analysisMode) {
Map<String, String> bootstrapMap = new HashMap<>();
Map<String, String> analysisMap = new HashMap<>();
@@ -100,7 +102,7 @@ public class ProjectAnalysisModeTest {
if (analysisMode != null) {
analysisMap.put(CoreProperties.ANALYSIS_MODE, analysisMode);
}
- return new ProjectAnalysisMode(new BootstrapProperties(bootstrapMap), new AnalysisProperties(analysisMap));
+ return new DefaultAnalysisMode(new GlobalProperties(bootstrapMap), new AnalysisProperties(analysisMap));
}
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginInstallerTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginInstallerTest.java
index e42962aca94..31f824ff0cf 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginInstallerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginInstallerTest.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.bootstrap;
+import org.sonar.batch.cache.WSLoader;
+
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalModeTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalModeTest.java
index b4c8f4253bd..588db7e1985 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalModeTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalModeTest.java
@@ -62,7 +62,7 @@ public class GlobalModeTest {
if (key != null) {
map.put(key, value);
}
- BootstrapProperties props = new BootstrapProperties(map);
+ GlobalProperties props = new GlobalProperties(map);
return new GlobalMode(props);
}
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapPropertiesTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalPropertiesTest.java
index 0b88040cd9a..7e915948f25 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BootstrapPropertiesTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalPropertiesTest.java
@@ -27,13 +27,13 @@ import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
-public class BootstrapPropertiesTest {
+public class GlobalPropertiesTest {
@Test
public void test_copy_of_properties() {
Map<String, String> map = Maps.newHashMap();
map.put("foo", "bar");
- BootstrapProperties wrapper = new BootstrapProperties(map);
+ GlobalProperties wrapper = new GlobalProperties(map);
assertThat(wrapper.properties()).containsOnly(entry("foo", "bar"));
assertThat(wrapper.properties()).isNotSameAs(map);
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java
index b9a2e32fde6..7b0f3fc534e 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalSettingsTest.java
@@ -41,14 +41,14 @@ public class GlobalSettingsTest {
public LogTester logTester = new LogTester();
GlobalRepositories globalRef;
- BootstrapProperties bootstrapProps;
+ GlobalProperties bootstrapProps;
private GlobalMode mode;
@Before
public void prepare() {
globalRef = new GlobalRepositories();
- bootstrapProps = new BootstrapProperties(Collections.<String, String>emptyMap());
+ bootstrapProps = new GlobalProperties(Collections.<String, String>emptyMap());
mode = mock(GlobalMode.class);
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/TempFolderProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalTempFolderProviderTest.java
index 3192641f791..aeb18d14d99 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/TempFolderProviderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/GlobalTempFolderProviderTest.java
@@ -40,17 +40,17 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
-public class TempFolderProviderTest {
+public class GlobalTempFolderProviderTest {
@Rule
public TemporaryFolder temp = new TemporaryFolder();
- private TempFolderProvider tempFolderProvider = new TempFolderProvider();
+ private GlobalTempFolderProvider tempFolderProvider = new GlobalTempFolderProvider();
@Test
public void createTempFolderProps() throws Exception {
File workingDir = temp.newFolder();
- TempFolder tempFolder = tempFolderProvider.provide(new BootstrapProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
+ TempFolder tempFolder = tempFolderProvider.provide(new GlobalProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
@@ -70,7 +70,7 @@ public class TempFolderProviderTest {
setFileCreationDate(tmp, creationTime);
}
- tempFolderProvider.provide(new BootstrapProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
+ tempFolderProvider.provide(new GlobalProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
// this also checks that all other temps were deleted
assertThat(getCreatedTempDir(workingDir)).exists();
@@ -83,7 +83,7 @@ public class TempFolderProviderTest {
File sonarHome = temp.newFolder();
File workingDir = new File(sonarHome, CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE).getAbsoluteFile();
- TempFolder tempFolder = tempFolderProvider.provide(new BootstrapProperties(ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath())));
+ TempFolder tempFolder = tempFolderProvider.provide(new GlobalProperties(ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath())));
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
@@ -95,7 +95,7 @@ public class TempFolderProviderTest {
@Test
public void createTempFolderDefault() throws Exception {
System2 system = mock(System2.class);
- tempFolderProvider = new TempFolderProvider(system);
+ tempFolderProvider = new GlobalTempFolderProvider(system);
File userHome = temp.newFolder();
when(system.envVariable("SONAR_USER_HOME")).thenReturn(null);
@@ -105,7 +105,7 @@ public class TempFolderProviderTest {
File defaultSonarHome = new File(userHome.getAbsolutePath(), ".sonar");
File workingDir = new File(defaultSonarHome, CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE).getAbsoluteFile();
try {
- TempFolder tempFolder = tempFolderProvider.provide(new BootstrapProperties(Collections.<String, String>emptyMap()));
+ TempFolder tempFolder = tempFolderProvider.provide(new GlobalProperties(Collections.<String, String>emptyMap()));
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ServerClientTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ServerClientTest.java
index 56133fe40d0..ef7f4c58a1d 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ServerClientTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ServerClientTest.java
@@ -44,7 +44,7 @@ public class ServerClientTest {
public ExpectedException thrown = ExpectedException.none();
private MockHttpServer server = null;
- private BootstrapProperties bootstrapProps = mock(BootstrapProperties.class);
+ private GlobalProperties bootstrapProps = mock(GlobalProperties.class);
@After
public void stopServer() {
@@ -55,7 +55,7 @@ public class ServerClientTest {
@Test
public void should_remove_url_ending_slash() {
- BootstrapProperties settings = mock(BootstrapProperties.class);
+ GlobalProperties settings = mock(GlobalProperties.class);
when(settings.property("sonar.host.url")).thenReturn("http://localhost:8080/sonar/");
ServerClient client = new ServerClient(settings, new EnvironmentInformation("Junit", "4"));
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/cache/PersistentCacheProviderTest.java
index 4f975659a89..0c18bfcb9c6 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/PersistentCacheProviderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cache/PersistentCacheProviderTest.java
@@ -17,20 +17,25 @@
* 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.batch.bootstrap;
+package org.sonar.batch.cache;
+
+import org.sonar.batch.bootstrap.GlobalProperties;
+
+import org.sonar.batch.cache.PersistentCacheProvider;
import java.util.Collections;
+
import org.junit.Before;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
public class PersistentCacheProviderTest {
private PersistentCacheProvider provider = null;
- private BootstrapProperties props = null;
+ private GlobalProperties props = null;
@Before
public void prepare() {
- props = new BootstrapProperties(Collections.<String, String>emptyMap());
+ props = new GlobalProperties(Collections.<String, String>emptyMap());
provider = new PersistentCacheProvider();
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java b/sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java
index e6bf23eb04e..e7e7cabefc2 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cache/ProjectCacheSynchronizerTest.java
@@ -21,16 +21,16 @@ package org.sonar.batch.cache;
import static org.mockito.Mockito.when;
-import org.sonar.batch.protocol.input.ProjectRepositories;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+import org.sonar.batch.analysis.AnalysisProperties;
+import org.sonar.batch.protocol.input.ProjectRepositories;
import org.apache.commons.lang.mutable.MutableBoolean;
import org.sonar.batch.issue.tracking.DefaultServerLineHashesLoader;
import org.sonar.batch.repository.DefaultServerIssuesLoader;
-import org.sonar.batch.scan.ProjectAnalysisMode;
import org.sonar.batch.repository.DefaultProjectRepositoriesLoader;
import org.sonar.api.batch.bootstrap.ProjectReactor;
import org.sonar.batch.bootstrap.WSLoaderResult;
-import org.sonar.batch.bootstrap.WSLoader;
import com.google.common.io.ByteSource;
import java.io.IOException;
@@ -50,7 +50,6 @@ import org.junit.Before;
import org.mockito.MockitoAnnotations;
import org.mockito.Mock;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.issue.tracking.ServerLineHashesLoader;
import org.sonar.batch.repository.ProjectRepositoriesLoader;
import org.sonar.batch.repository.ServerIssuesLoader;
@@ -69,7 +68,7 @@ public class ProjectCacheSynchronizerTest {
@Mock
private ProjectCacheStatus cacheStatus;
@Mock
- private ProjectAnalysisMode analysisMode;
+ private DefaultAnalysisMode analysisMode;
@Mock
private AnalysisProperties properties;
@Mock
diff --git a/sonar-batch/src/test/java/org/sonar/batch/cache/StrategyWSLoaderProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/cache/StrategyWSLoaderProviderTest.java
index d55fe8bcbee..69993d0768e 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/cache/StrategyWSLoaderProviderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cache/StrategyWSLoaderProviderTest.java
@@ -21,14 +21,14 @@ package org.sonar.batch.cache;
import static org.assertj.core.api.Assertions.assertThat;
-import org.sonar.batch.bootstrap.WSLoader;
+import org.sonar.batch.cache.WSLoader.LoadStrategy;
+
import org.junit.Before;
import org.mockito.MockitoAnnotations;
import org.sonar.batch.bootstrap.ServerClient;
import org.mockito.Mock;
import org.sonar.home.cache.PersistentCache;
import org.junit.Test;
-import org.sonar.batch.bootstrap.WSLoader.LoadStrategy;
public class StrategyWSLoaderProviderTest {
@Mock
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/WSLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/cache/WSLoaderTest.java
index 766d6603ece..7717f5fc8b9 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/WSLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cache/WSLoaderTest.java
@@ -17,10 +17,14 @@
* 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.batch.bootstrap;
+package org.sonar.batch.cache;
-import org.hamcrest.Matchers;
+import org.sonar.batch.bootstrap.ServerClient;
+import org.sonar.batch.bootstrap.WSLoaderResult;
+import org.sonar.batch.cache.WSLoader;
+import org.sonar.batch.cache.WSLoader.LoadStrategy;
+import org.hamcrest.Matchers;
import org.junit.rules.ExpectedException;
import org.junit.Rule;
import org.sonar.api.utils.HttpDownloader;
@@ -44,7 +48,6 @@ import static org.mockito.Mockito.when;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.anyInt;
-import org.sonar.batch.bootstrap.WSLoader.LoadStrategy;
import org.junit.Test;
import org.mockito.MockitoAnnotations;
import org.junit.Before;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/WSLoaderTestWithServer.java b/sonar-batch/src/test/java/org/sonar/batch/cache/WSLoaderTestWithServer.java
index b6582883ebc..1781a143f89 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/WSLoaderTestWithServer.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cache/WSLoaderTestWithServer.java
@@ -17,13 +17,19 @@
* 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.batch.bootstrap;
+package org.sonar.batch.cache;
import static org.mockito.Mockito.mock;
-import org.sonar.batch.bootstrap.WSLoader.LoadStrategy;
+
+import org.sonar.batch.bootstrap.GlobalProperties;
+import org.sonar.batch.bootstrap.MockHttpServer;
+import org.sonar.batch.bootstrap.ServerClient;
+import org.sonar.batch.bootstrap.Slf4jLogger;
+
+import org.sonar.batch.cache.WSLoader;
+import org.sonar.batch.cache.WSLoader.LoadStrategy;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
-
import static org.mockito.Mockito.when;
import static org.assertj.core.api.Assertions.assertThat;
import org.sonar.batch.bootstrapper.EnvironmentInformation;
@@ -47,7 +53,7 @@ public class WSLoaderTestWithServer {
server = new MockHttpServer();
server.start();
- BootstrapProperties bootstrapProps = mock(BootstrapProperties.class);
+ GlobalProperties bootstrapProps = mock(GlobalProperties.class);
when(bootstrapProps.property("sonar.host.url")).thenReturn("http://localhost:" + server.getPort());
client = new ServerClient(bootstrapProps, new EnvironmentInformation("Junit", "4"));
diff --git a/sonar-batch/src/test/java/org/sonar/batch/cpd/index/IndexFactoryTest.java b/sonar-batch/src/test/java/org/sonar/batch/cpd/index/IndexFactoryTest.java
index c9bc8a41ed6..f33f40b6cba 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/cpd/index/IndexFactoryTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cpd/index/IndexFactoryTest.java
@@ -19,7 +19,7 @@
*/
package org.sonar.batch.cpd.index;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
import org.junit.Before;
import org.junit.Test;
@@ -38,13 +38,13 @@ public class IndexFactoryTest {
Settings settings;
IndexFactory factory;
Logger logger;
- private ProjectAnalysisMode analysisMode;
+ private DefaultAnalysisMode analysisMode;
@Before
public void setUp() {
project = new Project("foo");
settings = new Settings();
- analysisMode = mock(ProjectAnalysisMode.class);
+ analysisMode = mock(DefaultAnalysisMode.class);
factory = new IndexFactory(analysisMode, settings);
logger = mock(Logger.class);
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java
index b9f09a73254..bdd2116ac2e 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java
@@ -26,8 +26,8 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import com.google.common.collect.ImmutableMap;
import org.sonar.api.CoreProperties;
-import org.sonar.batch.bootstrap.BootstrapProperties;
-import org.sonar.batch.bootstrap.TempFolderProvider;
+import org.sonar.batch.bootstrap.GlobalProperties;
+import org.sonar.batch.bootstrap.GlobalTempFolderProvider;
import java.util.Map;
@@ -45,7 +45,7 @@ public abstract class AbstractCachesTest {
Map<String, String> props = ImmutableMap.of(CoreProperties.WORKING_DIRECTORY, temp.getRoot().getAbsolutePath(),
CoreProperties.GLOBAL_WORKING_DIRECTORY, temp.getRoot().getAbsolutePath());
- return new CachesManager(new TempFolderProvider().provide(new BootstrapProperties(props)));
+ return new CachesManager(new GlobalTempFolderProvider().provide(new GlobalProperties(props)));
}
@BeforeClass
diff --git a/sonar-batch/src/test/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoaderTest.java
index f788788fef1..f0b4284b02f 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/issue/tracking/DefaultServerLineHashesLoaderTest.java
@@ -19,10 +19,10 @@
*/
package org.sonar.batch.issue.tracking;
-import org.apache.commons.lang.mutable.MutableBoolean;
+import org.sonar.batch.cache.WSLoader;
+import org.apache.commons.lang.mutable.MutableBoolean;
import org.sonar.batch.bootstrap.WSLoaderResult;
-import org.sonar.batch.bootstrap.WSLoader;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java
index 9ff6e0a55d7..b14d6ac3c88 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/BatchMediumTester.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.mediumtest;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import org.apache.commons.lang.mutable.MutableBoolean;
import javax.annotation.Nullable;
@@ -51,7 +53,6 @@ import org.sonar.api.SonarPlugin;
import org.sonar.api.batch.debt.internal.DefaultDebtModel;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Metric;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.batch.bootstrapper.Batch;
import org.sonar.batch.bootstrapper.EnvironmentInformation;
import org.sonar.batch.bootstrapper.LogOutput;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/platform/DefaultServerTest.java b/sonar-batch/src/test/java/org/sonar/batch/platform/DefaultServerTest.java
index 47bc2f9c012..896a7aa8412 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/platform/DefaultServerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/platform/DefaultServerTest.java
@@ -19,7 +19,7 @@
*/
package org.sonar.batch.platform;
-import org.sonar.batch.bootstrap.BootstrapProperties;
+import org.sonar.batch.bootstrap.GlobalProperties;
import org.junit.Test;
import org.sonar.api.CoreProperties;
@@ -37,7 +37,7 @@ public class DefaultServerTest {
settings.setProperty(CoreProperties.SERVER_VERSION, "2.2");
settings.setProperty(CoreProperties.SERVER_STARTTIME, "2010-05-18T17:59:00+0000");
settings.setProperty(CoreProperties.PERMANENT_SERVER_ID, "abcde");
- BootstrapProperties props = mock(BootstrapProperties.class);
+ GlobalProperties props = mock(GlobalProperties.class);
when(props.property("sonar.host.url")).thenReturn("http://foo.com");
DefaultServer metadata = new DefaultServer(settings, props);
diff --git a/sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java b/sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java
index 7ef1d23673d..be0a3faf4ab 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java
@@ -48,7 +48,7 @@ import org.sonar.api.batch.events.SensorsPhaseHandler;
import org.sonar.api.batch.events.SensorsPhaseHandler.SensorsPhaseEvent;
import org.sonar.api.resources.Project;
import org.sonar.api.utils.System2;
-import org.sonar.batch.bootstrap.BootstrapProperties;
+import org.sonar.batch.bootstrap.GlobalProperties;
import org.sonar.batch.events.BatchStepEvent;
import static org.assertj.core.api.Assertions.assertThat;
@@ -68,7 +68,7 @@ public class PhasesSumUpTimeProfilerTest {
clock = new MockedSystem();
Map<String, String> props = Maps.newHashMap();
props.put(CoreProperties.WORKING_DIRECTORY, temp.newFolder().getAbsolutePath());
- profiler = new PhasesSumUpTimeProfiler(clock, new BootstrapProperties(props));
+ profiler = new PhasesSumUpTimeProfiler(clock, new GlobalProperties(props));
}
@Test
diff --git a/sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java b/sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java
index 10141350e88..de11e64af45 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java
@@ -19,7 +19,7 @@
*/
package org.sonar.batch.report;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
import org.junit.Before;
import org.junit.Test;
@@ -37,13 +37,13 @@ import static org.mockito.Mockito.when;
public class ReportPublisherTest {
- private ProjectAnalysisMode mode;
+ private DefaultAnalysisMode mode;
private ImmutableProjectReactor reactor;
@Before
public void setUp() {
- mode = mock(ProjectAnalysisMode.class);
+ mode = mock(DefaultAnalysisMode.class);
reactor = mock(ImmutableProjectReactor.class);
when(reactor.getRoot()).thenReturn(ProjectDefinition.create().setKey("struts"));
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java
index 9a1f8abea46..15403885ae9 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java
@@ -19,9 +19,11 @@
*/
package org.sonar.batch.repository;
-import org.apache.commons.lang.mutable.MutableBoolean;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
-import org.sonar.batch.scan.ProjectAnalysisMode;
+import org.sonar.batch.cache.WSLoader;
+import org.sonar.batch.analysis.AnalysisProperties;
+import org.apache.commons.lang.mutable.MutableBoolean;
import org.apache.commons.io.IOUtils;
import org.sonar.batch.bootstrap.WSLoaderResult;
import com.google.common.collect.Maps;
@@ -36,8 +38,6 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.utils.MessageException;
-import org.sonar.batch.bootstrap.AnalysisProperties;
-import org.sonar.batch.bootstrap.WSLoader;
import org.sonar.batch.protocol.input.ProjectRepositories;
import org.sonar.batch.protocol.input.QProfile;
import org.sonar.batch.rule.ModuleQProfiles;
@@ -54,14 +54,14 @@ public class DefaultProjectRepositoriesLoaderTest {
private DefaultProjectRepositoriesLoader loader;
private WSLoader wsLoader;
- private ProjectAnalysisMode analysisMode;
+ private DefaultAnalysisMode analysisMode;
private ProjectDefinition project;
private AnalysisProperties taskProperties;
@Before
public void prepare() {
wsLoader = mock(WSLoader.class);
- analysisMode = mock(ProjectAnalysisMode.class);
+ analysisMode = mock(DefaultAnalysisMode.class);
loader = new DefaultProjectRepositoriesLoader(wsLoader, analysisMode);
loader = spy(loader);
when(wsLoader.loadString(anyString())).thenReturn(new WSLoaderResult<>("{}", true));
diff --git a/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultServerIssuesLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultServerIssuesLoaderTest.java
index f318c27363e..f010ad11575 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultServerIssuesLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultServerIssuesLoaderTest.java
@@ -19,9 +19,10 @@
*/
package org.sonar.batch.repository;
+import org.sonar.batch.cache.WSLoader;
+
import org.sonar.batch.bootstrap.WSLoaderResult;
import com.google.common.io.ByteSource;
-import org.sonar.batch.bootstrap.WSLoader;
import com.google.common.base.Function;
import org.junit.Before;
import org.junit.Test;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/repository/user/UserRepositoryLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/repository/user/UserRepositoryLoaderTest.java
index 1b17e6445c6..6fe983a749c 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/repository/user/UserRepositoryLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/repository/user/UserRepositoryLoaderTest.java
@@ -19,8 +19,9 @@
*/
package org.sonar.batch.repository.user;
-import org.junit.Before;
+import org.sonar.batch.cache.WSLoader;
+import org.junit.Before;
import com.google.common.collect.ImmutableList;
import org.apache.commons.lang.mutable.MutableBoolean;
import com.google.common.collect.ImmutableMap;
@@ -29,7 +30,6 @@ import org.junit.Rule;
import org.mockito.Mockito;
import org.sonar.batch.bootstrap.WSLoaderResult;
import com.google.common.io.ByteSource;
-import org.sonar.batch.bootstrap.WSLoader;
import org.junit.Test;
import org.sonar.batch.protocol.input.BatchInput;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultRulesLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultRulesLoaderTest.java
index 4456d5b3cb0..efe05b0ec25 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultRulesLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultRulesLoaderTest.java
@@ -22,8 +22,9 @@ package org.sonar.batch.rule;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import org.apache.commons.lang.mutable.MutableBoolean;
+import org.sonar.batch.cache.WSLoader;
+import org.apache.commons.lang.mutable.MutableBoolean;
import org.sonar.batch.bootstrap.WSLoaderResult;
import org.sonarqube.ws.Rules.ListResponse.Rule;
import com.google.common.io.ByteSource;
@@ -34,7 +35,6 @@ import java.util.List;
import static org.mockito.Matchers.anyString;
import static org.assertj.core.api.Assertions.assertThat;
-import org.sonar.batch.bootstrap.WSLoader;
import org.junit.Test;
public class DefaultRulesLoaderTest {
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest.java
index 2ac5ac8bd3d..0aaf6e2dfd2 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest.java
@@ -19,13 +19,14 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import com.google.common.collect.Maps;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.batch.bootstrap.ProjectReactor;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.test.TestUtils;
import java.io.File;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ModuleSettingsTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/ModuleSettingsTest.java
index 032bc858b32..c8a5f506018 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/ModuleSettingsTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/ModuleSettingsTest.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+
import com.google.common.collect.ImmutableMap;
import org.junit.Before;
import org.junit.Rule;
@@ -42,12 +44,12 @@ public class ModuleSettingsTest {
public ExpectedException thrown = ExpectedException.none();
ProjectRepositories projectRef;
- private ProjectAnalysisMode mode;
+ private DefaultAnalysisMode mode;
@Before
public void before() {
projectRef = new ProjectRepositories();
- mode = mock(ProjectAnalysisMode.class);
+ mode = mock(DefaultAnalysisMode.class);
}
@Test
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java
index 0fdd3d51534..9643520511c 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java
@@ -19,13 +19,14 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.analysis.AnalysisProperties;
+
import com.google.common.collect.Maps;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.batch.bootstrap.ProjectReactor;
-import org.sonar.batch.bootstrap.AnalysisProperties;
import org.sonar.test.TestUtils;
import java.io.File;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java
index 16bf5b32062..de99ed8e909 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectSettingsTest.java
@@ -19,8 +19,9 @@
*/
package org.sonar.batch.scan;
-import org.sonar.batch.bootstrap.GlobalMode;
+import org.sonar.batch.analysis.DefaultAnalysisMode;
+import org.sonar.batch.bootstrap.GlobalMode;
import com.google.common.collect.ImmutableMap;
import java.util.Collections;
@@ -36,7 +37,7 @@ import org.sonar.api.config.PropertyDefinitions;
import org.sonar.api.utils.MessageException;
import org.sonar.api.utils.log.LogTester;
import org.sonar.api.utils.log.LoggerLevel;
-import org.sonar.batch.bootstrap.BootstrapProperties;
+import org.sonar.batch.bootstrap.GlobalProperties;
import org.sonar.batch.bootstrap.GlobalSettings;
import org.sonar.batch.protocol.input.GlobalRepositories;
import org.sonar.batch.protocol.input.ProjectRepositories;
@@ -56,14 +57,14 @@ public class ProjectSettingsTest {
GlobalSettings bootstrapProps;
private GlobalMode globalMode;
- private ProjectAnalysisMode mode;
+ private DefaultAnalysisMode mode;
@Before
public void prepare() {
projectRef = new ProjectRepositories();
globalMode = mock(GlobalMode.class);
- mode = mock(ProjectAnalysisMode.class);
- bootstrapProps = new GlobalSettings(new BootstrapProperties(Collections.<String, String>emptyMap()), new PropertyDefinitions(), new GlobalRepositories(), globalMode);
+ mode = mock(DefaultAnalysisMode.class);
+ bootstrapProps = new GlobalSettings(new GlobalProperties(Collections.<String, String>emptyMap()), new PropertyDefinitions(), new GlobalRepositories(), globalMode);
}
@Test
@@ -122,7 +123,7 @@ public class ProjectSettingsTest {
@Test
public void should_log_a_warning_when_a_dropper_property_is_present() {
- GlobalSettings settings = new GlobalSettings(new BootstrapProperties(ImmutableMap.of("sonar.qualitygate", "somevalue")), new PropertyDefinitions(), new GlobalRepositories(), globalMode);
+ GlobalSettings settings = new GlobalSettings(new GlobalProperties(ImmutableMap.of("sonar.qualitygate", "somevalue")), new PropertyDefinitions(), new GlobalRepositories(), globalMode);
new ProjectSettings(new ProjectReactor(project), settings, new PropertyDefinitions(), projectRef, mode);
assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly("Property 'sonar.qualitygate' is not supported any more. It will be ignored.");