Skip to content

Commit 360253e

Browse files
committed
Test remote server option
1 parent 1192f48 commit 360253e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.travis.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ install:
2121
- pip install pycodestyle pylint rstcheck
2222

2323
script:
24+
# Only run on one machine since the script currently assumes a hard coded
25+
# port number.
26+
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then ./test_remote.bash; fi
27+
2428
- ./test.py
2529

2630
- ./run_doctest.py -v download_lt.py
2731
- if [ "$TRAVIS_PYTHON_VERSION" != "2.7" ]; then ./run_doctest.py -v README.rst; fi
2832

29-
- bash test.bash
33+
- ./test.bash
3034

3135
# Smoke test.
3236
- echo 'This is a sentence.' > foo.txt

test_remote.bash

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
readonly port=8081
6+
7+
# TODO: Find this more portably.
8+
readonly jar='./build/lib/language_check/LanguageTool-3.1/languagetool-server.jar'
9+
10+
java -cp "$jar" org.languagetool.server.HTTPServer --port "$port" &
11+
java_pid=$!
12+
13+
clean ()
14+
{
15+
kill "$java_pid"
16+
}
17+
trap clean EXIT
18+
19+
echo 'This is okay.' | \
20+
language-check --remote-host localhost --remote-port "$port" -
21+
22+
! echo 'This is noot okay.' | \
23+
language-check --remote-host localhost --remote-port "$port" -

0 commit comments

Comments
 (0)