Skip to content

Commit

Permalink
Remove old class path entries. Allow a single test to be executed.
Browse files Browse the repository at this point in the history
Signed-off-by: James R. Perkins <[email protected]>
  • Loading branch information
jamezp committed Oct 24, 2023
1 parent 7b42c57 commit 87b48b1
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 13 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/jakarta-xml-binding-tck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This is a basic workflow that is manually triggered

name: Jakarta XML Binding TCK with WildFly

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- '**'
paths:
- 'jakarta-xml-binding/**'
#schedule:
# - cron: '0 0 * * *' # Every day at 00:00 UTC
workflow_dispatch:

# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
jakarta-xml-binding-tck:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: ['11']

# Runner steps
steps:
- name: Download the WildFly Nightly and setup the JBOSS_HOME
run: |
wget https://ci.wildfly.org/guestAuth/repository/download/WF_Nightly/latest.lastSuccessful/wildfly-latest-SNAPSHOT.zip -O wildfly-latest-SNAPSHOT.zip
unzip wildfly-latest-SNAPSHOT.zip
rm -rfv wildfly*-src.zip wildfly-latest-SNAPSHOT.zip
unzip wildfly-*.zip
rm -rfv wildfly-*.zip
JBOSS_HOME="$(readlink -m wildfly-*)"
echo -e "JBOSS_HOME=$JBOSS_HOME" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven Java ${{ matrix.java }} on WildFly
run: |
echo "JBOSS_HOME=$JBOSS_HOME"
cd jakarta-xml-binding
JBOSS_HOME="$JBOSS_HOME" WORK_DIR="./work" ./bin/run-tck.sh -v
if: failure()
with:
name: test-reports-${{ matrix.java }}
path: |
'**/reports/'
'**/logs/'
12 changes: 12 additions & 0 deletions jakarta-xml-binding/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,15 @@ pass the version of Java you want to use. The following are a list of the curren
----
javaenv 17
----

=== Running a Single Test

You can run a single test by passing the `-t` parameter. This can be a specific test like
`xml_schema/msData/datatypes/Facets/Schemas/jaxb/IDREFS_length006_395.html\#IDREFS_length006_395`, group of tests
like `xml_schema/msData/datatypes/Facets/Schemas/jaxb/IDREFS_length006_395.html` or a directory of tests like
`xml_schema/msData/datatypes/Facets/Schemas/jaxb/`.

.Example
----
JBOSS_HOME="${HOME}/wildfly-28.0.0.Beta1-SNAPSHOT" ./bin/run-tck.sh -t xml_schema/msData/datatypes/Facets/Schemas/jaxb/IDREFS_length006_395.html\#IDREFS_length006_395
----
38 changes: 25 additions & 13 deletions jakarta-xml-binding/bin/run-tck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ verbose=false
setupOnly=false

# Functions
printArgHelp() {
echo -e "${1}\t${2}"
}

printHelp() {
echo "Starts a container to execute the Jakarta XML Binding 4.0 TCK."
echo "Usage: JBOSS_HOME=/path/to/container ${0##*/}"
printArgHelp "-s" "Does the setup only and exits."
printArgHelp "-t" "Execute a single test. Example; xml_schema/msData/datatypes/Facets/Schemas/jaxb/IDREFS_length006_395.html\#IDREFS_length006_395"
printArgHelp "-v" "Prints verbose messages."
}

