Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Malax committed Jul 3, 2024
1 parent 1298f19 commit 9cc7751
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
13 changes: 6 additions & 7 deletions test/compile_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@

assertCapturedSuccess() {
assertEquals 0 "${RETURN}"
if [ "$TRAVIS" = "true" ]; then
# Travis keeps injecting -Xmn option on JDK8 that causes a warning in STR_ERR
assertTrue true
else
assertEquals "" "$(cat ${STD_ERR})"
fi
}

setupJavaEnv() {
Expand Down Expand Up @@ -49,7 +43,7 @@ testCompile()

_assertMavenLatest
assertTrue "system.properties was not cached" "[ -f $CACHE_DIR/system.properties ]"
assertContains "system.properties contains the wrong version" "java.runtime.version=1.8" "$(cat $CACHE_DIR/system.properties)"
assertContains "system.properties contains the wrong version" "java.runtime.version=21" "$(cat $CACHE_DIR/system.properties)"
}

testCompilationFailure()
Expand Down Expand Up @@ -122,6 +116,11 @@ testCustomSettingsXmlWithUrl()
testCustomSettingsXmlWithInvalidUrl()
{
createPom
# Set OpenJDK version explicitly to avoid getting a warning on stderr which would
# trip assertCapturedError
cat > ${BUILD_DIR}/system.properties <<EOF
java.runtime.version=21
EOF

export MAVEN_SETTINGS_URL="https://example.com/ha7s8duysadfuhasjd/settings.xml"

Expand Down
6 changes: 2 additions & 4 deletions test/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ EOF

createSettingsXml()
{
[ "$TRAVIS" = "true" ] && rm -rf /home/travis/.m2/repository

if [ ! -z "${1:-}" ]; then
settings_file="$1"
else
Expand Down Expand Up @@ -119,6 +117,6 @@ _assertMavenLatest() {
assertFileMD5 "45ca660e83af83fa8213b55fb693326c" ${installDir}/.maven/bin/mvn
assertTrue "mvn should be executable" "[ -x ${installDir}/.maven/bin/mvn ]"

assertCaptured "Unexpected mvn command" "mvn -DskipTests clean dependency:list install"
assertCaptured "Build was not successful" "BUILD SUCCESS"
assertCaptured "mvn -DskipTests clean dependency:list install"
assertCaptured "BUILD SUCCESS"
}

0 comments on commit 9cc7751

Please sign in to comment.