All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#assert#SetUpLinterTest('java', 'eclipselsp')
3 call ale#test#SetFilename('dummy.java')
5 let b:ale_java_eclipselsp_path = '/home/user/eclipse.dst.ls'
8 let b:cfg = ale#path#Simplify(g:dir . '/../config_win')
10 let b:cfg = ale#path#Simplify(g:dir . '/../config_mac')
12 let b:cfg = ale#path#Simplify(g:dir . '/../config_linux')
16 unlet! b:ale_java_eclipselsp_path
19 call ale#assert#TearDownLinterTest()
21 Execute(VersionCheck should return correct version):
24 AssertEqual [1, 8, 0], ale_linters#java#eclipselsp#VersionCheck([
25 \ 'openjdk version "1.8.0_191"',
26 \ 'OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.18.04.1-b12)',
27 \ 'OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)'
31 AssertEqual [10, 0, 2], ale_linters#java#eclipselsp#VersionCheck([
32 \ 'openjdk version "10.0.2" 2018-07-17',
33 \ 'OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)',
34 \ 'OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)'
38 AssertEqual [1, 8, 0], ale_linters#java#eclipselsp#VersionCheck([
39 \ 'java version "1.8.0_161"',
40 \ 'Java(TM) SE Runtime Environment (build 1.8.0_161-b12)',
41 \ 'Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)'
45 AssertEqual [10, 0, 1], ale_linters#java#eclipselsp#VersionCheck([
46 \ 'java version "10.0.1" 2018-04-17',
47 \ 'Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)',
48 \ 'Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)'
51 AssertEqual [], ale_linters#java#eclipselsp#VersionCheck(['x'])
53 AssertEqual [], ale_linters#java#eclipselsp#VersionCheck([])
55 Execute(The eclipselsp callback should return the correct default value):
56 let cmd = [ ale#Escape('java'),
58 \ '-Declipse.application=org.eclipse.jdt.ls.core.id1',
59 \ '-Dosgi.bundles.defaultStartLevel=4',
60 \ '-Declipse.product=org.eclipse.jdt.ls.core.product',
69 \ ale#Escape(ale#path#Simplify(''))
71 AssertLinter 'java', join(cmd, ' ')
73 Execute(The eclipselsp callback should allow custom executable):
74 let b:ale_java_eclipselsp_executable='/bin/foobar'
75 let cmd = [ ale#Escape('/bin/foobar'),
77 \ '-Declipse.application=org.eclipse.jdt.ls.core.id1',
78 \ '-Dosgi.bundles.defaultStartLevel=4',
79 \ '-Declipse.product=org.eclipse.jdt.ls.core.product',
88 \ ale#Escape(ale#path#Simplify(''))
90 AssertLinter '/bin/foobar', join(cmd, ' ')
92 Execute(The eclipselsp callback should allow custom configuration path and javaagent):
93 let b:ale_java_eclipselsp_config_path = '/home/config'
94 let b:ale_java_eclipselsp_javaagent = '/home/lombok.jar /home/lombok2.jar'
95 let cmd = [ ale#Escape('java'),
96 \ ale#Escape('-javaagent:/home/lombok.jar'),
97 \ ale#Escape('-javaagent:/home/lombok2.jar'),
98 \ '-Declipse.application=org.eclipse.jdt.ls.core.id1',
99 \ '-Dosgi.bundles.defaultStartLevel=4',
100 \ '-Declipse.product=org.eclipse.jdt.ls.core.product',
107 \ ale#Escape(ale#path#Simplify('/home/config')),
109 \ ale#Escape(ale#path#Simplify(''))
111 AssertLinter 'java', join(cmd, ' ')