diff --git a/thirdparty_containers/derby/build.xml b/thirdparty_containers/derby/build.xml new file mode 100644 index 0000000000..93e29b7247 --- /dev/null +++ b/thirdparty_containers/derby/build.xml @@ -0,0 +1,39 @@ + + + + + Build derby-test docker image + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty_containers/derby/dockerfile/Dockerfile b/thirdparty_containers/derby/dockerfile/Dockerfile new file mode 100644 index 0000000000..e6fd6be3ce --- /dev/null +++ b/thirdparty_containers/derby/dockerfile/Dockerfile @@ -0,0 +1,60 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This Dockerfile in thirdparty_containers/derby/dockerfile dir is used to create an image with +# AdoptOpenJDK jdk binary installed. Basic test dependent executions +# are installed during the building process. +# +# Build example: `docker build -t adoptopenjdk-derby-test .` +# +# This Dockerfile builds image based on adoptopenjdk/openjdk8:latest. +# If you want to build image based on other images, please use +# `--build-arg list` to specify your base image +# +# Build example: `docker build --build-arg IMAGE_NAME= --build-arg IMAGE_VERSION=-t adoptopenjdk-derby-test .` + +ARG SDK=openjdk8 +ARG IMAGE_NAME=adoptopenjdk/$SDK +ARG IMAGE_VERSION=latest + +FROM $IMAGE_NAME:$IMAGE_VERSION + +# Install test dependent executable files +RUN apt-get update \ + && apt-get -y install \ + ant \ + apt-transport-https \ + ca-certificates \ + dirmngr \ + curl \ + git \ + make \ + unzip \ + vim \ + wget + +VOLUME ["/java"] +ENV JAVA_HOME=/java \ + PATH=/java/bin:$PATH \ + JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" + +WORKDIR / +ENV DERBY_HOME ${WORKDIR}/derby + +# This is the main script to run derby tests. +COPY ./dockerfile/derby-test.sh /derby-test.sh + +# Clone Derby source. +RUN git clone https://github.com/apache/derby.git + +ENTRYPOINT ["/bin/bash", "/example-test.sh"] +CMD ["--version"] diff --git a/thirdparty_containers/derby/dockerfile/derby-test.sh b/thirdparty_containers/derby/dockerfile/derby-test.sh new file mode 100644 index 0000000000..4d4027c700 --- /dev/null +++ b/thirdparty_containers/derby/dockerfile/derby-test.sh @@ -0,0 +1,72 @@ +#/bin/bash +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +#Set up Java to be used by the the derby-test + +if [ -d /java/jre/bin ];then + echo "Using mounted Java8" + export JAVA_BIN=/java/jre/bin + export JAVA_HOME=/java + export PATH=$JAVA_BIN:$PATH + java -version +elif [ -d /java/bin ]; then + echo "Using mounted Java9" + export JAVA_BIN=/java/bin + export JAVA_HOME=/java + export PATH=$JAVA_BIN:$PATH + java -version +else + echo "Using docker image default Java" + java_path=$(type -p java) + suffix="/java" + java_root=${java_path%$suffix} + export JAVA_BIN="$java_root" + echo "JAVA_BIN is: $JAVA_BIN" + $JAVA_BIN/java -version +fi + +TEST_SUITE=$1 + +echo "PATH is : $PATH" +echo "JAVA_HOME is : $JAVA_HOME" +echo "type -p java is :" +type -p java +echo "java -version is: \n" +java -version + +cd ${DERBY_HOME} +ls . +pwd + +#clean previous build artifacts +ant -f ${DERBY_HOME}/build.xml clobber + +#build all +ant -f ${DERBY_HOME}/build.xml all + +#create jars +ant -f ${DERBY_HOME}/build.xml buildjars + +export jardir ${DERBY_HOME}/jars/sane +export tstjardir ${DERBY_HOME}/tools/java +export CLASSPATH "${jardir}/derbyrun.jar:${jardir}/derbyTesting.jar:${tstjardir}/junit.jar" + +java -jar ${DERBY_HOME}/jars/sane/derbyrun.jar sysinfo + +#Run all tests +ant -Dderby.tests.basePort=1690 -Dderby.system.durability=test -DderbyTesting.oldReleasePath=${DERBY_HOME}/jars junit-all + +#Run only derbylang suite +#java -Dverbose=true -cp ${jardir}/derbyrun.jar:${jardir}/derbyTesting.jar:$tstjardir/junit.jar org.apache.derbyTesting.functionTests.harness.RunSuite #derbylang + diff --git a/thirdparty_containers/derby/playlist.xml b/thirdparty_containers/derby/playlist.xml new file mode 100644 index 0000000000..98625450e4 --- /dev/null +++ b/thirdparty_containers/derby/playlist.xml @@ -0,0 +1,31 @@ + + + + + derby_test_junit_all + docker run --rm -v $(JDK_HOME):/java adoptopenjdk-derby-test:latest ; \ + $(TEST_STATUS) + + SE80 + SE90 + + + extended + + + external + + +