Search in sources :

Example 1 with Perspective

use of org.sonar.api.component.Perspective in project sonarqube by SonarSource.

the class SymbolizableBuilderTest method project_should_not_be_highlightable.

@Test
public void project_should_not_be_highlightable() {
    SymbolizableBuilder builder = new SymbolizableBuilder(mock(DefaultSensorStorage.class), mock(AnalysisMode.class));
    Perspective perspective = builder.loadPerspective(Symbolizable.class, new DefaultInputModule("struts"));
    assertThat(perspective).isNull();
}
Also used : Perspective(org.sonar.api.component.Perspective) DefaultInputModule(org.sonar.api.batch.fs.internal.DefaultInputModule) DefaultSensorStorage(org.sonar.scanner.sensor.DefaultSensorStorage) AnalysisMode(org.sonar.api.batch.AnalysisMode) Test(org.junit.Test)

Example 2 with Perspective

use of org.sonar.api.component.Perspective in project sonarqube by SonarSource.

the class SymbolizableBuilderTest method should_load_perspective.

@Test
public void should_load_perspective() {
    SymbolizableBuilder perspectiveBuilder = new SymbolizableBuilder(mock(DefaultSensorStorage.class), mock(AnalysisMode.class));
    Perspective perspective = perspectiveBuilder.loadPerspective(Symbolizable.class, new TestInputFileBuilder("foo", "foo.c").build());
    assertThat(perspective).isInstanceOf(Symbolizable.class);
}
Also used : TestInputFileBuilder(org.sonar.api.batch.fs.internal.TestInputFileBuilder) Perspective(org.sonar.api.component.Perspective) DefaultSensorStorage(org.sonar.scanner.sensor.DefaultSensorStorage) AnalysisMode(org.sonar.api.batch.AnalysisMode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 AnalysisMode (org.sonar.api.batch.AnalysisMode)2 Perspective (org.sonar.api.component.Perspective)2 DefaultSensorStorage (org.sonar.scanner.sensor.DefaultSensorStorage)2 DefaultInputModule (org.sonar.api.batch.fs.internal.DefaultInputModule)1 TestInputFileBuilder (org.sonar.api.batch.fs.internal.TestInputFileBuilder)1