2018-08-26 13:11:36 +00:00
|
|
|
|
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpLinterTest('java', 'javalsp')
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
|
|
|
Execute(The javalsp callback should return the correct default value):
|
2019-06-09 05:02:50 +00:00
|
|
|
AssertLinter '', ale#Escape('')
|
2018-08-26 13:11:36 +00:00
|
|
|
|
2018-12-05 12:27:02 +00:00
|
|
|
Execute(The javalsp java executable should be configurable):
|
|
|
|
let b:ale_java_javalsp_executable = '/bin/foobar'
|
|
|
|
|
2019-06-04 15:31:56 +00:00
|
|
|
AssertLinter '/bin/foobar', ale#Escape('/bin/foobar')
|
|
|
|
|
|
|
|
Execute(The javalsp callback should return backward compatible value):
|
|
|
|
let b:ale_java_javalsp_executable = '/bin/java'
|
|
|
|
let cmd = [
|
|
|
|
\ ale#Escape('/bin/java'),
|
|
|
|
\ '--add-exports jdk.compiler/com.sun.tools.javac.api=javacs',
|
|
|
|
\ '--add-exports jdk.compiler/com.sun.tools.javac.code=javacs',
|
|
|
|
\ '--add-exports jdk.compiler/com.sun.tools.javac.comp=javacs',
|
|
|
|
\ '--add-exports jdk.compiler/com.sun.tools.javac.main=javacs',
|
|
|
|
\ '--add-exports jdk.compiler/com.sun.tools.javac.tree=javacs',
|
|
|
|
\ '--add-exports jdk.compiler/com.sun.tools.javac.model=javacs',
|
|
|
|
\ '--add-exports jdk.compiler/com.sun.tools.javac.util=javacs',
|
|
|
|
\ '--add-opens jdk.compiler/com.sun.tools.javac.api=javacs',
|
|
|
|
\ '-m javacs/org.javacs.Main',
|
|
|
|
\]
|
|
|
|
AssertLinter '/bin/java', join(cmd, ' ')
|
|
|
|
|
2019-06-19 02:38:23 +00:00
|
|
|
Execute(The javalsp should have default config):
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'java': {
|
|
|
|
\ 'classPath': [],
|
|
|
|
\ 'externalDependencies': []
|
|
|
|
\ }
|
|
|
|
\ },
|
|
|
|
\ ale_linters#java#javalsp#Config(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The javalsp should have default config if user sets empty hash):
|
|
|
|
let b:ale_java_javalsp_config = {}
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'java': {
|
|
|
|
\ 'classPath': [],
|
|
|
|
\ 'externalDependencies': []
|
|
|
|
\ }
|
|
|
|
\ },
|
|
|
|
\ ale_linters#java#javalsp#Config(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The javalsp should have add missing config):
|
|
|
|
let b:ale_java_javalsp_config = { 'java': { 'classPath': ['aaa.jar'] } }
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'java': {
|
|
|
|
\ 'classPath': ['aaa.jar'],
|
|
|
|
\ 'externalDependencies': []
|
|
|
|
\ }
|
|
|
|
\ },
|
|
|
|
\ ale_linters#java#javalsp#Config(bufnr(''))
|
|
|
|
|
|
|
|
let b:ale_java_javalsp_config =
|
|
|
|
\ {
|
|
|
|
\ 'java': {
|
|
|
|
\ 'externalDependencies': ['unit-test:2.0.0']
|
|
|
|
\ }
|
|
|
|
\ }
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'java': {
|
|
|
|
\ 'classPath': [],
|
|
|
|
\ 'externalDependencies': ['unit-test:2.0.0']
|
|
|
|
\ }
|
|
|
|
\ },
|
|
|
|
\ ale_linters#java#javalsp#Config(bufnr(''))
|