This is an automated email from the ASF dual-hosted git repository. rzo1 pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/main by this push: new cf0011b98e TOMEE-4166 - Setup tck for JAX-RS (#1063) cf0011b98e is described below commit cf0011b98eb67bc973e6ff30e0a5d23117f26de5 Author: Benedict Eisenkrämer <142220551+sollde...@users.noreply.github.com> AuthorDate: Tue Apr 23 09:13:18 2024 +0200 TOMEE-4166 - Setup tck for JAX-RS (#1063) * Add tck-mode flag to tomee embedded * Rename tck-mode flag * Add jax-rs tck * Cleanup poms and move jar files * Switch to a dependency of the tck instead of including all the files themselves. For now this is just the staging dependency. * Revert import changes to Container.java and only include the tomee.embedded.tck.enable_tracing * Implement changes proposed by @rzo1 * Fix <snapshots> tag * Some minor changes regarding groupid and tomee version (to allow easy upgrades by mvn release plugin) * Align servlet_adaptor with openejb class from tomee-tck * No need to build a jar or attach sources * Disable fail-on-constrainedto * Fix JAXRSClientIT and JAXRSBasicClientIT Tests * add comments to arquillian.xml * Add a module that generates the signature-file for JAX-RS. * Add licence header * Remove jakarta.staging.repo as a custom repository, as the dependencies we need from there are now in maven central. * Fix Version of tcks * Upgrade Jax-RS Versions to 4.1.0-SNAPSHOT * Fix tcks after merge * Raise baseline to 17 (necessary for JAX-RS) * TOMEE-4318 | TOMEE-4317 - ActiveMQ 6 + Java 17 (#1120) * TOMEE-4317 - ActiveMQ 6.1.0 Drop related shades. * Switch Java Level to 17 * Migrate V11 to V17 class constant in jwt tests * Adds --add-opens for legacy code fragements with libraries not supporting J17+ * Bump maven-plugin-plugin version * Add ScriptEngine implementation for js on Java 15+ * Add ScriptEngine implementation for js in tomee-embedded-maven-plugin as well * Add ScriptEngine implementation for js on Java 15+ * Upgrade Mockito to make it work under J17+ env * Exclude bean validaiton tck tests from "org.hibernate.beanvalidation.tck.tests.constraints.groups.groupconversion.*" as they seem to be broken in BVAL itself with Java 17 * Update GH actions to run with Java 17 * Fix review comments --------- Co-authored-by: Markus Jung <ju...@apache.org> * TOMEE-4319 - CXF 4.1.0-SNAPSHOT * Add tck-mode flag to tomee embedded * Rename tck-mode flag * Add jax-rs tck * Cleanup poms and move jar files * Switch to a dependency of the tck instead of including all the files themselves. For now this is just the staging dependency. * Revert import changes to Container.java and only include the tomee.embedded.tck.enable_tracing * Implement changes proposed by @rzo1 * Fix <snapshots> tag * Some minor changes regarding groupid and tomee version (to allow easy upgrades by mvn release plugin) * Align servlet_adaptor with openejb class from tomee-tck * No need to build a jar or attach sources * Disable fail-on-constrainedto * Fix JAXRSClientIT and JAXRSBasicClientIT Tests * add comments to arquillian.xml * Add a module that generates the signature-file for JAX-RS. * Add licence header * Remove jakarta.staging.repo as a custom repository, as the dependencies we need from there are now in maven central. * Fix Version of tcks * Fix tcks after merge * Add some exclusions for SE-Related tests and disable the TomEE :: TCK :: JAX-RS Signature Test for now * Use latest TCK (3.1.4), Remove duplicate properties Fixes signature tests, which will fail with an odd error (nothing todo with the setup) * Move JAX-RS TCK into child modules in order to download latest 3.1.5 JAX-RS TCK via ant * Run JAX-RS TCK in remote arquillian mode * Exclude currently failing tests: TOMEE-4321 / CXF-9005 --------- Co-authored-by: Sollder1 <bened...@eisenkramer.de> Co-authored-by: Swell <5782559+sul...@users.noreply.github.com> Co-authored-by: Richard Zowalla <r...@apache.org> Co-authored-by: Richard Zowalla <13417392+r...@users.noreply.github.com> Co-authored-by: Markus Jung <ju...@apache.org> --- tck/jax-rs/install-tck-artifact.sh | 22 +++ tck/jax-rs/jax-rs-signature-test/pom.xml | 137 ++++++++++++++++ tck/jax-rs/jax-rs-tests-embedded/pom.xml | 161 ++++++++++++++++++ .../src/test/resources/arquillian.xml | 38 +++++ tck/jax-rs/jax-rs-tests/pom.xml | 179 +++++++++++++++++++++ tck/jax-rs/jax-rs-tests/src/test/conf/server.xml | 150 +++++++++++++++++ .../jax-rs-tests/src/test/conf/system.properties | 25 +++ .../jax-rs-tests/src/test/conf/tomcat-users.xml | 29 ++++ .../jax-rs-tests/src/test/resources/arquillian.xml | 29 ++++ tck/jax-rs/pom.xml | 65 ++++++++ tck/pom.xml | 4 +- .../java/org/apache/tomee/embedded/Container.java | 3 + 12 files changed, 840 insertions(+), 2 deletions(-) diff --git a/tck/jax-rs/install-tck-artifact.sh b/tck/jax-rs/install-tck-artifact.sh new file mode 100755 index 0000000000..3890271c20 --- /dev/null +++ b/tck/jax-rs/install-tck-artifact.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +VERSION="$1" + +# jar +mvn org.apache.maven.plugins:maven-install-plugin:3.1.0:install-file \ +-Dfile=target/jakarta-restful-ws-tck-"$VERSION".jar -DgroupId=jakarta.ws.rs \ +-DartifactId=jakarta-restful-ws-tck -Dversion="$VERSION" -Dpackaging=jar \ No newline at end of file diff --git a/tck/jax-rs/jax-rs-signature-test/pom.xml b/tck/jax-rs/jax-rs-signature-test/pom.xml new file mode 100644 index 0000000000..03ec3ecb28 --- /dev/null +++ b/tck/jax-rs/jax-rs-signature-test/pom.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tomee</groupId> + <artifactId>jax-rs</artifactId> + <version>10.0.0-M2-SNAPSHOT</version> + </parent> + + <artifactId>jax-rs-signature-test</artifactId> + <name>TomEE :: TCK :: JAX-RS TCK :: Signature Test</name> + + <dependencies> + <dependency> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta-restful-ws-tck</artifactId> + <version>${jaxrs.tck.version}</version> + </dependency> + <dependency> + <groupId>org.netbeans.tools</groupId> + <artifactId>sigtest-maven-plugin</artifactId> + <version>1.6</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + </testResource> + </testResources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy</id> + <phase>generate-test-resources</phase> + <goals> + <goal>copy</goal> + </goals> + + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.apache.tomee</groupId> + <artifactId>jakartaee-api</artifactId> + <version>${version.jakartaee-api}</version> + <type>jar</type> + <overWrite>true</overWrite> + <outputDirectory>${project.build.directory}/signaturedirectory + </outputDirectory> + <destFileName>jakartaee-api.jar</destFileName> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <argLine> + --add-opens java.base/java.lang=ALL-UNNAMED + --add-opens java.base/java.io=ALL-UNNAMED + --add-opens java.base/java.net=ALL-UNNAMED + --add-opens java.base/javax.net.ssl=ALL-UNNAMED + --add-opens java.xml/javax.xml.namespace=ALL-UNNAMED + --add-opens java.base/java.util=ALL-UNNAMED + --add-opens java.base/java.security=ALL-UNNAMED + --add-opens java.base/java.util.concurrent=ALL-UNNAMED + </argLine> + <reuseForks>false</reuseForks> + <forkCount>1</forkCount> + <systemProperties> + <jimage.dir>${project.build.directory}/jimage</jimage.dir> + <signature.sigTestClasspath> + ${project.build.directory}/signaturedirectory/jakartaee-api.jar:${project.build.directory}/jimage/java.base:${project.build.directory}/jimage/java.rmi:${project.build.directory}/jimage/java.sql:${project.build.directory}/jimage/java.naming + </signature.sigTestClasspath> + </systemProperties> + <dependenciesToScan> + <dependency>jakarta.ws.rs:jakarta-restful-ws-tck</dependency> + </dependenciesToScan> + <includes> + <include>**/JAXRSSigTestIT</include> + </includes> + <!-- + For some odd reason, the signature test will fail in reflection mode run under J17 with the following error report. + However, the fields are present. + + Note: It also fails with the original 3.1.0 artifact, so most likely a deeper issue to follow up. + + Missing Fields + jakarta.ws.rs.core.Cookie: field public final static int jakarta.ws.rs.core.Cookie.DEFAULT_VERSION = 1 + affected jakarta.ws.rs.core.NewCookie + jakarta.ws.rs.core.NewCookie: field public final static int jakarta.ws.rs.core.NewCookie.DEFAULT_MAX_AGE = -1 + Added Fields + jakarta.ws.rs.core.Cookie: field public final static int jakarta.ws.rs.core.Cookie.DEFAULT_VERSION + affected jakarta.ws.rs.core.NewCookie + jakarta.ws.rs.core.NewCookie: field public final static int jakarta.ws.rs.core.NewCookie.DEFAULT_MAX_AGE + duplicate messages suppressed: 2 + + --> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file diff --git a/tck/jax-rs/jax-rs-tests-embedded/pom.xml b/tck/jax-rs/jax-rs-tests-embedded/pom.xml new file mode 100644 index 0000000000..430f84ffab --- /dev/null +++ b/tck/jax-rs/jax-rs-tests-embedded/pom.xml @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tomee</groupId> + <artifactId>jax-rs</artifactId> + <version>10.0.0-M2-SNAPSHOT</version> + </parent> + + <artifactId>jax-rs-tests-embedded</artifactId> + <packaging>jar</packaging> + <name>TomEE :: TCK :: JAX-RS TCK :: Tests Embedded</name> + + + <dependencies> + <dependency> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta-restful-ws-tck</artifactId> + <version>${jaxrs.tck.version}</version> + </dependency> + + <!-- Added for test--> + <dependency> + <groupId>org.junit</groupId> + <artifactId>junit-bom</artifactId> + <version>${junit.jupiter.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + + <!-- Needed by some TCK tests: + JsonbContextProviderIT.shouldUseApplicationProvidedJsonbInstance + UriBuilderIT.shouldBuildValidInstanceFromScratch + --> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-library</artifactId> + <version>2.2</version> + <scope>test</scope> + </dependency> + <!--Tomee-Deps:--> + <!-- https://mvnrepository.com/artifact/org.apache.tomee/arquillian-tomee-remote --> + <dependency> + <groupId>org.apache.tomee</groupId> + <artifactId>arquillian-tomee-embedded</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.tomee</groupId> + <artifactId>tomee-webservices</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.tomee</groupId> + <artifactId>tomee-jaxrs</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + </testResource> + </testResources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <reuseForks>false</reuseForks> + <forkCount>1</forkCount> + <useFile>false</useFile> + <disableXmlReport>false</disableXmlReport> + + <!--Hint: Default naming of surefire is not followed.--> + <includes> + <include>**/*.java</include> + </includes> + + <excludes> + <!-- + SeBootstrap is stated as an optional component for containers. + It is also only listed as a Java-SE Publication Mechanism in the Specification (2.3.1.2). + Therefore, we exclude its IT. + --> + <exclude>**/SeBootstrapIT.java</exclude> + <!-- We have an own module for signature-Tests--> + <exclude>**/JAXRSSigTestIT.java</exclude> + + <!-- TODO: TOMEE-4321 / CXF-9005 + ee.jakarta.tck.ws.rs.jaxrs31.spec.extensions.JAXRSClientIT#featureIsRegisteredTest + ee.jakarta.tck.ws.rs.jaxrs31.spec.extensions.JAXRSClientIT#dynamicFeatureIsRegisteredTest + ee.jakarta.tck.ws.rs.spec.contextprovider.JsonbContextProviderIT#shouldUseApplicationProvidedJsonbInstance + --> + <exclude>**/JAXRSClientIT.java</exclude> + <exclude>**/JsonbContextProviderIT.java</exclude> + </excludes> + + <dependenciesToScan> + <dependency>jakarta.ws.rs:jakarta-restful-ws-tck</dependency> + </dependenciesToScan> + + <systemPropertyVariables> + <servlet_adaptor>org.apache.openejb.server.rest.OpenEJBRestServlet</servlet_adaptor> + <webServerHost>localhost</webServerHost> + <webServerPort>8080</webServerPort> + <porting.ts.url.class.1>ee.jakarta.tck.ws.rs.lib.implementation.sun.common.SunRIURL + </porting.ts.url.class.1> + <org.apache.cxf.transport.http.forceURLConnection>true + </org.apache.cxf.transport.http.forceURLConnection> + <openejb.jaxrs.fail-on-constrainedto>false</openejb.jaxrs.fail-on-constrainedto> + <tomee.embedded.tck.enable_tracing>true</tomee.embedded.tck.enable_tracing> + <user>j2ee</user> + <password>j2ee</password> + <authuser>javajoe</authuser> + <authpassword>javajoe</authpassword> + </systemPropertyVariables> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file diff --git a/tck/jax-rs/jax-rs-tests-embedded/src/test/resources/arquillian.xml b/tck/jax-rs/jax-rs-tests-embedded/src/test/resources/arquillian.xml new file mode 100644 index 0000000000..1c7b4fdab3 --- /dev/null +++ b/tck/jax-rs/jax-rs-tests-embedded/src/test/resources/arquillian.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> +<arquillian xmlns="http://jboss.org/schema/arquillian" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://jboss.org/schema/arquillian + http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> + <container qualifier="tomee-embedded" default="true"> + <configuration> + <!--Defines the users with their passwords. Syntax: <username>=<password>--> + <property name="users"> + javajoe=javajoe + j2ee=j2ee + </property> + <!--Assigns roles to users, multiple definitions per user are allowed and compounded. Syntax: <username>=<role>--> + <property name="roles"> + javajoe=OTHERROLE + j2ee=DIRECTOR + </property> + </configuration> + </container> +</arquillian> diff --git a/tck/jax-rs/jax-rs-tests/pom.xml b/tck/jax-rs/jax-rs-tests/pom.xml new file mode 100644 index 0000000000..092ccc1ceb --- /dev/null +++ b/tck/jax-rs/jax-rs-tests/pom.xml @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tomee</groupId> + <artifactId>jax-rs</artifactId> + <version>10.0.0-M2-SNAPSHOT</version> + </parent> + + <artifactId>jax-rs-tests</artifactId> + <packaging>jar</packaging> + <name>TomEE :: TCK :: JAX-RS TCK :: Tests</name> + + <dependencies> + <dependency> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta-restful-ws-tck</artifactId> + <version>${jaxrs.tck.version}</version> + </dependency> + + <!-- Added for test--> + <dependency> + <groupId>org.junit</groupId> + <artifactId>junit-bom</artifactId> + <version>${junit.jupiter.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + + <!-- Needed by some TCK tests: + JsonbContextProviderIT.shouldUseApplicationProvidedJsonbInstance + UriBuilderIT.shouldBuildValidInstanceFromScratch + --> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-library</artifactId> + <version>2.2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>apache-tomee</artifactId> + <version>${project.version}</version> + <type>zip</type> + <classifier>plus</classifier> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.tomee</groupId> + <artifactId>tomee-webservices</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.tomee</groupId> + <artifactId>tomee-jaxrs</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.shrinkwrap.descriptors</groupId> + <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId> + <version>${version.shrinkwrap.descriptor}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.arquillian.testng</groupId> + <artifactId>arquillian-testng-container</artifactId> + <version>${version.arquillian}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>arquillian-tomee-remote</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + </testResource> + </testResources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <reuseForks>false</reuseForks> + <forkCount>1</forkCount> + <useFile>false</useFile> + <disableXmlReport>false</disableXmlReport> + + <!--Hint: Default naming of surefire is not followed.--> + <includes> + <include>**/*.java</include> + </includes> + + <excludes> + <!-- + SeBootstrap is stated as an optional component for containers. + It is also only listed as a Java-SE Publication Mechanism in the Specification (2.3.1.2). + Therefore, we exclude its IT. + --> + <exclude>**/SeBootstrapIT.java</exclude> + <!-- We have an own module for signature-Tests--> + <exclude>**/JAXRSSigTestIT.java</exclude> + + <!-- TODO: TOMEE-4321 / CXF-9005 + ee.jakarta.tck.ws.rs.jaxrs31.spec.extensions.JAXRSClientIT#featureIsRegisteredTest + ee.jakarta.tck.ws.rs.jaxrs31.spec.extensions.JAXRSClientIT#dynamicFeatureIsRegisteredTest + ee.jakarta.tck.ws.rs.spec.contextprovider.JsonbContextProviderIT#shouldUseApplicationProvidedJsonbInstance + --> + <exclude>**/jaxrs31/spec/extensions/JAXRSClientIT.java</exclude> + <exclude>**/spec/contextprovider/JsonbContextProviderIT.java</exclude> + </excludes> + + <dependenciesToScan> + <dependency>jakarta.ws.rs:jakarta-restful-ws-tck</dependency> + </dependenciesToScan> + + <systemPropertyVariables> + <servlet_adaptor>org.apache.openejb.server.rest.OpenEJBRestServlet</servlet_adaptor> + <webServerHost>localhost</webServerHost> + <webServerPort>8080</webServerPort> + <porting.ts.url.class.1>ee.jakarta.tck.ws.rs.lib.implementation.sun.common.SunRIURL + </porting.ts.url.class.1> + <org.apache.cxf.transport.http.forceURLConnection>true + </org.apache.cxf.transport.http.forceURLConnection> + <openejb.jaxrs.fail-on-constrainedto>false</openejb.jaxrs.fail-on-constrainedto> + <user>j2ee</user> + <password>j2ee</password> + <authuser>javajoe</authuser> + <authpassword>javajoe</authpassword> + </systemPropertyVariables> + </configuration> + </plugin> + </plugins> + </build> + + +</project> \ No newline at end of file diff --git a/tck/jax-rs/jax-rs-tests/src/test/conf/server.xml b/tck/jax-rs/jax-rs-tests/src/test/conf/server.xml new file mode 100644 index 0000000000..f60da9dbcb --- /dev/null +++ b/tck/jax-rs/jax-rs-tests/src/test/conf/server.xml @@ -0,0 +1,150 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> +<!-- Note: A "Server" is not itself a "Container", so you may not + define subcomponents such as "Valves" at this level. + Documentation at /docs/config/server.html + --> +<Server port="%webcontainer.default.shutdown.port%" shutdown="SHUTDOWN"> + <!-- TomEE plugin for Tomcat --> + <Listener className="org.apache.tomee.catalina.ServerListener" /> + <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> + <!-- Security listener. Documentation at /docs/config/listeners.html + <Listener className="org.apache.catalina.security.SecurityListener" /> + --> + <!--APR library loader. Documentation at /docs/apr.html --> + <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> + <!-- Prevent memory leaks due to use of particular java/javax APIs--> + <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> + <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> + <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> + + <!-- Global JNDI resources + Documentation at /docs/jndi-resources-howto.html + --> + <GlobalNamingResources> + <!-- Editable user database that can also be used by + UserDatabaseRealm to authenticate users + --> + <Resource name="UserDatabase" auth="Container" + type="org.apache.catalina.UserDatabase" + description="User database that can be updated and saved" + factory="org.apache.catalina.users.MemoryUserDatabaseFactory" + pathname="conf/tomcat-users.xml"/> + </GlobalNamingResources> + + <!-- A "Service" is a collection of one or more "Connectors" that share + a single "Container" Note: A "Service" is not itself a "Container", + so you may not define subcomponents such as "Valves" at this level. + Documentation at /docs/config/service.html + --> + <Service name="Catalina"> + + <!--The connectors can use a shared executor, you can define one or more named thread pools--> + <!-- + <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" + maxThreads="150" minSpareThreads="4"/> + --> + + + <!-- A "Connector" represents an endpoint by which requests are received + and responses are returned. Documentation at : + Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) + Java AJP Connector: /docs/config/ajp.html + APR (HTTP/AJP) Connector: /docs/apr.html + Define a non-SSL HTTP/1.1 Connector on port 8080 + --> + <Connector port="%webcontainer.default.port%" protocol="HTTP/1.1" + connectionTimeout="20000" + allowTrace="true" + allowedTrailerHeaders="myTrailer, myTrailer2" + redirectPort="%webcontainer.default.ssl.port%"> + <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> + </Connector> + <!-- A "Connector" using the shared thread pool--> + <!-- + <Connector executor="tomcatThreadPool" + port="8080" protocol="HTTP/1.1" + connectionTimeout="20000" + redirectPort="8443" /> + --> + <!-- Define a SSL HTTP/1.1 Connector on port 8443 + This connector uses the JSSE configuration, when using APR, the + connector should be using the OpenSSL style configuration + described in the APR documentation --> +<!-- <Connector port="%webcontainer.default.ssl.port%" protocol="HTTP/1.1" SSLEnabled="true">--> +<!-- <SSLHostConfig truststoreFile="conf/ssl-truststore">--> +<!-- <Certificate certificateKeystoreFile="conf/clientcert.jks"--> +<!-- certificateKeystorePassword="changeit"--> +<!-- type="RSA" />--> +<!-- </SSLHostConfig>--> +<!-- </Connector>--> + + <!-- Define an AJP 1.3 Connector on port 8009 --> + <!-- <Connector port="%tomee.ajp.port%" protocol="AJP/1.3" redirectPort="%tomee.ssl.port%" /> --> + + + <!-- An Engine represents the entry point (within Catalina) that processes + every request. The Engine implementation for Tomcat stand alone + analyzes the HTTP headers included with the request, and passes them + on to the appropriate Host (virtual host). + Documentation at /docs/config/engine.html --> + + <!-- You should set jvmRoute to support load-balancing via AJP ie : + <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> + --> + <Engine name="Catalina" defaultHost="localhost" backgroundProcessorDelay="1"> + + <!--For clustering, please take a look at documentation at: + /docs/cluster-howto.html (simple how to) + /docs/config/cluster.html (reference documentation) --> + <!-- + <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> + --> + + <!-- Use the LockOutRealm to prevent attempts to guess user passwords + via a brute-force attack --> + <!--Realm className="org.apache.catalina.realm.LockOutRealm"--> + <!-- This Realm uses the UserDatabase configured in the global JNDI + resources under the key "UserDatabase". Any edits + that are performed against this UserDatabase are immediately + available for use by the Realm. --> + <Realm className="org.apache.catalina.realm.UserDatabaseRealm" + resourceName="UserDatabase"/> + <!--/Realm--> + + <Host name="localhost" appBase="webapps" + unpackWARs="true" autoDeploy="true"> + + <!-- SingleSignOn valve, share authentication between web applications + Documentation at: /docs/config/valve.html --> + <!-- + <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> + --> + + <!-- Access log processes all example. + Documentation at: /docs/config/valve.html + Note: The pattern used is equivalent to using pattern="common" --> + <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" + prefix="localhost_access_log." suffix=".txt" + pattern="%h %l %u %t "%r" %s %b" resolveHosts="false"/> + + </Host> + </Engine> + </Service> + +</Server> diff --git a/tck/jax-rs/jax-rs-tests/src/test/conf/system.properties b/tck/jax-rs/jax-rs-tests/src/test/conf/system.properties new file mode 100644 index 0000000000..b0756096b0 --- /dev/null +++ b/tck/jax-rs/jax-rs-tests/src/test/conf/system.properties @@ -0,0 +1,25 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# +#cxf.jaxrs.provider-comparator=org.apache.openejb.server.cxf.rs.CxfRsHttpListener$DefaultProviderComparator +openejb.jaxrs.fail-on-constrainedto=false +j2eelogin.name=j2ee +j2eelogin.password=j2ee +authuser=javajoe +authpassword=javajoe +org.apache.cxf.transport.http.forceURLConnection=true +porting.ts.url.class.1=ee.jakarta.tck.ws.rs.lib.implementation.sun.common.SunRIURL +servlet_adaptor=org.apache.openejb.server.rest.OpenEJBRestServlet \ No newline at end of file diff --git a/tck/jax-rs/jax-rs-tests/src/test/conf/tomcat-users.xml b/tck/jax-rs/jax-rs-tests/src/test/conf/tomcat-users.xml new file mode 100644 index 0000000000..9ce04566f4 --- /dev/null +++ b/tck/jax-rs/jax-rs-tests/src/test/conf/tomcat-users.xml @@ -0,0 +1,29 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. + +--> +<tomcat-users> + <user name="admin" password="admin" roles="manager"/> + <user name="jave_vi" password="javaee_vi" roles="staff"/> + <user name="javee_vi" password="javaee_vi" roles="staff"/> + <user name="javajoe" password="javajoe" roles="Manager,Employee,guest,OTHERROLE"/> + <user name="javaee" password="javaee" roles="Administrator,Employee,mgr,asadmin"/> + <user name="j2ee" password="j2ee" roles="Administrator,Employee,mgr,asadmin,staff,DIRECTOR"/> + + <user name="CN=CTS, OU=Java Software, O=Sun Microsystems Inc., L=Burlington, ST=MA, C=US" roles="Administrator"/> +</tomcat-users> diff --git a/tck/jax-rs/jax-rs-tests/src/test/resources/arquillian.xml b/tck/jax-rs/jax-rs-tests/src/test/resources/arquillian.xml new file mode 100644 index 0000000000..ff26b039e1 --- /dev/null +++ b/tck/jax-rs/jax-rs-tests/src/test/resources/arquillian.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> +<arquillian xmlns="http://jboss.org/schema/arquillian" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://jboss.org/schema/arquillian + http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> + <container qualifier="tomee-plus" default="true"> + <configuration> + <property name="conf">src/test/conf</property> + </configuration> + </container> +</arquillian> diff --git a/tck/jax-rs/pom.xml b/tck/jax-rs/pom.xml new file mode 100644 index 0000000000..924e9a2b38 --- /dev/null +++ b/tck/jax-rs/pom.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tomee</groupId> + <artifactId>tck</artifactId> + <version>10.0.0-M2-SNAPSHOT</version> + </parent> + + <artifactId>jax-rs</artifactId> + <packaging>pom</packaging> + <name>TomEE :: TCK :: JAX-RS TCK</name> + <modules> + <module>jax-rs-tests</module> + <module>jax-rs-tests-embedded</module> + <module>jax-rs-signature-test</module> + </modules> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target> + <!-- If you use proxy you need to set it as a system properties --> + <get skipexisting="true" src="https://download.eclipse.org/ee4j/jakartaee-tck/jakartaee10/staged/eftl/jakarta-restful-ws-tck-${jaxrs.tck.version}.zip" dest="jakarta-restful-ws-tck-${jaxrs.tck.version}.zip"/> + <unzip src="jakarta-restful-ws-tck-${jaxrs.tck.version}.zip" dest="./target"/> + <chmod file="install-tck-artifact.sh" perm="+x"/> + <exec executable="sh"> + <arg line="install-tck-artifact.sh ${jaxrs.tck.version}"/> + </exec> + </target> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> \ No newline at end of file diff --git a/tck/pom.xml b/tck/pom.xml index 6c04395c52..c23804bee6 100644 --- a/tck/pom.xml +++ b/tck/pom.xml @@ -28,10 +28,9 @@ <properties> <cdi-tck.version>4.0.11</cdi-tck.version> + <jaxrs.tck.version>3.1.5</jaxrs.tck.version> <bval-tck.version>3.0.1</bval-tck.version> <jsonb-tck.version>3.0.0</jsonb-tck.version> - - <bval-tck.version>3.0.1</bval-tck.version> <jsonp-tck.version>2.1.1</jsonp-tck.version> <validation.provider>org.apache.bval.jsr.ApacheValidationProvider</validation.provider> </properties> @@ -51,6 +50,7 @@ <module>concurrency-standalone</module> <module>concurrency-signature-test</module> <module>microprofile-tck</module> + <module>jax-rs</module> </modules> <build> diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java index 27b003958b..ec0da9489f 100644 --- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java +++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java @@ -615,6 +615,9 @@ public class Container implements AutoCloseable { connector.addUpgradeProtocol(new Http2Protocol()); } + if ("true".equals(System.getProperty("tomee.embedded.tck.enable_tracing", "false"))) { + connector.setAllowTrace(true); + } tomcat.getService().addConnector(connector); tomcat.setConnector(connector); }