aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-cpd-plugin/pom.xml114
-rw-r--r--pom.xml1
-rw-r--r--sonar-application/pom.xml7
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchComponents.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/CpdComponents.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java)14
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/CpdEngine.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdEngine.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/CpdMappings.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdMappings.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/CpdSensor.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdSensor.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/DefaultCpdEngine.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DefaultCpdEngine.java)7
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/JavaCpdEngine.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/JavaCpdEngine.java)7
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/DuplicationDensityDecorator.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/DuplicationDensityDecorator.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/SumDuplicationsDecorator.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecorator.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/package-info.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/package-info.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/index/DbDuplicationsIndex.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/index/IndexFactory.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/IndexFactory.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/index/SonarDuplicationsIndex.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/SonarDuplicationsIndex.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/index/package-info.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/package-info.java)2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/cpd/package-info.java (renamed from plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/package-info.java)2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cpd/CpdComponentsTest.java (renamed from plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdPluginTest.java)6
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cpd/CpdSensorTest.java (renamed from plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java)12
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cpd/DefaultCpdEngineTest.java (renamed from plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/DefaultCpdEngineTest.java)5
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cpd/JavaCpdEngineTest.java (renamed from plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/JavaCpdEngineTest.java)4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cpd/decorators/DuplicationDensityDecoratorTest.java (renamed from plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/DuplicationDensityDecoratorTest.java)4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cpd/decorators/SumDuplicationsDecoratorTest.java (renamed from plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java)5
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/cpd/index/IndexFactoryTest.java (renamed from plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/index/IndexFactoryTest.java)5
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/mediumtest/cpd/CpdMediumTest.java (renamed from plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/medium/CpdMediumTest.java)4
26 files changed, 56 insertions, 164 deletions
diff --git a/plugins/sonar-cpd-plugin/pom.xml b/plugins/sonar-cpd-plugin/pom.xml
deleted file mode 100644
index e2591c28c7c..00000000000
--- a/plugins/sonar-cpd-plugin/pom.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar</artifactId>
- <version>5.1-SNAPSHOT</version>
- <relativePath>../..</relativePath>
- </parent>
- <groupId>org.codehaus.sonar.plugins</groupId>
- <artifactId>sonar-cpd-plugin</artifactId>
- <name>SonarQube :: Plugins :: CPD</name>
- <packaging>sonar-plugin</packaging>
- <description>Find duplicated source code within project.</description>
-
- <dependencies>
- <!-- For ResourcePersister and database access -->
- <dependency>
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar-batch</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar-duplications</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar-plugin-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- unit tests -->
- <dependency>
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar-testing-harness</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.sonar.plugins</groupId>
- <artifactId>sonar-xoo-plugin</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar-plugin-api</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>${basedir}/src/main/resources</directory>
- </testResource>
- <testResource>
- <directory>${basedir}/src/test/resources</directory>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar-packaging-maven-plugin</artifactId>
- <configuration>
- <pluginKey>cpd</pluginKey>
- <pluginName>Duplications</pluginName>
- <pluginClass>org.sonar.plugins.cpd.CpdPlugin</pluginClass>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>${skipBatchTests}</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/pom.xml b/pom.xml
index 927c44391c7..cfd7c40779c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,6 @@
<module>server</module>
<module>sonar-testing-harness</module>
<module>plugins/sonar-core-plugin</module>
- <module>plugins/sonar-cpd-plugin</module>
<module>plugins/sonar-l10n-en-plugin</module>
<module>plugins/sonar-email-notifications-plugin</module>
<module>plugins/sonar-xoo-plugin</module>
diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml
index dcd6c6db5c8..44133ea12a0 100644
--- a/sonar-application/pom.xml
+++ b/sonar-application/pom.xml
@@ -104,13 +104,6 @@
</dependency>
<dependency>
<groupId>org.codehaus.sonar.plugins</groupId>
- <artifactId>sonar-cpd-plugin</artifactId>
- <version>${project.version}</version>
- <type>sonar-plugin</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.sonar.plugins</groupId>
<artifactId>sonar-l10n-en-plugin</artifactId>
<version>${project.version}</version>
<type>sonar-plugin</type>
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchComponents.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchComponents.java
index ea8dac835fb..31c78a9d8b7 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchComponents.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchComponents.java
@@ -20,6 +20,7 @@
package org.sonar.batch.bootstrap;
import com.google.common.collect.Lists;
+import org.sonar.batch.cpd.CpdComponents;
import org.sonar.batch.design.DirectoryDsmDecorator;
import org.sonar.batch.design.DirectoryTangleIndexDecorator;
import org.sonar.batch.design.FileTangleIndexDecorator;
@@ -89,6 +90,8 @@ public class BatchComponents {
DefaultPurgeTask.class
);
components.addAll(CorePropertyDefinitions.all());
+ // CPD
+ components.addAll(CpdComponents.all());
if (!analysisMode.isMediumTest()) {
components.add(MavenDependenciesSensor.class);
}
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/CpdComponents.java
index 2abed6cd61b..6032e60b9b6 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/CpdComponents.java
@@ -17,24 +17,22 @@
* 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.plugins.cpd;
+package org.sonar.batch.cpd;
import com.google.common.collect.ImmutableList;
import org.sonar.api.CoreProperties;
import org.sonar.api.PropertyType;
-import org.sonar.api.SonarPlugin;
import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.resources.Qualifiers;
-import org.sonar.plugins.cpd.decorators.DuplicationDensityDecorator;
-import org.sonar.plugins.cpd.decorators.SumDuplicationsDecorator;
-import org.sonar.plugins.cpd.index.IndexFactory;
+import org.sonar.batch.cpd.decorators.DuplicationDensityDecorator;
+import org.sonar.batch.cpd.decorators.SumDuplicationsDecorator;
+import org.sonar.batch.cpd.index.IndexFactory;
import java.util.List;
-public final class CpdPlugin extends SonarPlugin {
+public final class CpdComponents {
- @Override
- public List getExtensions() {
+ public static List all() {
return ImmutableList.of(
PropertyDefinition.builder(CoreProperties.CPD_CROSS_PROJECT)
.defaultValue(CoreProperties.CPD_CROSS_RPOJECT_DEFAULT_VALUE + "")
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdEngine.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/CpdEngine.java
index 2f2a7633f40..45964262241 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdEngine.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/CpdEngine.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd;
+package org.sonar.batch.cpd;
import org.slf4j.Logger;
import org.sonar.api.BatchExtension;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdMappings.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/CpdMappings.java
index 3f0f9d83b8c..ff4b7a81beb 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdMappings.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/CpdMappings.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd;
+package org.sonar.batch.cpd;
import org.sonar.api.BatchComponent;
import org.sonar.api.batch.CpdMapping;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdSensor.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/CpdSensor.java
index 611658c26c2..d4ba5397783 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdSensor.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/CpdSensor.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd;
+package org.sonar.batch.cpd;
import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DefaultCpdEngine.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/DefaultCpdEngine.java
index deeb060b98f..6f95c3e47f3 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DefaultCpdEngine.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/DefaultCpdEngine.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.plugins.cpd;
+package org.sonar.batch.cpd;
+
+import org.sonar.batch.cpd.index.IndexFactory;
+import org.sonar.batch.cpd.index.SonarDuplicationsIndex;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Predicate;
@@ -41,8 +44,6 @@ import org.sonar.duplications.block.Block;
import org.sonar.duplications.block.FileBlocks;
import org.sonar.duplications.index.CloneGroup;
import org.sonar.duplications.internal.pmd.TokenizerBridge;
-import org.sonar.plugins.cpd.index.IndexFactory;
-import org.sonar.plugins.cpd.index.SonarDuplicationsIndex;
import javax.annotation.Nullable;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/JavaCpdEngine.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/JavaCpdEngine.java
index cf74b2cab7f..37bae21c422 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/JavaCpdEngine.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/JavaCpdEngine.java
@@ -18,7 +18,10 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd;
+package org.sonar.batch.cpd;
+
+import org.sonar.batch.cpd.index.IndexFactory;
+import org.sonar.batch.cpd.index.SonarDuplicationsIndex;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -50,8 +53,6 @@ import org.sonar.duplications.java.JavaTokenProducer;
import org.sonar.duplications.statement.Statement;
import org.sonar.duplications.statement.StatementChunker;
import org.sonar.duplications.token.TokenChunker;
-import org.sonar.plugins.cpd.index.IndexFactory;
-import org.sonar.plugins.cpd.index.SonarDuplicationsIndex;
import javax.annotation.Nullable;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/DuplicationDensityDecorator.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/DuplicationDensityDecorator.java
index c5208cf2a7f..d122eeb3b2b 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/DuplicationDensityDecorator.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/DuplicationDensityDecorator.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd.decorators;
+package org.sonar.batch.cpd.decorators;
import org.sonar.api.batch.Decorator;
import org.sonar.api.batch.DecoratorContext;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecorator.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/SumDuplicationsDecorator.java
index 29110918beb..af7f4b79e60 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecorator.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/SumDuplicationsDecorator.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd.decorators;
+package org.sonar.batch.cpd.decorators;
import org.sonar.api.batch.AbstractSumChildrenDecorator;
import org.sonar.api.batch.DependedUpon;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/package-info.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/package-info.java
index 489cb4de835..51735f6c8dc 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/decorators/package-info.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/decorators/package-info.java
@@ -19,7 +19,7 @@
*/
@ParametersAreNonnullByDefault
-package org.sonar.plugins.cpd.decorators;
+package org.sonar.batch.cpd.decorators;
import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/DbDuplicationsIndex.java
index d3258bfa7f6..4318e0fa8ad 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/DbDuplicationsIndex.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd.index;
+package org.sonar.batch.cpd.index;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/IndexFactory.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/IndexFactory.java
index 769e05bf2c3..a11f94a0fde 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/IndexFactory.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/IndexFactory.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd.index;
+package org.sonar.batch.cpd.index;
import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang.StringUtils;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/SonarDuplicationsIndex.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/SonarDuplicationsIndex.java
index ad8ac293527..dacedc06b74 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/SonarDuplicationsIndex.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/SonarDuplicationsIndex.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd.index;
+package org.sonar.batch.cpd.index;
import com.google.common.collect.Lists;
import org.sonar.api.batch.fs.InputFile;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/package-info.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/package-info.java
index 27f5b16ae24..5d53db6190b 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/package-info.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/index/package-info.java
@@ -19,7 +19,7 @@
*/
@ParametersAreNonnullByDefault
-package org.sonar.plugins.cpd.index;
+package org.sonar.batch.cpd.index;
import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/package-info.java b/sonar-batch/src/main/java/org/sonar/batch/cpd/package-info.java
index 90cdee73061..8be46d698af 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/package-info.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/cpd/package-info.java
@@ -19,7 +19,7 @@
*/
@ParametersAreNonnullByDefault
-package org.sonar.plugins.cpd;
+package org.sonar.batch.cpd;
import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdPluginTest.java b/sonar-batch/src/test/java/org/sonar/batch/cpd/CpdComponentsTest.java
index 29308bf2e5f..90632426ee3 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdPluginTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cpd/CpdComponentsTest.java
@@ -17,16 +17,16 @@
* 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.plugins.cpd;
+package org.sonar.batch.cpd;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
-public class CpdPluginTest {
+public class CpdComponentsTest {
@Test
public void getExtensions() {
- assertThat(new CpdPlugin().getExtensions()).hasSize(10);
+ assertThat(CpdComponents.all()).hasSize(10);
}
}
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java b/sonar-batch/src/test/java/org/sonar/batch/cpd/CpdSensorTest.java
index a4cfc381ae8..2c6f195b880 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/CpdSensorTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cpd/CpdSensorTest.java
@@ -17,7 +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.plugins.cpd;
+package org.sonar.batch.cpd;
+
+import org.sonar.batch.cpd.CpdMappings;
+import org.sonar.batch.cpd.CpdComponents;
+import org.sonar.batch.cpd.CpdSensor;
+import org.sonar.batch.cpd.DefaultCpdEngine;
+import org.sonar.batch.cpd.JavaCpdEngine;
+import org.sonar.batch.cpd.index.IndexFactory;
import org.junit.Before;
import org.junit.Rule;
@@ -28,7 +35,6 @@ import org.sonar.api.config.PropertyDefinitions;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Java;
import org.sonar.batch.duplication.BlockCache;
-import org.sonar.plugins.cpd.index.IndexFactory;
import java.io.IOException;
@@ -50,7 +56,7 @@ public class CpdSensorTest {
IndexFactory indexFactory = mock(IndexFactory.class);
sonarEngine = new JavaCpdEngine(indexFactory, null, null);
sonarBridgeEngine = new DefaultCpdEngine(indexFactory, new CpdMappings(), null, null, mock(BlockCache.class));
- settings = new Settings(new PropertyDefinitions(CpdPlugin.class));
+ settings = new Settings(new PropertyDefinitions(CpdComponents.class));
DefaultFileSystem fs = new DefaultFileSystem(temp.newFolder().toPath());
sensor = new CpdSensor(sonarEngine, sonarBridgeEngine, settings, fs);
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/DefaultCpdEngineTest.java b/sonar-batch/src/test/java/org/sonar/batch/cpd/DefaultCpdEngineTest.java
index 8ecac586a3b..9ce86ce3ee4 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/DefaultCpdEngineTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cpd/DefaultCpdEngineTest.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.plugins.cpd;
+package org.sonar.batch.cpd;
+
+import org.sonar.batch.cpd.DefaultCpdEngine;
import org.junit.Before;
import org.junit.Test;
@@ -25,7 +27,6 @@ import org.slf4j.Logger;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Project;
import org.sonar.batch.duplication.BlockCache;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/JavaCpdEngineTest.java b/sonar-batch/src/test/java/org/sonar/batch/cpd/JavaCpdEngineTest.java
index 182f57091d0..711f70f9be4 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/JavaCpdEngineTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cpd/JavaCpdEngineTest.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.plugins.cpd;
+package org.sonar.batch.cpd;
+
+import org.sonar.batch.cpd.JavaCpdEngine;
import org.junit.Before;
import org.junit.Rule;
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/DuplicationDensityDecoratorTest.java b/sonar-batch/src/test/java/org/sonar/batch/cpd/decorators/DuplicationDensityDecoratorTest.java
index d1a9835f104..629a1cf6d5d 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/DuplicationDensityDecoratorTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cpd/decorators/DuplicationDensityDecoratorTest.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.plugins.cpd.decorators;
+package org.sonar.batch.cpd.decorators;
+
+import org.sonar.batch.cpd.decorators.DuplicationDensityDecorator;
import org.junit.Test;
import static org.mockito.Mockito.*;
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java b/sonar-batch/src/test/java/org/sonar/batch/cpd/decorators/SumDuplicationsDecoratorTest.java
index de90865b0d0..a86cfb423ed 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cpd/decorators/SumDuplicationsDecoratorTest.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.plugins.cpd.decorators;
+package org.sonar.batch.cpd.decorators;
+
+import org.sonar.batch.cpd.decorators.SumDuplicationsDecorator;
import org.junit.Test;
import org.sonar.api.batch.DecoratorContext;
@@ -26,7 +28,6 @@ import org.sonar.api.measures.Measure;
import org.sonar.api.resources.File;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.test.IsMeasure;
-
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/index/IndexFactoryTest.java b/sonar-batch/src/test/java/org/sonar/batch/cpd/index/IndexFactoryTest.java
index b515d48e2cf..d60ace37875 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/index/IndexFactoryTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/cpd/index/IndexFactoryTest.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.plugins.cpd.index;
+package org.sonar.batch.cpd.index;
+
+import org.sonar.batch.cpd.index.IndexFactory;
import org.junit.Before;
import org.junit.Test;
@@ -29,7 +31,6 @@ import org.sonar.api.resources.Project;
import org.sonar.batch.bootstrap.DefaultAnalysisMode;
import org.sonar.batch.index.ResourceCache;
import org.sonar.core.duplication.DuplicationDao;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/medium/CpdMediumTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/cpd/CpdMediumTest.java
index 43043e35eea..e5e6f6c1a1c 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/medium/CpdMediumTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/cpd/CpdMediumTest.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.plugins.cpd.medium;
+package org.sonar.batch.mediumtest.cpd;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.io.FileUtils;
@@ -32,7 +32,6 @@ import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.sensor.duplication.DuplicationGroup;
import org.sonar.batch.mediumtest.BatchMediumTester;
import org.sonar.batch.mediumtest.TaskResult;
-import org.sonar.plugins.cpd.CpdPlugin;
import org.sonar.xoo.XooPlugin;
import java.io.File;
@@ -51,7 +50,6 @@ public class CpdMediumTest {
public BatchMediumTester tester = BatchMediumTester.builder()
.registerPlugin("xoo", new XooPlugin())
- .registerPlugin("cpd", new CpdPlugin())
.addDefaultQProfile("xoo", "Sonar Way")
.build();