]> source.dussan.org Git - sonarqube.git/commitdiff
Use the same rules everywhere to transform plugin key
authorGodin <mandrikov@gmail.com>
Wed, 3 Nov 2010 09:20:24 +0000 (09:20 +0000)
committerGodin <mandrikov@gmail.com>
Wed, 3 Nov 2010 09:20:24 +0000 (09:20 +0000)
sonar-server/src/test/java/org/sonar/server/plugins/PluginDeployerTest.java

index 57ec82a5136ddcf49242625cdeacd79a2eb73a21..02f5041d4b8df81527d8327b1ae203aa9d43f5cd 100644 (file)
@@ -23,6 +23,12 @@ import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThat;
 
+import java.io.File;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
 import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.junit.Rule;
@@ -38,12 +44,6 @@ import org.sonar.server.platform.ServerImpl;
 import org.sonar.server.platform.ServerStartException;
 import org.sonar.test.TestUtils;
 
-import java.io.File;
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.List;
-
 public class PluginDeployerTest extends AbstractDbUnitTestCase {
 
   private Server server;
@@ -104,21 +104,21 @@ public class PluginDeployerTest extends AbstractDbUnitTestCase {
     List<JpaPlugin> plugins = dao.getPlugins();
     assertThat(plugins.size(), is(1)); // no more checkstyle
     JpaPlugin plugin = plugins.get(0);
-    assertThat(plugin.getKey(), is("build-breaker"));
+    assertThat(plugin.getKey(), is("buildbreaker"));
     assertThat(plugin.getFiles().size(), is(1));
     assertThat(plugin.isCore(), is(false));
     assertThat(plugin.isUseChildFirstClassLoader(), is(false));
     JpaPluginFile pluginFile = plugin.getFiles().get(0);
     assertThat(pluginFile.getFilename(), is("sonar-build-breaker-plugin-0.1.jar"));
-    assertThat(pluginFile.getPath(), is("build-breaker/sonar-build-breaker-plugin-0.1.jar"));
+    assertThat(pluginFile.getPath(), is("buildbreaker/sonar-build-breaker-plugin-0.1.jar"));
 
     // check that the file is deployed
-    File deployedJar = new File(deployDir, "plugins/build-breaker/sonar-build-breaker-plugin-0.1.jar");
+    File deployedJar = new File(deployDir, "plugins/buildbreaker/sonar-build-breaker-plugin-0.1.jar");
     assertThat(deployedJar.exists(), is(true));
     assertThat(deployedJar.isFile(), is(true));
 
     // check that the plugin has its own classloader
-    ClassLoader classloader = classloaders.getClassLoader("build-breaker");
+    ClassLoader classloader = classloaders.getClassLoader("buildbreaker");
     assertNotNull(classloader);
     assertNotNull(classloader.loadClass("org.sonar.plugins.buildbreaker.BuildBreakerPlugin"));
   }