This commit is contained in:
eric sciple 2020-02-08 00:44:59 -05:00
parent 7eb67a6791
commit d7c0e236bb
2 changed files with 32 additions and 1 deletions

25
__tests__/verify-java.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh
if [ -z "$1" ]; then
echo "Must supply java version argument"
exit 1
fi
java_version="$(java -version)"
echo "Found java version: $node_version"
if [ -z "$(echo $node_version | grep --fixed-strings $1)" ]; then
echo "Unexpected version"
exit 1
fi
echo "Building sample proj"
proj_dir=__tests/sample-proj
mvn --file $proj_dir clean install dependency:copy-dependencies || exit 1
echo "Testing compiled app"
sample_output="$(java --class-path $proj_dir/target/HelloWorld-1.0-SNAPSHOT.jar:$proj_dir/target/dependency/json-20190722.jar com.helloworld.App)"
echo "Sample output: $sample_output"
if [ -z "$(echo $sample_output | grep --fixed-strings '{"Hello":"World!"}')" ]; then
echo "Unexpected output"
exit 1
fi