Skip to content

Commit

Permalink
add test for finding *.war (#79) (#81)
Browse files Browse the repository at this point in the history
* make run-java.sh find both (single) *.jar _or_ *.war (fixes #79)

* fix broken test

* add test for finding *.war (#79)
  • Loading branch information
vorburger authored and rhuss committed Feb 8, 2019
1 parent 0c86701 commit 95a6618
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/t/01_basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@ load test_helper
assert_status 0
}

@test "Exact one WAR found (with arg)" {
d=$(mktmpdir "1war")
cp "$TEST_JAR_DIR/test.jar" "$d/test.war"
JAVA_APP_DIR=$d run $TEST_SHELL $RUN_JAVA run --user roland
echo $status
echo $output

assert_jvmarg "-XX:\+UseParallelGC"
assert_jvmarg "-XX:GCTimeRatio=4"
assert_jvmarg "-XX:AdaptiveSizePolicyWeight=90"
assert_jvmarg "-XX:\+ExitOnOutOfMemoryError"
assert_jvmarg "-XX:MinHeapFreeRatio=20"
assert_jvmarg "-XX:MaxHeapFreeRatio=40"

assert_command_contains "-cp ."
assert_command_contains "-jar $d/test.war"
assert_command_contains_not "TestMain"

assert_arg "--user"
assert_arg "roland"

assert_status 0
}

@test "Exact one JAR found but without JAVA_MAIN_CLASS and manifest entry" {
d=$(mktmpdir "1jar-without-manifest")
cp "$TEST_JAR_DIR/test-without-manifest-entry.jar" "$d/test.jar"
Expand Down

0 comments on commit 95a6618

Please sign in to comment.