当前位置: 首页>>代码示例>>Java>>正文


Java SonarRuntimeImpl类代码示例

本文整理汇总了Java中org.sonar.api.internal.SonarRuntimeImpl的典型用法代码示例。如果您正苦于以下问题:Java SonarRuntimeImpl类的具体用法?Java SonarRuntimeImpl怎么用?Java SonarRuntimeImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SonarRuntimeImpl类属于org.sonar.api.internal包,在下文中一共展示了SonarRuntimeImpl类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Test
public void test() {
	final PackageAnalyzerPlugin subject = new PackageAnalyzerPlugin();
	final Plugin.Context context = new Plugin.Context(SonarRuntimeImpl.forSonarQube(Version.create(5, 6), SonarQubeSide.SERVER));

	Assert.assertEquals(0, context.getExtensions().size());
	subject.define(context);
	
	// Rules
	Assert.assertTrue(context.getExtensions().contains(AbstractnessRule.class));
	Assert.assertTrue(context.getExtensions().contains(AfferentCouplingRule.class));
	Assert.assertTrue(context.getExtensions().contains(EfferentCouplingRule.class));
	Assert.assertTrue(context.getExtensions().contains(InstabilityRule.class));
	Assert.assertTrue(context.getExtensions().contains(MissingPackageInfoRule.class));
	Assert.assertTrue(context.getExtensions().contains(NumberOfClassesAndInterfacesRule.class));
	Assert.assertTrue(context.getExtensions().contains(PackageDependencyCyclesRule.class));
	
	// Java
	Assert.assertTrue(context.getExtensions().contains(JavaRules.class));
	Assert.assertTrue(context.getExtensions().contains(JavaSensor.class));
	
}
 
开发者ID:willemsrb,项目名称:sonar-packageanalyzer-plugin,代码行数:23,代码来源:PackageAnalyzerPluginTest.java

示例2: doBeforeStart

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Override
protected void doBeforeStart() {
  Version version = ApiVersion.load(System2.INSTANCE);
  add(
    StandalonePluginIndex.class,
    PluginRepository.class,
    PluginCacheLoader.class,
    PluginLoader.class,
    PluginClassloaderFactory.class,
    DefaultPluginJarExploder.class,
    ExtensionInstaller.class,
    new SonarQubeVersion(version),
    SonarRuntimeImpl.forSonarQube(version, SonarQubeSide.SCANNER),

    new GlobalTempFolderProvider(),
    UriReader.class,
    new PluginCacheProvider(),
    System2.INSTANCE);
}
 
开发者ID:instalint-org,项目名称:instalint,代码行数:20,代码来源:StandaloneGlobalContainer.java

示例3: testExtensions

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Test
@SuppressWarnings("rawtypes")
public void testExtensions() {

	final SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(6, 7),
			SonarQubeSide.SCANNER);
	final Plugin.Context context = new Plugin.Context(runtime);
	new XanitizerSonarQubePlugin().define(context);

	final List extensions = context.getExtensions();
	assertNotNull(extensions);

	assertTrue(extensions.contains(XanitizerSensor.class));
	assertTrue(extensions.contains(XanitizerMetrics.class));
	assertTrue(extensions.contains(XanitizerRulesDefinition.class));
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:17,代码来源:PluginTest.java

示例4: test

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Test
public void test() {
	final IssueResolverPlugin subject = new IssueResolverPlugin();
	final Plugin.Context context = new Plugin.Context(SonarRuntimeImpl.forSonarQube(Version.create(5, 6), SonarQubeSide.SERVER));

	Assert.assertEquals(0, context.getExtensions().size());
	subject.define(context);
	Assert.assertEquals(5, context.getExtensions().size());
}
 
开发者ID:willemsrb,项目名称:sonar-issueresolver-plugin,代码行数:10,代码来源:IssueResolverPluginTest.java

示例5: test

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void test() {
    SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(5, 6), SonarQubeSide.SERVER);
    Plugin.Context context = new Plugin.Context(runtime);
    new PerlPlugin().define(context);
    assertThat(context.getExtensions()).hasSize(7);
}
 
开发者ID:sonar-perl,项目名称:sonar-perl,代码行数:9,代码来源:PerlPluginTest.java

示例6: getExtensions

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Test
public void getExtensions() {
  SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(5, 6), SonarQubeSide.SCANNER);
  Plugin.Context context = new Plugin.Context(runtime);
  new GitPlugin().define(context);
  assertThat(context.getExtensions()).hasSize(2);
}
 
开发者ID:SonarSource,项目名称:sonar-scm-git,代码行数:8,代码来源:GitPluginTest.java

示例7: getExtensions

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Test
public void getExtensions() {
  SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(5, 6), SonarQubeSide.SCANNER);
  Plugin.Context context = new Plugin.Context(runtime);
  new SvnPlugin().define(context);
  assertThat(context.getExtensions()).hasSize(7);
}
 
开发者ID:SonarSource,项目名称:sonar-scm-svn,代码行数:8,代码来源:SvnPluginTest.java

示例8: setRuntime

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
private void setRuntime(Version version) {
  context.setRuntime(SonarRuntimeImpl.forSonarQube(version, SonarQubeSide.SERVER));
}
 
开发者ID:SonarSource,项目名称:sonar-analyzer-commons,代码行数:4,代码来源:InputFileContentExtractorTest.java

示例9: count_extensions_for_sonarqube_server_6_0

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Test
public void count_extensions_for_sonarqube_server_6_0() throws Exception {
  Plugin.Context context = setupContext(SonarRuntimeImpl.forSonarQube(Version.create(6, 0), SonarQubeSide.SERVER));
  assertThat(context.getExtensions()).as("Number of extensions for SQ 6.0").hasSize(5);
}
 
开发者ID:SonarSource,项目名称:sonar-xml,代码行数:6,代码来源:XmlPluginTest.java

示例10: count_extensions_for_sonarqube_server_6_2

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Test
public void count_extensions_for_sonarqube_server_6_2() throws Exception {
  Plugin.Context context = setupContext(SonarRuntimeImpl.forSonarQube(Version.create(6, 2), SonarQubeSide.SERVER));
  assertThat(context.getExtensions()).as("Number of extensions for SQ 6.2").hasSize(5);
}
 
开发者ID:SonarSource,项目名称:sonar-xml,代码行数:6,代码来源:XmlPluginTest.java

示例11: testGetExtensions

import org.sonar.api.internal.SonarRuntimeImpl; //导入依赖的package包/类
@Test
public void testGetExtensions() {

    Plugin.Context context = new Plugin.Context(SonarRuntimeImpl.forSonarQube(Version.create(6, 2), SonarQubeSide.SERVER));
    new OneCPlugin().define(context);

    assertThat(context.getExtensions()).hasSize(4);

}
 
开发者ID:antowski,项目名称:sonar-onec,代码行数:10,代码来源:OneCPluginTest.java


注:本文中的org.sonar.api.internal.SonarRuntimeImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。