Search in sources :

Example 1 with DefaultPostJobDescriptor

use of org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor in project sonarqube by SonarSource.

the class XooPostJobTest method increaseCoverage.

@Test
public void increaseCoverage() {
    new XooPostJob().describe(new DefaultPostJobDescriptor());
    PostJobContext context = mock(PostJobContext.class);
    when(context.issues()).thenReturn(Arrays.<PostJobIssue>asList());
    when(context.resolvedIssues()).thenReturn(Arrays.<PostJobIssue>asList());
    new XooPostJob().execute(context);
    assertThat(logTester.logs()).contains("Resolved issues: 0", "Open issues: 0");
}
Also used : DefaultPostJobDescriptor(org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor) PostJobContext(org.sonar.api.batch.postjob.PostJobContext) Test(org.junit.Test)

Example 2 with DefaultPostJobDescriptor

use of org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor in project sonarqube by SonarSource.

the class PostJobOptimizerTest method should_run_analyzer_with_no_metadata.

@Test
public void should_run_analyzer_with_no_metadata() {
    DefaultPostJobDescriptor descriptor = new DefaultPostJobDescriptor();
    assertThat(optimizer.shouldExecute(descriptor)).isTrue();
}
Also used : DefaultPostJobDescriptor(org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor) Test(org.junit.Test)

Example 3 with DefaultPostJobDescriptor

use of org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor in project sonarqube by SonarSource.

the class PostJobOptimizerTest method should_optimize_on_settings.

@Test
public void should_optimize_on_settings() {
    DefaultPostJobDescriptor descriptor = new DefaultPostJobDescriptor().requireProperty("sonar.foo.reportPath");
    assertThat(optimizer.shouldExecute(descriptor)).isFalse();
    settings.setProperty("sonar.foo.reportPath", "foo");
    assertThat(optimizer.shouldExecute(descriptor)).isTrue();
}
Also used : DefaultPostJobDescriptor(org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 DefaultPostJobDescriptor (org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor)3 PostJobContext (org.sonar.api.batch.postjob.PostJobContext)1