Skip to content

Commit c4d9afc

Browse files
committed
using new JRE capabilities of adoptium aqa-tests
1 parent 3a15c95 commit c4d9afc

File tree

1 file changed

+5
-43
lines changed

1 file changed

+5
-43
lines changed

testHeadlessComponents.sh

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -42,45 +42,6 @@ else
4242
exit 1
4343
fi
4444

45-
function unwrap_file_to_location() {
46-
if [ "$OS" == "mac" -o "$OS" == "linux" ]; then
47-
tar --strip-components=1 -xf $1 -C $2
48-
elif [ "$OS" == "windows" ]; then
49-
unzip $1 -d $2
50-
# Get the name of the extracted folder (assuming only one folder is present)
51-
ls $2
52-
extracted_folder_name=$(ls $2)
53-
54-
# Ensure only one folder is found
55-
if [ "$(ls $2 | wc -l)" -eq 1 ]; then
56-
# Move the contents to the desired destination without creating a new directory
57-
mv "$2/$extracted_folder_name"/* "$2"
58-
else
59-
echo "Error: More than one directory found in $2."
60-
fi
61-
fi
62-
}
63-
64-
function installAlternativeJDK() {
65-
ARCH=$( uname -m )
66-
if [ "x$BOOTJDK_DIR" == "x" ]; then
67-
BOOTJDK_DIR=~/bootjdk
68-
fi
69-
if [ "x$BOOTJDK_ARCHIVE_DIR" == "x" ]; then
70-
BOOTJDK_ARCHIVE_DIR=$WORKSPACE/bootjdkarchive
71-
mkdir -p $BOOTJDK_ARCHIVE_DIR
72-
cd $BOOTJDK_ARCHIVE_DIR
73-
curl -OLJks "https://api.adoptopenjdk.net/v3/binary/latest/$OJDK_VERSION_NUMBER/ga/$OS/$ARCH/jdk/hotspot/normal/adoptopenjdk"
74-
rm -rf ${BOOTJDK_DIR}
75-
mkdir -p ${BOOTJDK_DIR}
76-
unwrap_file_to_location ${BOOTJDK_ARCHIVE_DIR}/* ${BOOTJDK_DIR}
77-
else
78-
rm -rf ${BOOTJDK_DIR}
79-
mkdir -p ${BOOTJDK_DIR}
80-
ls ${BOOTJDK_ARCHIVE_DIR}
81-
unwrap_file_to_location ${BOOTJDK_ARCHIVE_DIR}/*${ARCH}.tarxz ${BOOTJDK_DIR}
82-
fi
83-
}
8445

8546
function run_java_with_headless {
8647
COMPONENTS_TO_TEST=$2
@@ -174,20 +135,21 @@ LOGFILE=$TMPRESULTS/testHeadlessComponent.log
174135

175136
installAlternativeJDK
176137

138+
#JAVA_COMMAND always contains link to the java from the SDK
139+
177140
JAVAC_BINARY="${JAVA_COMMAND}c"
178141
if [ "$OS" == "mac1" ]; then
179142
JAVAC_BINARY="${BOOTJDK_DIR}/Contents/Home/bin/javac"
180143
fi
144+
145+
#JAVA_TO_TEST can contain either link to SDK or JRE java, however always the java that we want to test with
181146
JAVA=$JAVA_TO_TEST
182-
#use bootjdk javac
147+
183148
#other classes depend on this one, so we might as well just compile the main class
184149
cp -r $SCRIPT_DIR/testHeadlessComponents $WORKSPACE
185150
ls $WORKSPACE
186151
pushd $WORKSPACE/testHeadlessComponents/jreTestingSwingComponents/src
187152

188-
echo "JAVA=$JAVA"
189-
echo "javac=$JAVAC_BINARY"
190-
191153
cp=`mktemp -d`
192154
$JAVAC_BINARY `find . -type f -name "*.java"` -d $cp
193155

0 commit comments

Comments
 (0)