use of org.sonarsource.sonarlint.core.TestClientInputFile in project sonarlint-core by SonarSource.
the class InputFileBuilderTest method testCreateWithLanguageSet.
@Test
public void testCreateWithLanguageSet() throws IOException {
Path path = temp.getRoot().toPath().resolve("file");
Files.write(path, "test".getBytes(StandardCharsets.ISO_8859_1));
ClientInputFile file = new TestClientInputFile(path, "file", true, StandardCharsets.ISO_8859_1, "cpp");
InputFileBuilder builder = new InputFileBuilder(langDetection, metadata);
SonarLintInputFile inputFile = builder.create(file);
assertThat(inputFile.language()).isEqualTo("cpp");
verifyZeroInteractions(langDetection);
}
use of org.sonarsource.sonarlint.core.TestClientInputFile in project sonarlint-core by SonarSource.
the class SonarLintInputFileTest method setUp.
@Before
public void setUp() throws IOException {
path = temp.newFile().toPath();
Files.write(path, "test string".getBytes(StandardCharsets.UTF_8));
inputFile = new TestClientInputFile(path, "file", false, StandardCharsets.UTF_8);
file = new SonarLintInputFile(inputFile);
}
Aggregations