David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 1 | #!/bin/bash -x |
| 2 | # |
| 3 | # Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. |
| 4 | # This program and the accompanying materials are made available under the |
| 5 | # terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 |
| 6 | # which accompanies this distribution. |
| 7 | # The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| 8 | # and the Eclipse Distribution License is available at |
| 9 | # http://www.eclipse.org/org/documents/edl-v10.php. |
| 10 | # |
| 11 | |
Andrew Guibert | 3260ca3 | 2019-09-03 12:12:33 -0500 | [diff] [blame] | 12 | mvn clean install -DskipTests |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 13 | |
| 14 | GF_BUNDLE_URL="central.maven.org/maven2/org/glassfish/main/distributions/glassfish/5.1.0/glassfish-5.1.0.zip" |
| 15 | TCK_NAME=jsonb-tck |
Andrew Guibert | 3260ca3 | 2019-09-03 12:12:33 -0500 | [diff] [blame] | 16 | TCK_VERSION=1.0.0 |
| 17 | |
| 18 | export TCK_HOME=`pwd`"/target-tck" |
Andrew Guibert | c204eae | 2019-09-03 12:15:24 -0500 | [diff] [blame] | 19 | rm -r ${TCK_HOME} |
| 20 | mkdir ${TCK_HOME} |
| 21 | cd ${TCK_HOME} |
| 22 | TS_HOME=${TCK_HOME}/${TCK_NAME} |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 23 | |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 24 | echo "Downloading JSON-B TCK tests" |
Andrew Guibert | c204eae | 2019-09-03 12:15:24 -0500 | [diff] [blame] | 25 | wget -q http://download.eclipse.org/ee4j/jakartaee-tck/jakartaee8-eftl/promoted/eclipse-${TCK_NAME}-$TCK_VERSION.zip |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 26 | echo "Exporting downloaded TCK tests" |
Andrew Guibert | c204eae | 2019-09-03 12:15:24 -0500 | [diff] [blame] | 27 | unzip -qq eclipse-${TCK_NAME}-*.zip -d ${TCK_HOME} |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 28 | |
| 29 | echo "Downloading GlassFish" |
Andrew Guibert | c204eae | 2019-09-03 12:15:24 -0500 | [diff] [blame] | 30 | wget -q --no-cache ${GF_BUNDLE_URL} -O latest-glassfish.zip |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 31 | echo "Exporting downloaded GlassFish" |
| 32 | unzip -qq ${TCK_HOME}/latest-glassfish.zip -d ${TCK_HOME} |
| 33 | |
| 34 | cp -a ${TCK_HOME}/target/yasson.jar ${TCK_HOME}/glassfish5/glassfish/modules/yasson.jar |
| 35 | |
Andrew Guibert | c204eae | 2019-09-03 12:15:24 -0500 | [diff] [blame] | 36 | cd ${TS_HOME}/bin |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 37 | |
Andrew Guibert | c204eae | 2019-09-03 12:15:24 -0500 | [diff] [blame] | 38 | # Intentionally no space between "-i" and ".bak" for interop with both MacOS and Linux |
| 39 | sed -i.bak "s#^report.dir=.*#report.dir=${TS_HOME}report/${TCK_NAME}#g" ts.jte |
| 40 | sed -i.bak "s#^work.dir=.*#work.dir=${TS_HOME}work/${TCK_NAME}#g" ts.jte |
| 41 | sed -i.bak "s#jsonb\.classes=.*#jsonb.classes=${TCK_HOME}/glassfish5/glassfish/modules/jakarta.json.jar:${TCK_HOME}/glassfish5/glassfish/modules/jakarta.json.bind-api.jar:${TCK_HOME}/glassfish5/glassfish/modules/jakarta.json.jar:${TCK_HOME}/glassfish5/glassfish/modules/jakarta.inject.jar:${TCK_HOME}/glassfish5/glassfish/modules/jakarta.servlet-api.jar:${TCK_HOME}/glassfish5/glassfish/modules/yasson.jar#" ts.jte |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 42 | |
| 43 | # TCK test excludes |
| 44 | # JDK 11 have date formating changed |
| 45 | echo "com/sun/ts/tests/jsonb/api/annotation/AnnotationTest.java#testJsonbDateFormat_from_standalone" >> ts.jtx |
| 46 | # Support for big numbers moved to Json-p |
| 47 | # https://github.com/eclipse-ee4j/jsonb-api/issues/180 |
| 48 | echo "com/sun/ts/tests/jsonb/defaultmapping/basictypes/BasicJavaTypesMappingTest.java#testLongMapping_from_standalone" >> ts.jtx |
| 49 | echo "com/sun/ts/tests/jsonb/defaultmapping/bignumbers/BigNumbersMappingTest.java#testBigNumberMarshalling_from_standalone" >> ts.jtx |
| 50 | # There is incorrect negative test on deserialization of EnumMap and EnumSet. Both of them are not defined by the spec so their |
| 51 | # support is up to the implementation. There should be no negative test present. |
| 52 | # EnumMap https://github.com/eclipse-ee4j/yasson/issues/283 |
| 53 | # EnumSet https://github.com/eclipse-ee4j/yasson/issues/272 |
| 54 | echo "com/sun/ts/tests/jsonb/defaultmapping/collections/CollectionsMappingTest.java#testEnumMap_from_standalone" >> ts.jtx |
| 55 | echo "com/sun/ts/tests/jsonb/defaultmapping/collections/CollectionsMappingTest.java#testEnumSet_from_standalone" >> ts.jtx |
| 56 | # Signature test needs to run on JDK 1.8 . This allowes us to run on any JDK. |
| 57 | echo "com/sun/ts/tests/signaturetest/jsonb/JSONBSigTest.java#signatureTest_from_standalone" >> ts.jtx |
| 58 | |
| 59 | mkdir -p ${TS_HOME}report/${TCK_NAME} |
| 60 | mkdir -p ${TS_HOME}work/${TCK_NAME} |
| 61 | |
| 62 | # ant config.vi |
Andrew Guibert | c204eae | 2019-09-03 12:15:24 -0500 | [diff] [blame] | 63 | cd ${TS_HOME}/src/com/sun/ts/tests/ |
David Kral | 5731604 | 2019-09-03 11:22:43 +0200 | [diff] [blame] | 64 | #ant deploy.all |
| 65 | ant run.all | tee ${TCK_HOME}/result.log |
| 66 | export FAILED_COUNT=`grep -c "Finished Test: FAILED" ${TCK_HOME}/result.log` |
| 67 | |
| 68 | if [ "${FAILED_COUNT}" -gt "0" ] |
| 69 | then |
| 70 | echo "FAILED TCK TESTS FOUND" |
| 71 | exit 1 |
| 72 | else |
| 73 | echo "TCK OK" |
| 74 | exit 0 |
| 75 | fi |