Search in sources :

Example 16 with Languages

use of org.sonar.api.resources.Languages in project sonarqube by SonarSource.

the class LanguageDetectionTest method should_not_fail_if_no_language.

@Test
public void should_not_fail_if_no_language() throws Exception {
    LanguageDetection detection = spy(new LanguageDetection(new MapSettings(), new DefaultLanguagesRepository(new Languages())));
    assertThat(detection.language(newIndexedFile("Foo.java"))).isNull();
}
Also used : MapSettings(org.sonar.api.config.MapSettings) Languages(org.sonar.api.resources.Languages) DefaultLanguagesRepository(org.sonar.scanner.repository.language.DefaultLanguagesRepository) Test(org.junit.Test)

Aggregations

Languages (org.sonar.api.resources.Languages)16 Test (org.junit.Test)10 MapSettings (org.sonar.api.config.MapSettings)9 DefaultLanguagesRepository (org.sonar.scanner.repository.language.DefaultLanguagesRepository)9 LanguagesRepository (org.sonar.scanner.repository.language.LanguagesRepository)8 Settings (org.sonar.api.config.Settings)5 Before (org.junit.Before)4 WsTester (org.sonar.server.ws.WsTester)4 DbClient (org.sonar.db.DbClient)3 QProfileFactory (org.sonar.server.qualityprofile.QProfileFactory)3 I18n (org.sonar.api.i18n.I18n)2 WebService (org.sonar.api.server.ws.WebService)2 MessageException (org.sonar.api.utils.MessageException)2 ComponentFinder (org.sonar.server.component.ComponentFinder)2 QProfileExporters (org.sonar.server.qualityprofile.QProfileExporters)2 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 Writer (java.io.Writer)1 StandardCharsets (java.nio.charset.StandardCharsets)1