Skip to content

Commit

Permalink
Change groupId to jakarta.ee.tck.coreprofile
Browse files Browse the repository at this point in the history
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
starksm64 committed Jun 27, 2022
1 parent e691c8e commit 0f48fcd
Show file tree
Hide file tree
Showing 18 changed files with 250 additions and 53 deletions.
6 changes: 3 additions & 3 deletions core-profile-tck/ca-sigtest/pom.xml
Expand Up @@ -14,13 +14,13 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>jakarta.ee.tck</groupId>
<groupId>jakarta.ee.tck.coreprofile</groupId>
<artifactId>core-tck-parent</artifactId>
<version>10.0.0</version>
</parent>

<packaging>pom</packaging>
<artifactId>common-annotations-sigtest</artifactId>
<artifactId>common-annotations</artifactId>
<name>Common Annotations Signature Gen for Core Profile TCK</name>
<description>This module contains is run to generate the signature test file</description>

Expand Down Expand Up @@ -51,7 +51,7 @@
<artifact>
<file>src/main/resources/common-annotations-api-jdk11.sig</file>
<type>sig</type>
<classifier>jdk11</classifier>
<classifier>sigtest-jdk11</classifier>
</artifact>
</artifacts>
</configuration>
Expand Down
19 changes: 18 additions & 1 deletion core-profile-tck/cdi-tck-suite/pom.xml
Expand Up @@ -14,7 +14,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>jakarta.ee.tck</groupId>
<groupId>jakarta.ee.tck.coreprofile</groupId>
<artifactId>core-tck-parent</artifactId>
<version>10.0.0</version>
</parent>
Expand All @@ -39,6 +39,11 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
</dependencies>

<build>
Expand All @@ -65,6 +70,18 @@
</execution>
</executions>
</plugin>
<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>
Expand Down
Expand Up @@ -6,7 +6,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package ee.jakarta.tck.core.util;
package ee.jakarta.tck.coreprofile.util;

import java.io.IOException;
import java.util.Arrays;
Expand Down
Expand Up @@ -13,7 +13,7 @@
<listeners>
<!-- Optional - intended for debug purpose only -->
<listener class-name="org.jboss.cdi.tck.impl.testng.ConfigurationLoggingListener"/>
<listener class-name="ee.jakarta.tck.core.util.SuiteLogger"/>
<listener class-name="ee.jakarta.tck.coreprofile.util.SuiteLogger"/>
<listener class-name="org.jboss.cdi.tck.impl.testng.ProgressLoggingTestListener"/>
<!-- Optional - it's recommended to disable the default JUnit XML reporter -->
<listener class-name="org.testng.reporters.SuiteHTMLReporter"/>
Expand Down
2 changes: 1 addition & 1 deletion core-profile-tck/jsonp-tck-ext/pom.xml
Expand Up @@ -12,7 +12,7 @@
<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</groupId>
<groupId>jakarta.ee.tck.coreprofile</groupId>
<artifactId>core-tck-parent</artifactId>
<version>10.0.0</version>
</parent>
Expand Down
23 changes: 8 additions & 15 deletions core-profile-tck/pom.xml
Expand Up @@ -19,7 +19,7 @@
<version>1.0.7</version>
</parent>

<groupId>jakarta.ee.tck</groupId>
<groupId>jakarta.ee.tck.coreprofile</groupId>
<artifactId>core-tck-parent</artifactId>
<packaging>pom</packaging>
<version>10.0.0</version>
Expand Down Expand Up @@ -70,8 +70,9 @@
<modules>
<module>ca-sigtest</module>
<module>cdi-tck-suite</module>
<module>tck</module>
<module>jsonp-tck-ext</module>
<module>restful-tck-suite</module>
<module>tck</module>
<module>tck-dist</module>
</modules>

Expand Down Expand Up @@ -99,6 +100,7 @@
<weld.version>5.0.0.SP2</weld.version>
<cdi.tck.version>4.0.5</cdi.tck.version>
<inject.tck.version>2.0.2</inject.tck.version>
<rest.tck.version>3.1.0</rest.tck.version>
</properties>

<!-- Dependency management -->
Expand Down Expand Up @@ -226,22 +228,13 @@
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
Expand Down
58 changes: 58 additions & 0 deletions core-profile-tck/restful-tck-suite/pom.xml
@@ -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>

@@ -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 {

}
@@ -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();
}
}
}
@@ -0,0 +1 @@
ee.jakarta.tck.coreprofile.rs.CoreProfileRestTCKSuiteExtension
3 changes: 2 additions & 1 deletion core-profile-tck/tck-dist/README.adoc
Expand Up @@ -10,11 +10,12 @@ artifacts/

– TCK binaries and sources, packaged as jars
– TestNG suite.xml file for running the CDI Lite TCK
- Jakarta Common Annotations signature test map
- maven pom.xml to install artifacts into a local repo

doc/

– A detailed reference guide for the current version of TCK in both pdf and html formats
– A detailed reference guide for the current version of TCK in both pdf and html formats along with the asciidoc source


examples/
Expand Down

0 comments on commit 0f48fcd

Please sign in to comment.