From c3515f96f68525cf9dad67043cddf97a4fbf1708 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Sun, 3 Nov 2024 08:57:53 -0700 Subject: [PATCH] Java - Upgraded Java to JDK 20; added Initial support for light-weight test cases --- tests/run-test-suite.sh | 15 +++++++++++++++ tests/test-java.sh | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100755 tests/run-test-suite.sh create mode 100755 tests/test-java.sh diff --git a/tests/run-test-suite.sh b/tests/run-test-suite.sh new file mode 100755 index 0000000..67904b7 --- /dev/null +++ b/tests/run-test-suite.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 3 November 2024 +# Purpose : Post installation validation script + +PATH=.:$PATH + +ls test-*.sh | while read test_case; do + eval ${test_case} + if [[ $? -eq 0 ]]; then + printf "%20s %s\n" "${test_case}" "[PASSED]" + else + printf "%20s %s\n" "${test_case}" "[FAILED]" + fi +done diff --git a/tests/test-java.sh b/tests/test-java.sh new file mode 100755 index 0000000..76c3791 --- /dev/null +++ b/tests/test-java.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 3 November 2024 +# Purpose : Test Java installation + +# We need to redirect stderr to stdout otherwise grep will not match. +JAVA_OUT=$(java -version 2>&1 | grep 20.0.1) +exit $?