Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change groupId to jakarta.ee.tck.coreprofile
Add rest tck suite runner to exclude tests not appropriate for the core profile Signed-off-by: Scott M Stark <starksm64@gmail.com>
- Loading branch information
Showing
18 changed files
with
250 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule wf-core-tck-runner
updated
10 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) "2022" Red Hat and others | ||
~ | ||
~ This program and the accompanying materials are made available under the | ||
~ Apache Software License 2.0 which is available at: | ||
~ https://www.apache.org/licenses/LICENSE-2.0. | ||
~ | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
~ | ||
--> | ||
|
||
<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>jakarta.ee.tck.coreprofile</groupId> | ||
<artifactId>core-tck-parent</artifactId> | ||
<version>10.0.0</version> | ||
</parent> | ||
|
||
<artifactId>rest-tck-suite</artifactId> | ||
<name>RESTful TCK Suite for Jakarta Core Profile TCK</name> | ||
<description>This module contains a Junit 5 Suite and Extension to limit the tests from the RESTful TCK</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit.platform</groupId> | ||
<artifactId>junit-platform-suite-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.platform</groupId> | ||
<artifactId>junit-platform-suite</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar-no-fork</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> | ||
|
35 changes: 35 additions & 0 deletions
35
...estful-tck-suite/src/main/java/ee/jakarta/tck/coreprofile/rs/CoreProfileRestTCKSuite.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright \(c\) "2022" Red Hat and others | ||
* | ||
* This program and the accompanying materials are made available under the Apache Software License 2.0 which is available at: | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package ee.jakarta.tck.coreprofile.rs; | ||
|
||
|
||
import org.junit.platform.suite.api.ExcludeClassNamePatterns; | ||
import org.junit.platform.suite.api.ExcludeTags; | ||
import org.junit.platform.suite.api.IncludeClassNamePatterns; | ||
import org.junit.platform.suite.api.SelectPackages; | ||
import org.junit.platform.suite.api.Suite; | ||
import org.junit.platform.suite.api.SuiteDisplayName; | ||
|
||
/** | ||
* This Suite class redefines the tests that should be run as part of the Jakarta RESTful TCK | ||
*/ | ||
@Suite | ||
@SuiteDisplayName("Jakarta Core Profile RESTful TCK") | ||
@SelectPackages("ee.jakarta.tck.ws.rs") | ||
@ExcludeTags("xml_binding") | ||
// Entire classes with xml binding or security | ||
@ExcludeClassNamePatterns({"ee.jakarta.tck.ws.rs.ee.rs.core.securitycontext.basic.JAXRSBasicClientIT.*", | ||
"ee.jakarta.tck.ws.rs.ee.rs.container.requestcontext.security.JAXRSClientIT.*", | ||
"ee.jakarta.tck.ws.rs.api.rs.core.linkjaxbadapter.JAXRSClientIT.*" | ||
}) | ||
@IncludeClassNamePatterns(".*IT.*") | ||
public class CoreProfileRestTCKSuite { | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
...k-suite/src/main/java/ee/jakarta/tck/coreprofile/rs/CoreProfileRestTCKSuiteExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright \(c\) "2022" Red Hat and others | ||
* | ||
* This program and the accompanying materials are made available under the Apache Software License 2.0 which is available at: | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package ee.jakarta.tck.coreprofile.rs; | ||
|
||
import java.lang.reflect.Method; | ||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
|
||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
import org.junit.jupiter.api.extension.InvocationInterceptor; | ||
import org.junit.jupiter.api.extension.ReflectiveInvocationContext; | ||
|
||
/** | ||
* JUnit 5 does not have a method level exclusion pattern, so we have to intercept each | ||
* test method to check for the XML binding methods that were not correctly tagged with | ||
* xml_binding. | ||
*/ | ||
public class CoreProfileRestTCKSuiteExtension implements InvocationInterceptor { | ||
/** | ||
* These are tests that make use of XML binding but do not have the xml_binding tag on them | ||
*/ | ||
static final String[] SKIPPED = { | ||
"ee.jakarta.tck.ws.rs.jaxrs21.ee.sse.sseeventsource.JAXRSClientIT.jaxbElementTest", | ||
"ee.jakarta.tck.ws.rs.jaxrs21.ee.sse.sseeventsource.JAXRSClientIT.xmlTest", | ||
"ee.jakarta.tck.ws.rs.jaxrs21.ee.sse.sseeventsink.JAXRSClientIT.jaxbElementTest", | ||
}; | ||
static final HashSet<String> SKIPPED_METHODS = new HashSet<>(Arrays.asList(SKIPPED)); | ||
|
||
@Override | ||
public void interceptTestMethod(Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable { | ||
Method testMethod = invocationContext.getExecutable(); | ||
String name = testMethod.getName(); | ||
String key = testMethod.getDeclaringClass().getName() + "." + name; | ||
if(SKIPPED_METHODS.contains(key)) { | ||
System.out.printf("+++ CoreProfileRestTCKSuite.interceptTestMethod(%s) skipped\n", invocationContext.getExecutable()); | ||
invocation.skip(); | ||
} else { | ||
invocation.proceed(); | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...-tck-suite/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ee.jakarta.tck.coreprofile.rs.CoreProfileRestTCKSuiteExtension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.