本文整理汇总了Java中org.sonar.wsclient.issue.IssueClient类的典型用法代码示例。如果您正苦于以下问题:Java IssueClient类的具体用法?Java IssueClient怎么用?Java IssueClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IssueClient类属于org.sonar.wsclient.issue包,在下文中一共展示了IssueClient类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testCommentedOutCodeDetection
import org.sonar.wsclient.issue.IssueClient; //导入依赖的package包/类
/**
* SONARPLUGINS-1897
*/
@Test
public void testCommentedOutCodeDetection() {
String projectKey = "test";
orchestrator.getServer().provisionProject(projectKey, projectKey);
orchestrator.getServer().associateProjectToQualityProfile(projectKey, "web", "IT");
SonarScanner build = WebTestSuite.createSonarScanner()
.setProjectDir(new File("projects/continuum-webapp/"))
.setProjectKey(projectKey)
.setProjectName(projectKey)
.setProjectVersion("1.0")
.setSourceDirs("src")
.setProperty("sonar.sourceEncoding", "UTF-8")
.setProperty("sonar.web.fileExtensions", ".xhtml,.jspf,.jsp");
orchestrator.executeBuild(build);
IssueClient issueClient = orchestrator.getServer().wsClient().issueClient();
List<Issue> issues = issueClient.find(
IssueQuery.create()
.components(keyFor(projectKey, "WEB-INF/jsp/components/projectGroupNotifierSummaryComponent.jsp"))
.rules("Web:AvoidCommentedOutCodeCheck"))
.list();
assertThat(issues.size()).isEqualTo(2);
}
开发者ID:SonarSource,项目名称:sonar-web,代码行数:28,代码来源:VariousTest.java
示例2: test
import org.sonar.wsclient.issue.IssueClient; //导入依赖的package包/类
@Test
public void test() {
runSonar();
final IssueClient issueClient = orchestrator.getServer().wsClient().issueClient();
final List<Issue> issues = issueClient
.find(IssueQuery.create().componentRoots("nl.future-edge.sonarqube.plugins:sonar-jdepend-plugin-it"))
.list();
Assert.assertEquals(1, issues.size());
final Issue issue = issues.iterator().next();
Assert.assertEquals(
"nl.future-edge.sonarqube.plugins:sonar-jdepend-plugin-it:src/main/java/packagedependencycycle/packagea/package-info.java",
issue.componentKey());
}
开发者ID:willemsrb,项目名称:sonar-jdepend-plugin,代码行数:16,代码来源:PluginIT.java
示例3: getIssues
import org.sonar.wsclient.issue.IssueClient; //导入依赖的package包/类
private List<Issue> getIssues(ComponentConverter resources) {
if (sonarHostUrl != null) {
if (sonarHostUrl.endsWith( "/" )) {
sonarHostUrl = sonarHostUrl.substring( 0,
sonarHostUrl.length() - 1 );
}
}
HttpRequestFactory requestFactory = new HttpRequestFactory( sonarHostUrl )
.setLogin( username ).setPassword( password );
IssueClient client = new DefaultIssueClient( requestFactory );
List<Issue> issues = Lists.newArrayList();
getLog().debug( "sonarProjectId: " + sonarProjectId() );
for (String component : resources.getComponents()) {
Issues result;
try {
getLog().debug( "component: " + component );
result = client.find( IssueQuery.create()
.componentRoots( sonarProjectId() )
.components( component )
);
} catch (Exception e) {
getLog().error( "Unable to get issues for: " + component );
getLog().debug( e.getMessage(), e );
continue;
}
issues.addAll( result.list() );
}
return issues;
}
开发者ID:velo,项目名称:sonar-pull-request-integration,代码行数:33,代码来源:SonarPullRequestMojo.java
注:本文中的org.sonar.wsclient.issue.IssueClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论