Tabnine Logo
PluginContextImpl$Builder.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.sonar.api.internal.PluginContextImpl$Builder
constructor

Best Java code snippets using org.sonar.api.internal.PluginContextImpl$Builder.<init> (Showing top 11 results out of 315)

origin: SonarSource/sonarqube

container.addExtension(pluginInfo, plugin);
Plugin.Context context = new PluginContextImpl.Builder()
 .setSonarRuntime(sonarRuntime)
 .setBootConfiguration(container.getComponentByType(Configuration.class))
origin: SonarSource/sonarqube

 @Test
 public void test_context() {
  SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(VERSION_5_6, SonarQubeSide.SERVER);
  MapSettings settings = new MapSettings().setProperty("foo", "bar");
  Plugin.Context context = new PluginContextImpl.Builder()
   .setSonarRuntime(runtime)
   .setBootConfiguration(settings.asConfig())
   .build();

  assertThat(context.getSonarQubeVersion()).isEqualTo(VERSION_5_6);
  assertThat(context.getExtensions()).isEmpty();

  context.addExtension("foo");
  assertThat(context.getExtensions()).containsOnly("foo");

  context.addExtensions(Arrays.asList("bar", "baz"));
  assertThat(context.getExtensions()).containsOnly("foo", "bar", "baz");

  context.addExtensions("one", "two", "three", "four");
  assertThat(context.getExtensions()).containsOnly("foo", "bar", "baz", "one", "two", "three", "four");

  assertThat(context.getBootConfiguration().get("foo")).hasValue("bar");
 }
}
origin: SonarSource/sonarqube

@Test
public void provide_extensions_for_7_2() {
 SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.parse("7.2"), SonarQubeSide.SCANNER);
 Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build();
 new XooPlugin().define(context);
 assertThat(getExtensions(context))
  .hasSize(55)
  .contains(OneExternalIssuePerLineSensor.class);
}
origin: org.sonarsource.sonarqube/sonar-server

container.addExtension(pluginInfo, plugin);
Plugin.Context context = new PluginContextImpl.Builder()
 .setSonarRuntime(sonarRuntime)
 .setBootConfiguration(container.getComponentByType(Configuration.class))
origin: org.sonarsource.sonarqube/sonar-scanner-engine

public ExtensionInstaller install(ComponentContainer container, ExtensionMatcher matcher) {
 // core components
 for (Object o : BatchComponents.all(analysisMode)) {
  doInstall(container, matcher, null, o);
 }
 // plugin extensions
 for (PluginInfo pluginInfo : pluginRepository.getPluginInfos()) {
  Plugin plugin = pluginRepository.getPluginInstance(pluginInfo.getKey());
  Plugin.Context context = new PluginContextImpl.Builder()
   .setSonarRuntime(sonarRuntime)
   .setBootConfiguration(bootConfiguration)
   .build();
  plugin.define(context);
  for (Object extension : context.getExtensions()) {
   doInstall(container, matcher, pluginInfo, extension);
  }
 }
 List<ExtensionProvider> providers = container.getComponentsByType(ExtensionProvider.class);
 for (ExtensionProvider provider : providers) {
  Object object = provider.provide();
  if (object instanceof Iterable) {
   for (Object extension : (Iterable) object) {
    doInstall(container, matcher, null, extension);
   }
  } else {
   doInstall(container, matcher, null, object);
  }
 }
 return this;
}
origin: SonarSource/sonarlint-core

public ExtensionInstaller install(ComponentContainer container, boolean global) {
 // plugin extensions
 for (PluginInfo pluginInfo : pluginRepository.getPluginInfos()) {
  Plugin plugin = pluginRepository.getPluginInstance(pluginInfo.getKey());
  Plugin.Context context = new PluginContextImpl.Builder()
   .setSonarRuntime(sonarRuntime)
   .setBootConfiguration(bootConfiguration)
   .build();
  plugin.define(context);
  loadExtensions(container, pluginInfo, context, global);
 }
 return this;
}
origin: SonarSource/sonarqube

public ExtensionInstaller install(ComponentContainer container, ExtensionMatcher matcher) {
 // core components
 for (Object o : BatchComponents.all(analysisMode)) {
  doInstall(container, matcher, null, o);
 }
 // plugin extensions
 for (PluginInfo pluginInfo : pluginRepository.getPluginInfos()) {
  Plugin plugin = pluginRepository.getPluginInstance(pluginInfo.getKey());
  Plugin.Context context = new PluginContextImpl.Builder()
   .setSonarRuntime(sonarRuntime)
   .setBootConfiguration(bootConfiguration)
   .build();
  plugin.define(context);
  for (Object extension : context.getExtensions()) {
   doInstall(container, matcher, pluginInfo, extension);
  }
 }
 List<ExtensionProvider> providers = container.getComponentsByType(ExtensionProvider.class);
 for (ExtensionProvider provider : providers) {
  Object object = provider.provide();
  if (object instanceof Iterable) {
   for (Object extension : (Iterable) object) {
    doInstall(container, matcher, null, extension);
   }
  } else {
   doInstall(container, matcher, null, object);
  }
 }
 return this;
}
origin: SonarSource/sonarqube

@Test
public void provide_extensions_for_7_3() {
 SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.parse("7.3"), SonarQubeSide.SCANNER);
 Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build();
 new XooPlugin().define(context);
 assertThat(getExtensions(context))
  .hasSize(56)
  .contains(OneExternalIssuePerLineSensor.class);
}
origin: SonarSource/sonarqube

@Test
public void provide_extensions_for_6_6() {
 SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.parse("6.6"), SonarQubeSide.SCANNER);
 Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build();
 new XooPlugin().define(context);
 assertThat(getExtensions(context))
  .hasSize(51)
  .contains(XooBuiltInQualityProfilesDefinition.class);
}
origin: SonarSource/sonarqube

@Test
public void provide_extensions_for_5_6() {
 SonarRuntime runtime = SonarRuntimeImpl.forSonarLint(Version.parse("5.4"));
 Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build();
 new XooPlugin().define(context);
 assertThat(getExtensions(context))
  .hasSize(48)
  .doesNotContain(XooBuiltInQualityProfilesDefinition.class);
}
origin: SonarSource/sonarqube

@Test
public void provide_extensions_for_7_6() {
 SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.parse("7.6"), SonarQubeSide.SCANNER);
 Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build();
 new XooPlugin().define(context);
 assertThat(getExtensions(context))
  .hasSize(58)
  .contains(GlobalProjectSensor.class)
  .contains(XooIgnoreCommand.class);
}
org.sonar.api.internalPluginContextImpl$Builder<init>

Popular methods of PluginContextImpl$Builder

  • build
  • setSonarRuntime
    Required.
  • setBootConfiguration
    If not set, then an empty configuration is used.

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Menu (java.awt)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now