<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-java-plugin</artifactId>
- <type>sonar-plugin</type>
<version>${sonarJava.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-java-plugin</artifactId>
- <type>sonar-plugin</type>
<version>${sonarJava.version}</version>
<scope>provided</scope>
</dependency>
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.sonar.api.batch.AbstractCoverageExtension;
import org.sonar.api.batch.CoverageExtension;
import org.sonar.api.batch.DependsUpon;
import org.sonar.api.batch.Sensor;
*/
package org.sonar.batch.bootstrap;
-import org.sonar.api.Plugins;
import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.ResourceTypes;
container.addSingleton(MemoryOptimizer.class);
container.addSingleton(DefaultResourcePersister.class);
container.addSingleton(SourcePersister.class);
- container.addSingleton(Plugins.class);
container.addSingleton(MeasuresDao.class);
container.addSingleton(CacheRuleFinder.class);
container.addSingleton(CacheMetricFinder.class);
}
}
- public Collection<Plugin> getPlugins() {
- return pluginsByKey.values();
- }
-
public Plugin getPlugin(String key) {
return pluginsByKey.get(key);
}
- public Map<String, Plugin> getPluginsByKey() {
- return Collections.unmodifiableMap(pluginsByKey);
- }
-
- // TODO remove this method. Not used in batch.
- public Property[] getProperties(Plugin plugin) {
- if (plugin != null) {
- Class<? extends Plugin> classInstance = plugin.getClass();
- if (classInstance.isAnnotationPresent(Properties.class)) {
- return classInstance.getAnnotation(Properties.class).value();
- }
- }
- return new Property[0];
- }
-
public Collection<PluginMetadata> getMetadata() {
return metadataByKey.values();
}
Class<?> lpClass = defineClass("org.sonar.batch.bootstrap.JdbcLeakPrevention", classBytes, 0, offset, this.getClass().getProtectionDomain());
Object obj = lpClass.newInstance();
- List<String> driverNames = (List<String>) obj.getClass().getMethod("clearJdbcDriverRegistrations").invoke(obj);
+ List<String> driverNames = (List<String>) obj.getClass().getMethod("unregisterDrivers").invoke(obj);
for (String name : driverNames) {
LOG.debug("To prevent a memory leak, the JDBC Driver [{}] has been forcibly deregistered", name);
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
+import java.util.Set;
/**
* Companion of {@link JdbcDriverHolder} and allows it to deregister JDBC drivers.
public class JdbcLeakPrevention {
/**
- * @return list of names of deregistered drivers
+ * @return names of the drivers that have been unregistered
*/
- public List<String> clearJdbcDriverRegistrations() throws SQLException {
- List<String> driverNames = new ArrayList<String>();
- HashSet<Driver> originalDrivers = new HashSet<Driver>();
+ public List<String> unregisterDrivers() throws SQLException {
+ Set<Driver> registeredDrivers = registeredDrivers();
+
+ List<String> unregisteredNames = new ArrayList<String>();
Enumeration<Driver> drivers = DriverManager.getDrivers();
- while (drivers.hasMoreElements()) {
- originalDrivers.add(drivers.nextElement());
- }
- drivers = DriverManager.getDrivers();
while (drivers.hasMoreElements()) {
Driver driver = drivers.nextElement();
if (driver.getClass().getClassLoader() != this.getClass().getClassLoader()) {
continue;
}
- if (originalDrivers.contains(driver)) {
- driverNames.add(driver.getClass().getCanonicalName());
+ if (registeredDrivers.contains(driver)) {
+ unregisteredNames.add(driver.getClass().getCanonicalName());
}
DriverManager.deregisterDriver(driver);
}
- return driverNames;
+ return unregisteredNames;
+ }
+
+ private Set<Driver> registeredDrivers() {
+ Set<Driver> registeredDrivers = new HashSet<Driver>();
+ Enumeration<Driver> drivers = DriverManager.getDrivers();
+ while (drivers.hasMoreElements()) {
+ registeredDrivers.add(drivers.nextElement());
+ }
+ return registeredDrivers;
}
}
*/
package org.sonar.batch.bootstrap;
-import org.picocontainer.ComponentAdapter;
import org.sonar.api.platform.ComponentContainer;
-import org.sonar.api.platform.PluginMetadata;
-
-import javax.annotation.Nullable;
-
-import java.util.List;
/**
* Module describes group of components - {@link #configure()}.
- * Several modules can be grouped together - {@link #install(Module)}, {@link #installChild(Module)}.
+ * Several modules can be grouped together - {@link #installChild(Module)}.
* <p/>
*/
public abstract class Module {
return this;
}
- /**
- * Installs module into this module.
- *
- * @return this
- */
- public final Module install(Module module) {
- module.init(container);
- return this;
- }
-
/**
* Installs module into new scope - see http://picocontainer.org/scopes.html
*
import org.sonar.api.profiles.RulesProfile;
import org.sonar.api.resources.Languages;
import org.sonar.api.resources.Project;
-import org.sonar.api.utils.IocContainer;
import org.sonar.batch.DefaultProfileLoader;
import org.sonar.batch.DefaultProjectClasspath;
import org.sonar.batch.DefaultProjectFileSystem2;
container.addSingleton(project.getConfiguration());
container.addSingleton(ProjectSettings.class);
container.addSingleton(UnsupportedProperties.class);
- container.addSingleton(IocContainer.class);
for (Object component : projectDefinition.getContainerExtensions()) {
container.addSingleton(component);
import com.google.common.collect.Lists;
import org.sonar.api.batch.SensorContext;
import org.sonar.api.resources.Project;
-import org.sonar.batch.phases.ProjectInitializer;
import org.sonar.batch.events.EventBus;
import org.sonar.batch.index.DefaultIndex;
import org.sonar.batch.index.PersistenceManager;
import java.util.Collection;
-import java.util.List;
public final class Phases {
public static Collection<Class> getPhaseClasses() {
return Lists.<Class>newArrayList(DecoratorsExecutor.class, MavenPhaseExecutor.class, MavenPluginsConfigurator.class,
- PostJobsExecutor.class, SensorsExecutor.class,
- InitializersExecutor.class, ProjectInitializer.class, UpdateStatusJob.class);
+ PostJobsExecutor.class, SensorsExecutor.class,
+ InitializersExecutor.class, ProjectInitializer.class, UpdateStatusJob.class);
}
private EventBus eventBus;
PersistenceManager persistenceManager, SensorContext sensorContext, DefaultIndex index,
EventBus eventBus, ProjectInitializer pi) {
this(decoratorsExecutor, mavenPhaseExecutor, mavenPluginsConfigurator, initializersExecutor, postJobsExecutor,
- sensorsExecutor, persistenceManager, sensorContext, index, eventBus, null, pi);
+ sensorsExecutor, persistenceManager, sensorContext, index, eventBus, null, pi);
}
/**
--- /dev/null
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2012 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.batch.bootstrap;
+
+import org.junit.Test;
+import org.sonar.api.batch.InstantiationStrategy;
+import org.sonar.api.platform.ComponentContainer;
+
+import static org.fest.assertions.Assertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+public class BatchModuleTest {
+ @Test
+ public void should_register_batch_extensions() {
+ final ExtensionInstaller extensionInstaller = mock(ExtensionInstaller.class);
+ Module bootstrapModule = new Module() {
+ @Override
+ protected void configure() {
+ // used to install project extensions
+ container.addSingleton(extensionInstaller);
+ }
+ };
+ bootstrapModule.init();
+ BatchModule module = new BatchModule();
+ bootstrapModule.installChild(module);
+
+ verify(extensionInstaller).install(any(ComponentContainer.class), eq(InstantiationStrategy.BATCH));
+ assertThat(module.container.getComponentByType(MetricProvider.class)).isNotNull();
+ }
+}
repository.doStart(Arrays.asList(checkstyle));
- assertThat(repository.getPlugins().size(), Matchers.is(1));
assertThat(repository.getPlugin("checkstyle"), not(nullValue()));
assertThat(repository.getMetadata().size(), Matchers.is(1));
assertThat(repository.getMetadata("checkstyle").getName(), Matchers.is("Checkstyle"));
repository.doStart(Arrays.asList(checkstyle, checkstyleExt));
- assertThat(repository.getPlugins().size(), Matchers.is(2));
assertThat(repository.getPlugin("checkstyle"), not(nullValue()));
assertThat(repository.getPlugin("checkstyleextensions"), not(nullValue()));
assertThat(repository.getMetadata().size(), Matchers.is(2));
@Test
public void shouldLoadPluginDeprecatedExtensions() throws IOException {
RemotePlugin checkstyle = new RemotePlugin("checkstyle", true)
- .addFilename("checkstyle-ext.xml");
+ .addFilename("checkstyle-ext.xml");
PluginDownloader downloader = mock(PluginDownloader.class);
when(downloader.downloadPlugin(checkstyle)).thenReturn(copyFiles("sonar-checkstyle-plugin-2.8.jar", "checkstyle-ext.xml"));
repository.doStart(Arrays.asList(checkstyle));
- assertThat(repository.getPlugins().size(), Matchers.is(1));
assertThat(repository.getPlugin("checkstyle"), not(nullValue()));
assertThat(repository.getMetadata().size(), Matchers.is(1));
assertThat(repository.getMetadata("checkstyle").getName(), Matchers.is("Checkstyle"));
assertThat(repository.getMetadata("checkstyle").getDeployedFiles().size(), Matchers.is(5)); // plugin + 3 dependencies + 1 deprecated
- // extension
+ // extension
}
@Test
repository.doStart(Arrays.asList(checkstyle, checkstyleExt));
- assertThat(repository.getPlugins().size(), Matchers.is(0));
assertThat(repository.getMetadata().size(), Matchers.is(0));
}
--- /dev/null
+package org.sonar.batch.bootstrap;
+
+import org.junit.Test;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+import org.picocontainer.Startable;
+import org.sonar.api.batch.InstantiationStrategy;
+import org.sonar.api.batch.bootstrap.ProjectDefinition;
+import org.sonar.api.batch.bootstrap.ProjectReactor;
+import org.sonar.api.config.Settings;
+import org.sonar.api.platform.ComponentContainer;
+
+import static org.fest.assertions.Assertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+public class BootstrapExtensionExecutorTest {
+ private ProjectReactor reactor = new ProjectReactor(ProjectDefinition.create().setKey("foo"));
+
+ @Test
+ public void start() {
+ ComponentContainer container = new ComponentContainer();
+ // dependencies required for ProjectExclusions
+ container.addSingleton(reactor);
+ container.addSingleton(new Settings());
+
+ // declare a bootstrap component
+ final Startable bootstrapComponent = mock(Startable.class);
+ ExtensionInstaller installer = mock(ExtensionInstaller.class);
+ doAnswer(new Answer() {
+ public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
+ ComponentContainer childContainer = (ComponentContainer) invocationOnMock.getArguments()[0];
+ childContainer.addSingleton(bootstrapComponent);
+ return null;
+ }
+ }).when(installer).install(any(ComponentContainer.class), eq(InstantiationStrategy.BOOTSTRAP));
+
+ BootstrapExtensionExecutor executor = new BootstrapExtensionExecutor(container, installer);
+ executor.start();
+
+ // should install bootstrap components into a ephemeral container
+ verify(installer).install(any(ComponentContainer.class), eq(InstantiationStrategy.BOOTSTRAP));
+ verify(bootstrapComponent).start();
+ verify(bootstrapComponent).stop();
+
+ // the ephemeral container is destroyed
+ assertThat(container.getComponentByType(ProjectExclusions.class)).isNull();
+ assertThat(container.getChild()).isNull();
+ }
+
+
+}
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api;
-
-import org.sonar.api.platform.PluginRepository;
-
-import java.util.Collection;
-
-/**
- * Plugins dictionary. This class is for internal use
- *
- * @since 1.10
- * @deprecated since 2.1
- */
-@Deprecated
-public class Plugins {
-
- private PluginRepository pluginProvider;
-
- /**
- * Creates the dictionnary of plugins
- */
- public Plugins(PluginRepository pluginProvider) {
- this.pluginProvider = pluginProvider;
- }
-
- /**
- * Gives a collection of available plugins in the Sonar instance
- */
- public Collection<Plugin> getPlugins() {
- return pluginProvider.getPlugins();
- }
-
- /**
- * Returns a plugin based on its key
- */
- public Plugin getPlugin(String key) {
- return pluginProvider.getPlugin(key);
- }
- /**
- * Returns the list of properties of a plugin
- */
- public Property[] getProperties(Plugin plugin) {
- return pluginProvider.getProperties(plugin);
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.batch;
-
-import org.sonar.api.Plugins;
-import org.sonar.api.resources.Project;
-
-/**
- * This class implements the management of the code coverage engine if there are several.
- * It is a pre-implementation for Sensors and Decorators
- *
- * @since 1.10
- * @deprecated since 2.6 was superseded by interface {@link CoverageExtension}
- */
-@Deprecated
-public abstract class AbstractCoverageExtension implements CoverageExtension {
-
- /**
- * The plugin key to retrieve the coverage engine to be used
- */
- public static final String PARAM_PLUGIN = "sonar.core.codeCoveragePlugin";
-
- /**
- * The default value for the code coverage plugin
- */
- public static final String DEFAULT_PLUGIN = "cobertura";
-
- /**
- * Default constructor
- *
- * @param plugins the list of plugins available
- * @deprecated since 2.3. Use the default constructor
- */
- @Deprecated
- public AbstractCoverageExtension(Plugins plugins) {
- }
-
- public AbstractCoverageExtension() {
- }
-
- /**
- * Whether to implement the extension on the project
- */
- public boolean shouldExecuteOnProject(Project project) {
- return project.getAnalysisType().isDynamic(true);
- }
-}
*
* @since 2.9
*/
-public final class ProjectDefinition {
+public class ProjectDefinition {
public static final String SOURCE_DIRS_PROPERTY = "sonar.sources";
public static final String SOURCE_FILES_PROPERTY = "sonar.sourceFiles";
*/
package org.sonar.api.batch.bootstrap;
+import org.sonar.api.BatchComponent;
+
import java.util.ArrayList;
import java.util.List;
/**
* @since 2.9
*/
-public class ProjectReactor {
+public class ProjectReactor implements BatchComponent {
private ProjectDefinition root;
public ComponentContainer getChild() {
return child;
}
-
- /**
- * Warning - do not use. This method exists only for the backward-compatibility due to the suppression
- * of {@link org.sonar.api.utils.IocContainer}
- * @return
- */
- public MutablePicoContainer getPicoContainer() {
- return pico;
- }
}
import java.util.Collection;
public interface PluginRepository extends BatchComponent, ServerComponent {
- Collection<Plugin> getPlugins();
-
Plugin getPlugin(String key);
- Property[] getProperties(Plugin plugin);
-
/**
* Metadata of installed plugins. Metadata includes all the fields available in update center
* (plugin key, name, version, description, license, ...) and some technical information like
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.utils;
-
-import org.picocontainer.Characteristics;
-import org.picocontainer.DefaultPicoContainer;
-import org.picocontainer.MutablePicoContainer;
-import org.picocontainer.behaviors.OptInCaching;
-import org.picocontainer.lifecycle.ReflectionLifecycleStrategy;
-import org.picocontainer.monitors.NullComponentMonitor;
-import org.sonar.api.platform.ComponentContainer;
-
-
-/**
- * Proxy to inject the container as a component$
- *
- * @since 1.10
- * @deprecated since 2.12. To be replaced by {@link org.sonar.api.platform.ComponentContainer}
- */
-@Deprecated
-public class IocContainer {
- private final MutablePicoContainer pico;
-
- public IocContainer(MutablePicoContainer pico) {
- this.pico = pico;
- }
-
- public IocContainer(ComponentContainer container) {
- this.pico = container.getPicoContainer();
- }
-
- public MutablePicoContainer getPicoContainer() {
- return pico;
- }
-
- public static MutablePicoContainer buildPicoContainer() {
- ReflectionLifecycleStrategy lifecycleStrategy = new ReflectionLifecycleStrategy(new
- NullComponentMonitor(), "start", "stop", "dispose");
-
- DefaultPicoContainer result = new DefaultPicoContainer(new OptInCaching(), lifecycleStrategy, null);
- result.as(Characteristics.CACHE).addComponent(new IocContainer(result)); // for components that directly inject other components (eg Plugins)
- return result;
- }
-}
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.batch;
-
-import org.junit.Test;
-import org.sonar.api.resources.Project;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class AbstractCoverageExtensionTest {
-
- @Test
- public void doNotExecuteIfStaticAnalysis() {
- Project project = mock(Project.class);
- when(project.getAnalysisType()).thenReturn(Project.AnalysisType.STATIC);
- FakeCoverageSensor sensor = new FakeCoverageSensor();
-
- assertThat(sensor.shouldExecuteOnProject(project), is(false));
- }
-
- protected static class FakeCoverageSensor extends AbstractCoverageExtension {
-
- }
-}
import org.apache.commons.configuration.BaseConfiguration;
import org.slf4j.LoggerFactory;
-import org.sonar.api.Plugins;
import org.sonar.api.config.EmailSettings;
import org.sonar.api.platform.ComponentContainer;
import org.sonar.api.platform.Server;
import org.sonar.api.rules.AnnotationRuleParser;
import org.sonar.api.rules.XMLRuleParser;
import org.sonar.api.utils.HttpDownloader;
-import org.sonar.api.utils.IocContainer;
import org.sonar.api.utils.TimeProfiler;
import org.sonar.api.utils.UriReader;
import org.sonar.api.workflow.internal.DefaultWorkflow;
private void startDatabaseConnectors(ServletContext servletContext) {
rootContainer = new ComponentContainer();
rootContainer.addSingleton(servletContext);
- rootContainer.addSingleton(IocContainer.class); // for backward compatibility
rootContainer.addSingleton(new BaseConfiguration());
rootContainer.addSingleton(ServerSettings.class);
rootContainer.addSingleton(ServerImpl.class);
servicesContainer.addSingleton(ServerIdGenerator.class);
servicesContainer.addSingleton(DefaultModelFinder.class); // depends on plugins
servicesContainer.addSingleton(DefaultModelManager.class);
- servicesContainer.addSingleton(Plugins.class);
servicesContainer.addSingleton(ChartFactory.class);
servicesContainer.addSingleton(Languages.class);
servicesContainer.addSingleton(Views.class);
return disabledPlugins.contains(pluginKey);
}
- public Collection<Plugin> getPlugins() {
- return pluginsByKey.values();
- }
-
public Plugin getPlugin(String key) {
return pluginsByKey.get(key);
}
return clazz;
}
-
- public Property[] getProperties(Plugin plugin) {
- if (plugin != null) {
- Class<? extends Plugin> classInstance = plugin.getClass();
- if (classInstance.isAnnotationPresent(Properties.class)) {
- return classInstance.getAnnotation(Properties.class).value();
- }
- }
- return new Property[0];
- }
-
- public Collection<PluginMetadata> getMetadata() {
+public Collection<PluginMetadata> getMetadata() {
return deployer.getMetadata();
}
</tr>
</thead>
<tbody>
- <tr>
- <td>System is up to date</td>
+ <tr class="even">
+ <td>System is up to date.</td>
</tr>
</tbody>
</table>
repository = new DefaultServerPluginRepository(deployer);
repository.start();
- assertThat(repository.getPlugins().size(), Is.is(1));
assertThat(repository.getPlugin("artifactsize"), not(nullValue()));
assertThat(repository.getClassLoader("artifactsize"), not(nullValue()));
assertThat(repository.getClass("artifactsize", "org.sonar.plugins.artifactsize.ArtifactSizeMetrics"), not(nullValue()));