Java Code Examples for org.sonar.api.internal.SonarRuntimeImpl#forSonarQube()

The following examples show how to use org.sonar.api.internal.SonarRuntimeImpl#forSonarQube() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClojurePluginTest.java    From sonar-clojure with MIT License 5 votes vote down vote up
@Before
public void setUp() {
    SonarRuntime runtime = SonarRuntimeImpl
            .forSonarQube(Version.create(7, 9, 3), SonarQubeSide.SERVER, SonarEdition.COMMUNITY);
    context = new Plugin.Context(runtime);
    new ClojurePlugin().define(context);
}
 
Example 2
Source File: ColdfusionPluginTest.java    From sonar-coldfusion with Apache License 2.0 5 votes vote down vote up
@Test
public void testExtensions() {
    ColdFusionPlugin plugin = new ColdFusionPlugin();
    SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(VERSION_7_6, SonarQubeSide.SERVER);
    Plugin.Context context = new Plugin.Context(runtime);
    plugin.define(context);

    Assert.assertEquals(5, context.getExtensions().size());
}
 
Example 3
Source File: FlowPluginTest.java    From sonar-flow-plugin with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Test
public void debug() {
  SonarRuntime runtime = 
      SonarRuntimeImpl.forSonarQube(Version.create(5, 6), SonarQubeSide.SCANNER);
  Plugin.Context context = new Plugin.Context(runtime);
  new FlowPlugin().define(context);
  logger.debug("Nr of extentions: " + context.getExtensions().size());
  assertTrue(context.getExtensions().size() == 13);
}
 
Example 4
Source File: AemRulesSonarPluginTest.java    From AEM-Rules-for-SonarQube with Apache License 2.0 5 votes vote down vote up
@Test
public void webPluginTester() {
    Plugin.Context context = new Plugin.Context(SonarRuntimeImpl.forSonarQube(Version.create(6, 7), SonarQubeSide.SERVER, SonarEdition.COMMUNITY));

    new AemRulesSonarPlugin().define(context);
    assertThat(context.getExtensions()).hasSize(7);
}
 
Example 5
Source File: CloverPluginTest.java    From sonar-clover with Apache License 2.0 5 votes vote down vote up
@Test
public void test_define() {
  final Plugin.Context context = new Plugin.Context(SonarRuntimeImpl.forSonarQube(
          Version.parse("6.7.4"),
          SonarQubeSide.SCANNER));
  new CloverPlugin().define(context);
  assertThat(context.getExtensions()).hasSize(1);
}
 
Example 6
Source File: AbstractAnsibleExtrasPluginTest.java    From sonar-ansible with Apache License 2.0 4 votes vote down vote up
public void testExtensionCounts() {
    Plugin.Context context = new Plugin.Context(SonarRuntimeImpl.forSonarQube(Version.create(6, 2), SonarQubeSide.SERVER));
    new MyExtrasPlugin().define(context);
    assertEquals(2, context.getExtensions().size());
}
 
Example 7
Source File: AnsiblePluginTest.java    From sonar-ansible with Apache License 2.0 4 votes vote down vote up
public void testExtensionCounts() {
    Plugin.Context context = new Plugin.Context(SonarRuntimeImpl.forSonarQube(Version.create(6, 2), SonarQubeSide.SERVER));
    new AnsiblePlugin().define(context);
    assertEquals(4, context.getExtensions().size());
}
 
Example 8
Source File: AuthOidcPluginTest.java    From sonar-auth-oidc with Apache License 2.0 4 votes vote down vote up
MockContext() {
  super(SonarRuntimeImpl.forSonarQube(Version.create(7, 6), SonarQubeSide.SERVER));
}