diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-01-24 16:18:32 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-01-24 16:18:32 +0100 |
commit | b300f735bf5aeda3d8b77e1d67012641f8a94f9b (patch) | |
tree | d37932fd323bc269170656a8ea48a72ea76894cb /plugins | |
parent | 08de7bc30c13fdd63d8e4342a57f4b67d7c15aa9 (diff) | |
download | sonarqube-b300f735bf5aeda3d8b77e1d67012641f8a94f9b.tar.gz sonarqube-b300f735bf5aeda3d8b77e1d67012641f8a94f9b.zip |
SONAR-926 Expose ModuleLanguages in plugin API
Diffstat (limited to 'plugins')
6 files changed, 11 insertions, 11 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ProfileEventsSensor.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ProfileEventsSensor.java index 39e722c099e..3fd3d0a9ed7 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ProfileEventsSensor.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ProfileEventsSensor.java @@ -20,6 +20,7 @@ package org.sonar.plugins.core.sensors; import org.sonar.api.batch.Event; +import org.sonar.api.batch.ModuleLanguages; import org.sonar.api.batch.Sensor; import org.sonar.api.batch.SensorContext; import org.sonar.api.batch.TimeMachine; @@ -30,7 +31,6 @@ import org.sonar.api.measures.Metric; import org.sonar.api.profiles.RulesProfile; import org.sonar.api.resources.Project; import org.sonar.batch.RulesProfileWrapper; -import org.sonar.batch.scan.language.ModuleLanguages; import java.util.List; diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ProfileSensor.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ProfileSensor.java index ffb6252101c..e507f27ec9a 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ProfileSensor.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ProfileSensor.java @@ -19,6 +19,7 @@ */ package org.sonar.plugins.core.sensors; +import org.sonar.api.batch.ModuleLanguages; import org.sonar.api.batch.Sensor; import org.sonar.api.batch.SensorContext; import org.sonar.api.database.DatabaseSession; @@ -27,13 +28,12 @@ import org.sonar.api.measures.Measure; import org.sonar.api.profiles.RulesProfile; import org.sonar.api.resources.Project; import org.sonar.batch.RulesProfileWrapper; -import org.sonar.batch.scan.language.ModuleLanguages; public class ProfileSensor implements Sensor { private final RulesProfile profile; private final DatabaseSession session; - private ModuleLanguages languages; + private final ModuleLanguages languages; public ProfileSensor(RulesProfile profile, DatabaseSession session, ModuleLanguages languages) { this.profile = profile; diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ProfileEventsSensorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ProfileEventsSensorTest.java index 84d586a5874..47bf93bcd7e 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ProfileEventsSensorTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ProfileEventsSensorTest.java @@ -33,7 +33,7 @@ import org.sonar.api.resources.Java; import org.sonar.api.resources.Languages; import org.sonar.api.resources.Project; import org.sonar.batch.RulesProfileWrapper; -import org.sonar.batch.scan.language.ModuleLanguages; +import org.sonar.batch.scan.language.DefaultModuleLanguages; import java.util.Arrays; import java.util.Collections; @@ -54,7 +54,7 @@ public class ProfileEventsSensorTest { private Project project; private SensorContext context; - private ModuleLanguages moduleLanguages; + private DefaultModuleLanguages moduleLanguages; private RulesProfileWrapper wrapper; private RulesProfile profile; @@ -63,7 +63,7 @@ public class ProfileEventsSensorTest { project = mock(Project.class); context = mock(SensorContext.class); - moduleLanguages = new ModuleLanguages(new Settings(), new Languages(Java.INSTANCE)); + moduleLanguages = new DefaultModuleLanguages(new Settings(), new Languages(Java.INSTANCE)); moduleLanguages.addLanguage("java"); Map<String, RulesProfile> ruleProfilesPerLanguages = new HashMap<String, RulesProfile>(); profile = mock(RulesProfile.class); diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ProfileSensorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ProfileSensorTest.java index 4aa3ae589e5..c1b720f3fea 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ProfileSensorTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ProfileSensorTest.java @@ -29,7 +29,7 @@ import org.sonar.api.resources.Java; import org.sonar.api.resources.Languages; import org.sonar.api.test.IsMeasure; import org.sonar.batch.RulesProfileWrapper; -import org.sonar.batch.scan.language.ModuleLanguages; +import org.sonar.batch.scan.language.DefaultModuleLanguages; import java.util.HashMap; import java.util.Map; @@ -48,7 +48,7 @@ public class ProfileSensorTest { when(profile.getName()).thenReturn("fake"); when(profile.getVersion()).thenReturn(2); - ModuleLanguages moduleLanguages = new ModuleLanguages(new Settings(), new Languages(Java.INSTANCE)); + DefaultModuleLanguages moduleLanguages = new DefaultModuleLanguages(new Settings(), new Languages(Java.INSTANCE)); moduleLanguages.addLanguage("java"); Map<String, RulesProfile> ruleProfilesPerLanguages = new HashMap<String, RulesProfile>(); ruleProfilesPerLanguages.put("java", profile); diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdSensor.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdSensor.java index 47c3c15e55d..f9346aaffc3 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdSensor.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdSensor.java @@ -23,12 +23,12 @@ import com.google.common.annotations.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.CoreProperties; +import org.sonar.api.batch.ModuleLanguages; import org.sonar.api.batch.Sensor; import org.sonar.api.batch.SensorContext; import org.sonar.api.config.Settings; import org.sonar.api.resources.Language; import org.sonar.api.resources.Project; -import org.sonar.batch.scan.language.ModuleLanguages; public class CpdSensor implements Sensor { diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java index d410d658eeb..185bb6d6013 100644 --- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java +++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java @@ -27,7 +27,7 @@ import org.sonar.api.resources.AbstractLanguage; import org.sonar.api.resources.Java; import org.sonar.api.resources.Language; import org.sonar.api.resources.Languages; -import org.sonar.batch.scan.language.ModuleLanguages; +import org.sonar.batch.scan.language.DefaultModuleLanguages; import org.sonar.plugins.cpd.index.IndexFactory; import static org.fest.assertions.Assertions.assertThat; @@ -54,7 +54,7 @@ public class CpdSensorTest { return null; } }; - sensor = new CpdSensor(sonarEngine, sonarBridgeEngine, settings, new ModuleLanguages(settings, new Languages())); + sensor = new CpdSensor(sonarEngine, sonarBridgeEngine, settings, new DefaultModuleLanguages(settings, new Languages())); } @Test |