-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/test/java/org/github/otymko/phoenixbsl/lsp/BSLConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.github.otymko.phoenixbsl.lsp; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class BSLConfigurationTest { | ||
|
||
@Test | ||
public void test_OldConfiguration() { | ||
|
||
Path path = Path.of("src/test/resources/LSConfiguration/old.bsl-language-server.json"); | ||
var configuration = getConfigurationFromFile(path.toFile()); | ||
assertThat(configuration).isNotNull(); | ||
|
||
} | ||
|
||
@Test | ||
public void test_Configuration() { | ||
|
||
Path path = Path.of("src/test/resources/LSConfiguration/.bsl-language-server.json"); | ||
var configuration = getConfigurationFromFile(path.toFile()); | ||
assertThat(configuration).isNotNull(); | ||
assertThat(configuration.getLanguage()).isNotNull(); | ||
|
||
} | ||
|
||
private BSLConfiguration getConfigurationFromFile(File file) { | ||
BSLConfiguration configuration = null; | ||
ObjectMapper mapper = new ObjectMapper(); | ||
try { | ||
configuration = mapper.readValue(file, BSLConfiguration.class); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
return configuration; | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/test/resources/LSConfiguration/.bsl-language-server.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"language": "ru", | ||
"codeLens": { | ||
"showCognitiveComplexity": false, | ||
"showCyclomaticComplexity": false | ||
}, | ||
"diagnostics": { | ||
"computeTrigger": "onSave", | ||
"skipSupport": "never" | ||
}, | ||
"documentLink": { | ||
"useDevSite": false | ||
}, | ||
"traceLog": null, | ||
"configurationRoot": "src" | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/resources/LSConfiguration/old.bsl-language-server.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"diagnosticLanguage": "ru", | ||
"showCognitiveComplexityCodeLens": false, | ||
"showCyclomaticComplexityCodeLens": false, | ||
"computeDiagnosticsSkipSupport": "never", | ||
"traceLog": null, | ||
"configurationRoot": "src" | ||
} |