public class PluginContextImpl extends Plugin.Context
Plugin.Context that plugins could use in their unit tests.
Example:
import org.sonar.api.internal.SonarRuntimeImpl;
import org.sonar.api.config.internal.MapSettings;
...
SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(7, 1), SonarQubeSide.SCANNER);
MapSettings settings = new MapSettings().setProperty("foo", "bar");
Plugin.Context context = new PluginContextImpl.Builder()
.setSonarRuntime(runtime)
.setBootConfiguration(settings.asConfig());
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
PluginContextImpl.Builder |
| Modifier and Type | Method and Description |
|---|---|
Configuration |
getBootConfiguration()
The configuration that contains only the few properties required to bootstrap the process, for example:
- conf/sonar.properties and persisted properties on web server and Compute Engine sides.
|
addExtension, addExtensions, addExtensions, getExtensions, getRuntime, getSonarQubeVersionpublic Configuration getBootConfiguration()
Plugin.ContextgetBootConfiguration in class Plugin.Context