fail() {
echo "${1}"
Expand Down Expand Up @@ -37,12 +48,19 @@ logDebug() {
fi
}

TEST_INFO="jck.tests.needTests=No
jck.tests.tests="

# Parse incoming parameters
while getopts ":sv" opt; do
while getopts ":st:v" opt; do
case "${opt}" in
s)
setupOnly=true
;;
t)
TEST_INFO="jck.tests.needTests=Yes
jck.tests.tests=${OPTARG}"
;;
v)
verbose=true
;;
Expand Down Expand Up @@ -108,12 +126,9 @@ BASE_MODULE_DIR="${JBOSS_HOME}/modules/system/layers/base"
# JAXB API
TCK_CLASS_PATH=""
addToClassPath "${BASE_MODULE_DIR}/jakarta/xml/bind/api/main/"
# Legacy implementation module
addToClassPath "${BASE_MODULE_DIR}/com/sun/xml/bind/main/"
# New implementation module
addToClassPath "${BASE_MODULE_DIR}/org/glassfish/jaxb/main/"
addToClassPath "${BASE_MODULE_DIR}/org/apache/xerces/main/"
addToClassPath "${BASE_MODULE_DIR}/jakarta/activation/api/main"
addToClassPath "${BASE_MODULE_DIR}/org/eclipse/angus/activation/main"
# Required for the com.sun.tools.jxc.SchemaGenerator. The options look for -cp or -classpath passed to the entry point.
# However, the TCK runner does not pass that argument so it falls back to the CLASSPATH environment variable.
CLASSPATH="${TCK_CLASS_PATH}"
Expand All @@ -132,9 +147,6 @@ killAgent

# Prepares configuration file
echo "
INTERVIEW=com.sun.jaxb_tck.interview.JAXBTCKParameters
LOCALE=cs_CZ
QUESTION=jck.epilog
TESTSUITE=${TCK_HOME}
WORKDIR=${TCK_HOME}/work_directory
jck.concurrency.concurrency=3
Expand All @@ -148,7 +160,7 @@ jck.env.jaxb.schemagen.run.schemagenWrapperClass=com.sun.jaxb_tck.lib.SchemaGen
jck.env.jaxb.schemagen.skipJ2XOptional=Yes
jck.env.jaxb.testExecute.cmdAsFile=${JAVA_HOME}/bin/java
jck.env.jaxb.testExecute.otherEnvVars=JBOSS_HOME\=${JBOSS_HOME} JAXB_HOME\=${TCK_HOME}/client JAVA_HOME\=${JAVA_HOME}
jck.env.jaxb.testExecute.otherOpts=-Xmx512m -Xms256m ${CLASSPATH}
jck.env.jaxb.testExecute.otherOpts=-Xmx512m -Xms256m
jck.env.jaxb.xsd_compiler.defaultOperationMode=Yes
jck.env.jaxb.xsd_compiler.run.compilerWrapperClass=com.sun.jaxb_tck.lib.SchemaCompiler
jck.env.jaxb.xsd_compiler.skipValidationOptional=Yes
Expand All @@ -160,14 +172,14 @@ jck.excludeList.latestAutoCheck=No
jck.excludeList.latestAutoCheckInterval=7
jck.excludeList.latestAutoCheckMode=everyXDays
jck.excludeList.needExcludeList=Yes
jck.keywords.keywords.mode=expr
jck.keywords.needKeywords=No
jck.priorStatus.needStatus=No
jck.priorStatus.status=
jck.tests.needTests=No
jck.tests.tests=
${TEST_INFO}
jck.tests.treeOrFile=tree
jck.timeout.timeout=2
jck.env.jaxb.schemagen.run.jxcCmd=/bin/sh ${TCK_HOME}/linux/bin/schemagen.sh
jck.env.jaxb.xsd_compiler.testCompile.xjcCmd=/bin/sh ${TCK_HOME}/linux/bin/xjc.sh
" > "${TCK_HOME}"/default_configuration.jti

Expand All @@ -186,7 +198,7 @@ cd ${TCK_HOME}/tests/api/signaturetest
# Starts agent
echo "Starting Agent ...."
java -server -Xmx1024m -Xms128m \
-classpath "${TCK_HOME}/lib/javatest.jar:${TCK_HOME}/lib/jtlegacy.jar:${TCK_HOME}/classes:${CLASSPATH}" \
-classpath "${TCK_HOME}/lib/javatest.jar:${TCK_HOME}/classes:${CLASSPATH}" \
-Djava.security.policy="${TCK_HOME}"/lib/tck.policy \
com.sun.javatest.agent.AgentMain \
-passive 1>"${TCK_LOG_DIR}/agent.log" 2>"${TCK_LOG_DIR}/agent-err.log" &
Expand Down

0 comments on commit 87b48b1

Please sign in to comment.