This is an automated email from the ASF dual-hosted git repository. ema pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cxf.git
commit b62b400e2625649076479c406657406072695bb9 Author: Jim Ma <[email protected]> AuthorDate: Thu Nov 3 20:53:15 2022 +0800 [CXF-8781]:Fix microprofile restclient tck tests --- parent/pom.xml | 6 +- systests/microprofile/client/weld/pom.xml | 88 ++++++++++++++++++---- .../cxf/microprofile/AnnotationTransformer.java | 33 -------- .../org/apache/cxf/microprofile/RetryAnalyzer.java | 39 ---------- systests/microprofile/client/weld/testng.xml | 17 ----- systests/microprofile/pom.xml | 45 ----------- 6 files changed, 76 insertions(+), 152 deletions(-) diff --git a/parent/pom.xml b/parent/pom.xml index c62e4460b2..cc8c8cc20a 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -61,8 +61,8 @@ <cxf.activemq.artemis.version>2.26.0</cxf.activemq.artemis.version> <cxf.ahc.version>2.12.3</cxf.ahc.version> <cxf.apacheds.version>2.0.0.AM26</cxf.apacheds.version> - <cxf.arquillian.version>1.1.14.Final</cxf.arquillian.version> - <cxf.arquillian.weld.container.version>2.0.1.Final</cxf.arquillian.weld.container.version> + <cxf.arquillian.version>1.7.0.Alpha9</cxf.arquillian.version> + <cxf.arquillian.weld.container.version>3.0.0.Final</cxf.arquillian.weld.container.version> <cxf.aspectj.version>1.9.1</cxf.aspectj.version> <cxf.assertj.version>3.22.0</cxf.assertj.version> <cxf.atmosphere.version.range>[3.0, 4.0)</cxf.atmosphere.version.range> @@ -130,7 +130,7 @@ <cxf.jaxb.xjc.version>${cxf.jaxb.runtime.version}</cxf.jaxb.xjc.version> <cxf.jaxen.version>1.1.4</cxf.jaxen.version> <cxf.jboss.logging.version>3.4.3.Final</cxf.jboss.logging.version> - <cxf.jboss.weld.version>4.0.2.Final</cxf.jboss.weld.version> + <cxf.jboss.weld.version>4.0.3.Final</cxf.jboss.weld.version> <cxf.jboss.narayana.version>5.12.7.Final</cxf.jboss.narayana.version> <cxf.jcache.version>1.1.1</cxf.jcache.version> <cxf.jdom.version>1.0</cxf.jdom.version> diff --git a/systests/microprofile/client/weld/pom.xml b/systests/microprofile/client/weld/pom.xml index 834fecf025..15fcc73304 100644 --- a/systests/microprofile/client/weld/pom.xml +++ b/systests/microprofile/client/weld/pom.xml @@ -32,8 +32,9 @@ <properties> <cxf.module.name>org.apache.cxf.systests.microprofile.weld</cxf.module.name> + <cxf.jetty.version>9.2.28.v20190418</cxf.jetty.version> </properties> - + <dependencies> <dependency> <groupId>org.jboss.arquillian.testng</groupId> @@ -51,6 +52,12 @@ <groupId>org.jboss.arquillian.container</groupId> <artifactId>arquillian-weld-embedded</artifactId> </dependency> + + <dependency> + <groupId>jakarta.ejb</groupId> + <artifactId>jakarta.ejb-api</artifactId> + </dependency> + <dependency> <groupId>jakarta.ws.rs</groupId> <artifactId>jakarta.ws.rs-api</artifactId> @@ -84,18 +91,77 @@ <groupId>org.apache.johnzon</groupId> <artifactId>johnzon-jsonb</artifactId> <classifier>jakarta</classifier> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.johnzon</groupId> + <artifactId>johnzon-mapper</artifactId> + <classifier>jakarta</classifier> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-server</artifactId> + <version>${cxf.jetty.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-servlet</artifactId> + <version>${cxf.jetty.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-servlets</artifactId> + <version>${cxf.jetty.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-webapp</artifactId> + <version>${cxf.jetty.version}</version> + <scope>test</scope> </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-proxy</artifactId> + <version>${cxf.jetty.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>jakarta.enterprise</groupId> + <artifactId>jakarta.enterprise.cdi-api</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject-api</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.eclipse.microprofile.rest.client</groupId> <artifactId>microprofile-rest-client-tck</artifactId> - <version>${cxf.microprofile.rest.client.version}</version> <exclusions> <exclusion> - <groupId>com.github.tomakehurst</groupId> - <artifactId>wiremock</artifactId> + <groupId>org.xmlunit</groupId> + <artifactId>xmlunit-core</artifactId> </exclusion> </exclusions> </dependency> + + <dependency> + <groupId>jakarta.json.bind</groupId> + <artifactId>jakarta.json.bind-api</artifactId> + <scope>test</scope> + </dependency> </dependencies> <build> <plugins> @@ -131,7 +197,7 @@ </goals> <configuration> <dir>${project.build.outputDirectory}</dir> - <params>--port ${wiremock.server.port}</params> + <params>--port ${wiremock.server.port} --disable-banner=true</params> </configuration> </execution> </executions> @@ -143,21 +209,13 @@ <dependenciesToScan> <dependency>org.eclipse.microprofile.rest.client:microprofile-rest-client-tck</dependency> </dependenciesToScan> - <suiteXmlFiles> - <suiteXmlFile>testng.xml</suiteXmlFile> - </suiteXmlFiles> <systemPropertyVariables> <wiremock.server.port>${wiremock.server.port}</wiremock.server.port> <sse.server.port>${sse.server.port}</sse.server.port> </systemPropertyVariables> + <forkCount>1</forkCount> + <reuseForks>false</reuseForks> </configuration> - <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-testng</artifactId> - <version>3.0.0-M7</version> - </dependency> - </dependencies> </plugin> </plugins> </build> diff --git a/systests/microprofile/client/weld/src/test/java/org/apache/cxf/microprofile/AnnotationTransformer.java b/systests/microprofile/client/weld/src/test/java/org/apache/cxf/microprofile/AnnotationTransformer.java deleted file mode 100644 index d00c18f40a..0000000000 --- a/systests/microprofile/client/weld/src/test/java/org/apache/cxf/microprofile/AnnotationTransformer.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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. - */ - -package org.apache.cxf.microprofile; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; - -import org.testng.IAnnotationTransformer; -import org.testng.annotations.ITestAnnotation; - -public class AnnotationTransformer implements IAnnotationTransformer { - @Override - public void transform(ITestAnnotation annotation, Class test, Constructor constructor, Method method) { - annotation.setRetryAnalyzer(RetryAnalyzer.class); - } -} diff --git a/systests/microprofile/client/weld/src/test/java/org/apache/cxf/microprofile/RetryAnalyzer.java b/systests/microprofile/client/weld/src/test/java/org/apache/cxf/microprofile/RetryAnalyzer.java deleted file mode 100644 index 2fa1fc5a66..0000000000 --- a/systests/microprofile/client/weld/src/test/java/org/apache/cxf/microprofile/RetryAnalyzer.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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. - */ - -package org.apache.cxf.microprofile; - -import org.testng.IRetryAnalyzer; -import org.testng.ITestResult; -import org.testng.Reporter; - -public class RetryAnalyzer implements IRetryAnalyzer { - private static final int RETRIES = 3; - private int counter; - - @Override - public boolean retry(ITestResult result) { - if (++counter < RETRIES) { - Reporter.log("Retrying test case '" + result.getName() + "', attempt " + counter); - return true; - } else { - return false; - } - } -} \ No newline at end of file diff --git a/systests/microprofile/client/weld/testng.xml b/systests/microprofile/client/weld/testng.xml deleted file mode 100644 index 5fbb897b49..0000000000 --- a/systests/microprofile/client/weld/testng.xml +++ /dev/null @@ -1,17 +0,0 @@ -<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > - -<suite name="MPRestClientTCK1.3"> - <listeners> - <listener class-name="org.apache.cxf.microprofile.AnnotationTransformer"/> - </listeners> - <test name="All TCK Tests"> - <packages> - <package name="org.eclipse.microprofile.rest.client.tck" /> - <package name="org.eclipse.microprofile.rest.client.tck.cditests" /> - <package name="org.eclipse.microprofile.rest.client.tck.asynctests" /> - <package name="org.eclipse.microprofile.rest.client.tck.sse" /> - <package name="org.eclipse.microprofile.rest.client.tck.ssl" /> - <package name="org.eclipse.microprofile.rest.client.tck.timeout" /> - </packages> - </test> -</suite> diff --git a/systests/microprofile/pom.xml b/systests/microprofile/pom.xml index 7a6885d604..0375a32a43 100644 --- a/systests/microprofile/pom.xml +++ b/systests/microprofile/pom.xml @@ -128,51 +128,6 @@ <version>${cxf.microprofile.rest.client.version}</version> <scope>test</scope> </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>${cxf.jetty.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>${cxf.jetty.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>${cxf.jetty.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-plus</artifactId> - <version>${cxf.jetty.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-webapp</artifactId> - <version>${cxf.jetty.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>apache-jsp</artifactId> - <version>${cxf.jetty.version}</version> - <exclusions> - <exclusion> - <groupId>org.glassfish</groupId> - <artifactId>jakarta.el</artifactId> - </exclusion> - <exclusion> - <groupId>org.ow2.asm</groupId> - <artifactId>asm-commons</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>${cxf.jetty.version}</version> - </dependency> </dependencies> </dependencyManagement> <modules>
