summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/DefaultServerFileSystem.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/PluginsMonitor.java18
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/plugins/PluginReferentialMetadataConverter.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java46
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/plugins/ws/InstalledAction.java15
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java8
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java16
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java21
-rw-r--r--sonar-application/assembly.xml8
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginInstallerTest.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java11
-rw-r--r--sonar-core/src/main/java/org/sonar/core/plugins/RemotePlugin.java22
-rw-r--r--sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java20
-rw-r--r--sonar-core/src/test/java/org/sonar/core/plugins/RemotePluginTest.java13
14 files changed, 52 insertions, 158 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/DefaultServerFileSystem.java b/server/sonar-server/src/main/java/org/sonar/server/platform/DefaultServerFileSystem.java
index 5258e753057..4e4843fab17 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/DefaultServerFileSystem.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/DefaultServerFileSystem.java
@@ -135,10 +135,6 @@ public class DefaultServerFileSystem implements ServerFileSystem, Startable {
return new File(getHomeDir(), "lib/bundled-plugins");
}
- public File getCorePluginsDir() {
- return new File(getHomeDir(), "lib/core-plugins");
- }
-
public File getDeprecatedPluginsDir() {
return new File(getHomeDir(), "extensions/deprecated");
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/PluginsMonitor.java b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/PluginsMonitor.java
index 591168f2831..6317fe52773 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/PluginsMonitor.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/PluginsMonitor.java
@@ -20,16 +20,11 @@
package org.sonar.server.platform.monitoring;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
+import java.util.LinkedHashMap;
import org.sonar.core.platform.PluginInfo;
import org.sonar.core.platform.PluginRepository;
import org.sonar.updatecenter.common.Version;
-import javax.annotation.Nonnull;
-
-import java.util.LinkedHashMap;
-
/**
* Installed plugins (excluding core plugins)
*/
@@ -48,7 +43,7 @@ public class PluginsMonitor implements Monitor {
@Override
public LinkedHashMap<String, Object> attributes() {
LinkedHashMap<String, Object> attributes = new LinkedHashMap<>();
- for (PluginInfo plugin : plugins()) {
+ for (PluginInfo plugin : repository.getPluginInfos()) {
LinkedHashMap<String, Object> pluginAttributes = new LinkedHashMap<>();
pluginAttributes.put("Name", plugin.getName());
Version version = plugin.getVersion();
@@ -59,13 +54,4 @@ public class PluginsMonitor implements Monitor {
}
return attributes;
}
-
- private Iterable<PluginInfo> plugins() {
- return Iterables.filter(repository.getPluginInfos(), new Predicate<PluginInfo>() {
- @Override
- public boolean apply(@Nonnull PluginInfo info) {
- return !info.isCore();
- }
- });
- }
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/plugins/PluginReferentialMetadataConverter.java b/server/sonar-server/src/main/java/org/sonar/server/plugins/PluginReferentialMetadataConverter.java
index 1355a971f0c..6d991d8ee31 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/plugins/PluginReferentialMetadataConverter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/plugins/PluginReferentialMetadataConverter.java
@@ -48,9 +48,7 @@ public class PluginReferentialMetadataConverter {
private static List<PluginManifest> getPluginManifestList(Collection<PluginInfo> metadata) {
List<PluginManifest> pluginManifestList = newArrayList();
for (PluginInfo plugin : metadata) {
- if (!plugin.isCore()) {
- pluginManifestList.add(toPluginManifest(plugin));
- }
+ pluginManifestList.add(toPluginManifest(plugin));
}
return pluginManifestList;
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java b/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java
index 83b4f060fc2..ea29ff323f7 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java
@@ -25,7 +25,16 @@ import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Ordering;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.annotation.Nonnull;
import org.apache.commons.io.FileUtils;
import org.picocontainer.Startable;
import org.sonar.api.Plugin;
@@ -38,17 +47,6 @@ import org.sonar.core.platform.PluginInfo;
import org.sonar.core.platform.PluginLoader;
import org.sonar.core.platform.PluginRepository;
import org.sonar.server.platform.DefaultServerFileSystem;
-
-import javax.annotation.Nonnull;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
import org.sonar.updatecenter.common.Version;
import static com.google.common.collect.Iterables.transform;
@@ -73,7 +71,7 @@ import static org.sonar.core.platform.PluginInfo.jarToPluginInfo;
public class ServerPluginRepository implements PluginRepository, Startable {
private static final Logger LOG = Loggers.get(ServerPluginRepository.class);
- private static final String[] JAR_FILE_EXTENSIONS = new String[]{"jar"};
+ private static final String[] JAR_FILE_EXTENSIONS = new String[] {"jar"};
private static final Set<String> DEFAULT_BLACKLISTED_PLUGINS = ImmutableSet.of("scmactivity", "issuesreport");
private static final Joiner SLASH_JOINER = Joiner.on(" / ").skipNulls();
@@ -105,7 +103,6 @@ public class ServerPluginRepository implements PluginRepository, Startable {
loadPreInstalledPlugins();
copyBundledPlugins();
moveDownloadedPlugins();
- loadCorePlugins();
unloadIncompatiblePlugins();
logInstalledPlugins();
loadInstances();
@@ -208,13 +205,6 @@ public class ServerPluginRepository implements PluginRepository, Startable {
}
}
- private void loadCorePlugins() {
- for (File file : listJarFiles(fs.getCorePluginsDir())) {
- PluginInfo info = PluginInfo.create(file).setCore(true);
- registerPluginInfo(info);
- }
- }
-
/**
* Removes the plugins that are not compatible with current environment.
*/
@@ -294,15 +284,13 @@ public class ServerPluginRepository implements PluginRepository, Startable {
for (String uninstallKey : uninstallKeys) {
PluginInfo info = pluginInfosByKeys.get(uninstallKey);
- if (!info.isCore()) {
- try {
- LOG.info("Uninstalling plugin {} [{}]", info.getName(), info.getKey());
- // we don't reuse info.getFile() just to be sure that file is located in from extensions/plugins
- File masterFile = new File(fs.getInstalledPluginsDir(), info.getNonNullJarFile().getName());
- moveFileToDirectory(masterFile, uninstalledPluginsDir(), true);
- } catch (IOException e) {
- throw new IllegalStateException(format("Fail to uninstall plugin %s [%s]", info.getName(), info.getKey()), e);
- }
+ try {
+ LOG.info("Uninstalling plugin {} [{}]", info.getName(), info.getKey());
+ // we don't reuse info.getFile() just to be sure that file is located in from extensions/plugins
+ File masterFile = new File(fs.getInstalledPluginsDir(), info.getNonNullJarFile().getName());
+ moveFileToDirectory(masterFile, uninstalledPluginsDir(), true);
+ } catch (IOException e) {
+ throw new IllegalStateException(format("Fail to uninstall plugin %s [%s]", info.getName(), info.getKey()), e);
}
}
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/plugins/ws/InstalledAction.java b/server/sonar-server/src/main/java/org/sonar/server/plugins/ws/InstalledAction.java
index bd0addab688..97946e070be 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/plugins/ws/InstalledAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/plugins/ws/InstalledAction.java
@@ -34,6 +34,7 @@ import javax.annotation.Nullable;
import java.util.Collection;
import java.util.SortedSet;
+import static com.google.common.collect.ImmutableSortedSet.copyOf;
import static com.google.common.collect.Iterables.filter;
import static org.sonar.server.plugins.ws.PluginWSCommons.NAME_KEY_PLUGIN_METADATA_COMPARATOR;
@@ -76,10 +77,7 @@ public class InstalledAction implements PluginsWsAction {
}
private SortedSet<PluginInfo> retrieveAndSortPluginMetadata() {
- return ImmutableSortedSet.copyOf(
- NAME_KEY_PLUGIN_METADATA_COMPARATOR,
- filter(pluginRepository.getPluginInfos(), NotCorePluginsPredicate.INSTANCE)
- );
+ return copyOf(NAME_KEY_PLUGIN_METADATA_COMPARATOR, pluginRepository.getPluginInfos());
}
private void writeMetadataList(JsonWriter jsonWriter, Collection<PluginInfo> pluginMetadatas) {
@@ -90,13 +88,4 @@ public class InstalledAction implements PluginsWsAction {
}
jsonWriter.endArray();
}
-
- private enum NotCorePluginsPredicate implements Predicate<PluginInfo> {
- INSTANCE;
-
- @Override
- public boolean apply(@Nullable PluginInfo input) {
- return input != null && !input.isCore();
- }
- }
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java
index c7891203caa..f75b8b34b8c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java
@@ -38,12 +38,4 @@ public class PluginReferentialMetadataConverterTest {
assertThat(pluginReferential.getPlugins().get(0).getKey()).isEqualTo("foo");
}
- @Test
- public void should_not_add_core_plugin() {
- PluginInfo info = new PluginInfo("foo").setCore(true);
-
- PluginReferential pluginReferential = PluginReferentialMetadataConverter.getInstalledPluginReferential(newArrayList(info));
- assertThat(pluginReferential).isNotNull();
- assertThat(pluginReferential.getPlugins()).hasSize(0);
- }
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java
index 9381a722e9b..238d76f0f8c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java
@@ -63,7 +63,6 @@ public class ServerPluginRepositoryTest {
@Before
public void setUp() throws IOException {
when(fs.getBundledPluginsDir()).thenReturn(temp.newFolder());
- when(fs.getCorePluginsDir()).thenReturn(temp.newFolder());
when(fs.getDeployedPluginsDir()).thenReturn(temp.newFolder());
when(fs.getDownloadedPluginsDir()).thenReturn(temp.newFolder());
when(fs.getHomeDir()).thenReturn(temp.newFolder());
@@ -78,18 +77,17 @@ public class ServerPluginRepositoryTest {
}
/**
- * The first server startup (fresh db) installs bundled plugins and instantiates bundled + core plugins.
+ * The first server startup (fresh db) installs bundled plugins and instantiates bundled plugins.
*/
@Test
public void first_startup_installs_bundled_plugins() throws Exception {
copyTestPluginTo("test-base-plugin", fs.getBundledPluginsDir());
- copyTestPluginTo("test-core-plugin", fs.getCorePluginsDir());
when(upgradeStatus.isFreshInstall()).thenReturn(true);
underTest.start();
// both plugins are installed
- assertThat(underTest.getPluginInfosByKeys()).containsOnlyKeys("core", "testbase");
+ assertThat(underTest.getPluginInfosByKeys()).containsOnlyKeys("testbase");
}
@Test
@@ -103,20 +101,14 @@ public class ServerPluginRepositoryTest {
}
@Test
- public void standard_startup_loads_core_and_installed_plugins() throws Exception {
+ public void standard_startup_loads_installed_plugins() throws Exception {
copyTestPluginTo("test-base-plugin", fs.getInstalledPluginsDir());
- copyTestPluginTo("test-core-plugin", fs.getCorePluginsDir());
underTest.start();
- // both plugins are installed
- assertThat(underTest.getPluginInfosByKeys()).containsOnlyKeys("core", "testbase");
+ assertThat(underTest.getPluginInfosByKeys()).containsOnlyKeys("testbase");
}
- /**
- * That sounds impossible, there are still core plugins for now, but it's still valuable
- * to test sensibility to null values.
- */
@Test
public void no_plugins_at_all_on_startup() {
underTest.start();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java
index 15d405ccfa7..2087259a96e 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java
@@ -19,6 +19,7 @@
*/
package org.sonar.server.plugins.ws;
+import java.io.File;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -29,8 +30,6 @@ import org.sonar.server.plugins.ServerPluginRepository;
import org.sonar.server.ws.WsTester;
import org.sonar.updatecenter.common.Version;
-import java.io.File;
-
import static com.google.common.collect.ImmutableList.of;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
@@ -78,19 +77,10 @@ public class InstalledActionTest {
}
@Test
- public void core_plugin_are_not_returned() throws Exception {
- when(pluginRepository.getPluginInfos()).thenReturn(of(corePlugin("core1", "1.0")));
-
- underTest.handle(request, response);
-
- assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo(JSON_EMPTY_PLUGIN_LIST);
- }
-
- @Test
public void empty_fields_are_not_serialized_to_json() throws Exception {
when(pluginRepository.getPluginInfos()).thenReturn(
of(
- new PluginInfo("").setName("").setCore(false)
+ new PluginInfo("").setName("")
)
);
@@ -105,7 +95,6 @@ public class InstalledActionTest {
when(pluginRepository.getPluginInfos()).thenReturn(of(
new PluginInfo("plugKey")
.setName("plugName")
- .setCore(false)
.setDescription("desc_it")
.setVersion(Version.create("1.0"))
.setLicense("license_hey")
@@ -189,11 +178,7 @@ public class InstalledActionTest {
assertThat(response.outputAsString()).containsOnlyOnce("name2");
}
- private PluginInfo corePlugin(String key, String version) {
- return new PluginInfo(key).setName(key).setCore(true).setVersion(Version.create(version));
- }
-
private PluginInfo plugin(String key, String name) {
- return new PluginInfo(key).setName(name).setCore(false).setVersion(Version.create("1.0"));
+ return new PluginInfo(key).setName(name).setVersion(Version.create("1.0"));
}
}
diff --git a/sonar-application/assembly.xml b/sonar-application/assembly.xml
index 88bb3d32225..3571189d7cd 100644
--- a/sonar-application/assembly.xml
+++ b/sonar-application/assembly.xml
@@ -79,14 +79,6 @@
</dependencySet>
<!-- Plugins -->
<dependencySet>
- <outputDirectory>lib/core-plugins</outputDirectory>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <includes>
- <include>org.codehaus.sonar.plugins:*</include>
- </includes>
- <scope>provided</scope>
- </dependencySet>
- <dependencySet>
<outputDirectory>lib/bundled-plugins</outputDirectory>
<useTransitiveDependencies>false</useTransitiveDependencies>
<includes>
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 03c3707919b..319f056dda1 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
@@ -51,7 +51,7 @@ public class BatchPluginInstallerTest {
public void listRemotePlugins() {
ServerClient server = mock(ServerClient.class);
- when(server.request("/deploy/plugins/index.txt")).thenReturn("checkstyle,false\nsqale,false");
+ when(server.request("/deploy/plugins/index.txt")).thenReturn("checkstyle\nsqale");
BatchPluginInstaller installer = new BatchPluginInstaller(server, fileCache, pluginPredicate);
List<RemotePlugin> remotePlugins = installer.listRemotePlugins();
@@ -66,7 +66,7 @@ public class BatchPluginInstallerTest {
ServerClient server = mock(ServerClient.class);
BatchPluginInstaller installer = new BatchPluginInstaller(server, fileCache, pluginPredicate);
- RemotePlugin remote = new RemotePlugin("checkstyle", true).setFile("checkstyle-plugin.jar", "fakemd5_1");
+ RemotePlugin remote = new RemotePlugin("checkstyle").setFile("checkstyle-plugin.jar", "fakemd5_1");
File file = installer.download(remote);
assertThat(file).isEqualTo(pluginJar);
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java b/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java
index c11a618b0fd..63938311df0 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java
@@ -133,8 +133,6 @@ public class PluginInfo implements Comparable<PluginInfo> {
@CheckForNull
private String basePlugin;
- private boolean core = false;
-
@CheckForNull
private String implementationBuild;
@@ -223,10 +221,6 @@ public class PluginInfo implements Comparable<PluginInfo> {
return basePlugin;
}
- public boolean isCore() {
- return core;
- }
-
@CheckForNull
public String getImplementationBuild() {
return implementationBuild;
@@ -305,11 +299,6 @@ public class PluginInfo implements Comparable<PluginInfo> {
return this;
}
- public PluginInfo setCore(boolean b) {
- this.core = b;
- return this;
- }
-
public PluginInfo setImplementationBuild(@Nullable String implementationBuild) {
this.implementationBuild = implementationBuild;
return this;
diff --git a/sonar-core/src/main/java/org/sonar/core/plugins/RemotePlugin.java b/sonar-core/src/main/java/org/sonar/core/plugins/RemotePlugin.java
index 559faeb5a1a..f460118d445 100644
--- a/sonar-core/src/main/java/org/sonar/core/plugins/RemotePlugin.java
+++ b/sonar-core/src/main/java/org/sonar/core/plugins/RemotePlugin.java
@@ -19,33 +19,30 @@
*/
package org.sonar.core.plugins;
+import java.io.File;
import org.apache.commons.lang.StringUtils;
import org.sonar.core.platform.PluginInfo;
import org.sonar.home.cache.FileHashes;
-import java.io.File;
-
public class RemotePlugin {
private String pluginKey;
private RemotePluginFile file = null;
- private boolean core;
- public RemotePlugin(String pluginKey, boolean core) {
+ public RemotePlugin(String pluginKey) {
this.pluginKey = pluginKey;
- this.core = core;
}
public static RemotePlugin create(PluginInfo pluginInfo) {
- RemotePlugin result = new RemotePlugin(pluginInfo.getKey(), pluginInfo.isCore());
+ RemotePlugin result = new RemotePlugin(pluginInfo.getKey());
result.setFile(pluginInfo.getNonNullJarFile());
return result;
}
public static RemotePlugin unmarshal(String row) {
String[] fields = StringUtils.split(row, ",");
- RemotePlugin result = new RemotePlugin(fields[0], Boolean.parseBoolean(fields[1]));
- if (fields.length > 2) {
- String[] nameAndHash = StringUtils.split(fields[2], "|");
+ RemotePlugin result = new RemotePlugin(fields[0]);
+ if (fields.length >= 2) {
+ String[] nameAndHash = StringUtils.split(fields[1], "|");
result.setFile(nameAndHash[0], nameAndHash[1]);
}
return result;
@@ -53,8 +50,7 @@ public class RemotePlugin {
public String marshal() {
StringBuilder sb = new StringBuilder();
- sb.append(pluginKey).append(",");
- sb.append(String.valueOf(core));
+ sb.append(pluginKey);
sb.append(",").append(file.getFilename()).append("|").append(file.getHash());
return sb.toString();
}
@@ -63,10 +59,6 @@ public class RemotePlugin {
return pluginKey;
}
- public boolean isCore() {
- return core;
- }
-
public RemotePlugin setFile(String filename, String hash) {
file = new RemotePluginFile(filename, hash);
return this;
diff --git a/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java b/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
index d64a7323ff7..22f5e462afe 100644
--- a/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
@@ -19,6 +19,11 @@
*/
package org.sonar.core.platform;
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import javax.annotation.Nullable;
import org.apache.commons.io.FileUtils;
import org.junit.Rule;
import org.junit.Test;
@@ -26,13 +31,6 @@ import org.junit.rules.TemporaryFolder;
import org.sonar.updatecenter.common.PluginManifest;
import org.sonar.updatecenter.common.Version;
-import javax.annotation.Nullable;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-
import static com.google.common.collect.Ordering.natural;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
@@ -60,7 +58,7 @@ public class PluginInfoTest {
}
@Test
- public void test_comparison() {
+ public void test_comparison() {
PluginInfo java1 = new PluginInfo("java").setVersion(Version.create("1.0"));
PluginInfo java2 = new PluginInfo("java").setVersion(Version.create("2.0"));
PluginInfo javaNoVersion = new PluginInfo("java");
@@ -142,7 +140,6 @@ public class PluginInfoTest {
assertThat(pluginInfo.getVersion().getName()).isEqualTo("1.0");
assertThat(pluginInfo.getJarFile()).isSameAs(jarFile);
assertThat(pluginInfo.getMainClass()).isEqualTo("org.foo.FooPlugin");
- assertThat(pluginInfo.isCore()).isFalse();
assertThat(pluginInfo.getBasePlugin()).isNull();
assertThat(pluginInfo.getDescription()).isNull();
assertThat(pluginInfo.getHomepageUrl()).isNull();
@@ -171,10 +168,10 @@ public class PluginInfoTest {
manifest.setOrganization("SonarSource");
manifest.setOrganizationUrl("http://sonarsource.com");
manifest.setIssueTrackerUrl("http://jira.com");
- manifest.setRequirePlugins(new String[]{"java:2.0", "pmd:1.3"});
+ manifest.setRequirePlugins(new String[] {"java:2.0", "pmd:1.3"});
File jarFile = temp.newFile();
- PluginInfo pluginInfo = PluginInfo.create(jarFile, manifest).setCore(true);
+ PluginInfo pluginInfo = PluginInfo.create(jarFile, manifest);
assertThat(pluginInfo.getBasePlugin()).isEqualTo("findbugs");
assertThat(pluginInfo.getDescription()).isEqualTo("the desc");
@@ -186,7 +183,6 @@ public class PluginInfoTest {
assertThat(pluginInfo.getOrganizationUrl()).isEqualTo("http://sonarsource.com");
assertThat(pluginInfo.getMinimalSqVersion().getName()).isEqualTo("4.5.1");
assertThat(pluginInfo.getRequiredPlugins()).extracting("key").containsOnly("java", "pmd");
- assertThat(pluginInfo.isCore()).isTrue();
}
@Test
diff --git a/sonar-core/src/test/java/org/sonar/core/plugins/RemotePluginTest.java b/sonar-core/src/test/java/org/sonar/core/plugins/RemotePluginTest.java
index 210813650b4..7649e0e13a1 100644
--- a/sonar-core/src/test/java/org/sonar/core/plugins/RemotePluginTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/plugins/RemotePluginTest.java
@@ -27,9 +27,9 @@ import static org.junit.Assert.assertThat;
public class RemotePluginTest {
@Test
public void shouldEqual() {
- RemotePlugin clirr1 = new RemotePlugin("clirr", false);
- RemotePlugin clirr2 = new RemotePlugin("clirr", false);
- RemotePlugin checkstyle = new RemotePlugin("checkstyle", true);
+ RemotePlugin clirr1 = new RemotePlugin("clirr");
+ RemotePlugin clirr2 = new RemotePlugin("clirr");
+ RemotePlugin checkstyle = new RemotePlugin("checkstyle");
assertThat(clirr1.equals(clirr2), is(true));
assertThat(clirr1.equals(clirr1), is(true));
assertThat(clirr1.equals(checkstyle), is(false));
@@ -37,16 +37,15 @@ public class RemotePluginTest {
@Test
public void shouldMarshal() {
- RemotePlugin clirr = new RemotePlugin("clirr", false).setFile("clirr-1.1.jar", "fakemd5");
+ RemotePlugin clirr = new RemotePlugin("clirr").setFile("clirr-1.1.jar", "fakemd5");
String text = clirr.marshal();
- assertThat(text, is("clirr,false,clirr-1.1.jar|fakemd5"));
+ assertThat(text, is("clirr,clirr-1.1.jar|fakemd5"));
}
@Test
public void shouldUnmarshal() {
- RemotePlugin clirr = RemotePlugin.unmarshal("clirr,false,clirr-1.1.jar|fakemd5");
+ RemotePlugin clirr = RemotePlugin.unmarshal("clirr,clirr-1.1.jar|fakemd5");
assertThat(clirr.getKey(), is("clirr"));
- assertThat(clirr.isCore(), is(false));
assertThat(clirr.file().getFilename(), is("clirr-1.1.jar"));
assertThat(clirr.file().getHash(), is("fakemd5"));
}