From 3e861b4dc2810af234cfa2a97bd8519960ff3b4a Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Thu, 10 Sep 2020 14:04:14 -0500 Subject: SONAR-13643 Improve error message when duplicate plugins are present --- .../test/java/org/sonar/server/plugins/PluginJarLoaderTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/sonar-webserver-api/src/test') diff --git a/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/PluginJarLoaderTest.java b/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/PluginJarLoaderTest.java index 0297973bd14..aeb366501f0 100644 --- a/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/PluginJarLoaderTest.java +++ b/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/PluginJarLoaderTest.java @@ -202,8 +202,8 @@ public class PluginJarLoaderTest { createJar(fs.getInstalledBundledPluginsDir(), "plugin1", "main", null); String dir = getDirName(fs.getInstalledExternalPluginsDir()); - expectedException.expectMessage("Found a plugin 'plugin1' in the directory " + dir + " with the same key [plugin1] as a bundled plugin 'plugin1'. " - + "Please remove " + jar.getName()); + expectedException.expectMessage("Found a plugin 'plugin1' in the directory '" + dir + "' with the same key [plugin1] as a built-in feature 'plugin1'. " + + "Please remove '" + new File(dir, jar.getName()) + "'"); expectedException.expect(MessageException.class); underTest.loadPlugins(); } @@ -213,7 +213,7 @@ public class PluginJarLoaderTest { File downloaded = createJar(fs.getDownloadedPluginsDir(), "plugin1", "main", null); createJar(fs.getInstalledBundledPluginsDir(), "plugin1", "main", null); String dir = getDirName(fs.getDownloadedPluginsDir()); - expectedException.expectMessage("Fail to update plugin: plugin1. Bundled plugin with same key already exists: plugin1. " + expectedException.expectMessage("Fail to update plugin: plugin1. Built-in feature with same key already exists: plugin1. " + "Move or delete plugin from " + dir + " directory"); expectedException.expect(MessageException.class); underTest.loadPlugins(); @@ -225,7 +225,7 @@ public class PluginJarLoaderTest { File jar2 = createJar(fs.getInstalledExternalPluginsDir(), "plugin1", "main", null); String dir = getDirName(fs.getInstalledExternalPluginsDir()); - expectedException.expectMessage("Found two versions of the plugin 'plugin1' [plugin1] in the directory " + dir + ". Please remove "); + expectedException.expectMessage("Found two versions of the plugin 'plugin1' [plugin1] in the directory '" + dir + "'. Please remove "); expectedException.expectMessage(jar2.getName()); expectedException.expectMessage(jar1.getName()); expectedException.expect(MessageException.class); -- cgit v1.2.3