Skip to content

Commit cbc7b32

Browse files
authored
Add jaxrs tck run module to test Jersey (#5000)
* add jaxrs tck run module
1 parent 2220c83 commit cbc7b32

File tree

9 files changed

+669
-0
lines changed

9 files changed

+669
-0
lines changed

jersey-tck/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Jakarta REST TCK
2+
3+
The **Jakarta REST TCK** is a standalone kit for testing compliance of an implementation with the Jakarta REST specification.
4+
5+
6+
## Performing Test
7+
8+
While the test kit *is not dependent* of Maven, the most easy way to perform the tests is to create a copy of the sample Maven project found in the `jersey-tck` folder and adjust it to the actual needs of the implementation to be actually tested:
9+
* Replace the dependency to Jersey by a dependency to the implementation to be actually tested.
10+
* Execute `mvn verify`.
11+
* Find the test result as part of Maven's output on the console or refer to the surefire reports.
12+
13+
**Note:** Certainly the same can be performed using *other* build tools, like Gradle, or even by running a standalone Jupiter API compatible test runner (e. g. JUnit 5 Console Runner), as long as the Jakarta REST TCK JAR file and the implementation to test are both found on the classpath.
14+
15+
**Hint:** The test project can safely get stored as part of the implementation, so it can be easily executed as part of the QA process.

jersey-tck/j2ee.pass

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Eclipse Public License v. 2.0, which is available at
6+
# http://www.eclipse.org/legal/epl-2.0.
7+
#
8+
# This Source Code may also be made available under the following Secondary
9+
# Licenses when the conditions for such availability set forth in the
10+
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11+
# version 2 with the GNU Classpath Exception, which is available at
12+
# https://www.gnu.org/software/classpath/license.html.
13+
#
14+
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
#
16+
AS_ADMIN_USERPASSWORD=j2ee

jersey-tck/javajoe.pass

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Eclipse Public License v. 2.0, which is available at
6+
# http://www.eclipse.org/legal/epl-2.0.
7+
#
8+
# This Source Code may also be made available under the following Secondary
9+
# Licenses when the conditions for such availability set forth in the
10+
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11+
# version 2 with the GNU Classpath Exception, which is available at
12+
# https://www.gnu.org/software/classpath/license.html.
13+
#
14+
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
#
16+
AS_ADMIN_USERPASSWORD=javajoe

jersey-tck/pom.xml

Lines changed: 501 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License v. 2.0, which is available at
6+
* http://www.eclipse.org/legal/epl-2.0.
7+
*
8+
* This Source Code may also be made available under the following Secondary
9+
* Licenses when the conditions for such availability set forth in the
10+
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11+
* version 2 with the GNU Classpath Exception, which is available at
12+
* https://www.gnu.org/software/classpath/license.html.
13+
*
14+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
*/
16+
17+
package org.glassfish.jersey.core.tck;
18+
19+
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
20+
import org.jboss.arquillian.test.spi.TestClass;
21+
import org.jboss.shrinkwrap.api.Archive;
22+
import org.jboss.shrinkwrap.api.spec.WebArchive;
23+
24+
public class JerseyApplicationArchiveProcessor implements ApplicationArchiveProcessor {
25+
@Override
26+
public void process(Archive<?> archive, TestClass testClass) {
27+
if ("jaxrs_ee_rs_container_requestcontext_security_web.war".equals(archive.getName())) {
28+
WebArchive webArchive = (WebArchive) archive;
29+
webArchive.addAsWebInfResource("jaxrs_ee_rs_container_requestcontext_security_web.war.sun-web.xml", "sun-web.xml");
30+
} else if ("jaxrs_ee_core_securitycontext_basic_web.war".equals(archive.getName())) {
31+
WebArchive webArchive = (WebArchive) archive;
32+
webArchive.addAsWebInfResource("jaxrs_ee_core_securitycontext_basic_web.war.sun-web.xml", "sun-web.xml");
33+
}
34+
}
35+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License v. 2.0, which is available at
6+
* http://www.eclipse.org/legal/epl-2.0.
7+
*
8+
* This Source Code may also be made available under the following Secondary
9+
* Licenses when the conditions for such availability set forth in the
10+
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11+
* version 2 with the GNU Classpath Exception, which is available at
12+
* https://www.gnu.org/software/classpath/license.html.
13+
*
14+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
*/
16+
17+
package org.glassfish.jersey.core.tck;
18+
19+
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
20+
import org.jboss.arquillian.core.spi.LoadableExtension;
21+
22+
public class JerseyLoadableExtension implements LoadableExtension {
23+
@Override
24+
public void register(ExtensionBuilder extensionBuilder) {
25+
extensionBuilder.service(ApplicationArchiveProcessor.class, JerseyApplicationArchiveProcessor.class);
26+
}
27+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.glassfish.jersey.core.tck.JerseyLoadableExtension
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
5+
6+
This program and the accompanying materials are made available under the
7+
terms of the Eclipse Public License v. 2.0, which is available at
8+
http://www.eclipse.org/legal/epl-2.0.
9+
10+
This Source Code may also be made available under the following Secondary
11+
Licenses when the conditions for such availability set forth in the
12+
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
13+
version 2 with the GNU Classpath Exception, which is available at
14+
https://www.gnu.org/software/classpath/license.html.
15+
16+
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17+
18+
-->
19+
20+
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 Servlet 2.4//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_5-0.dtd">
21+
<sun-web-app>
22+
<context-root>jaxrs_ee_core_securitycontext_basic_web</context-root>
23+
<security-role-mapping>
24+
<role-name>DIRECTOR</role-name>
25+
<principal-name>j2ee</principal-name>
26+
</security-role-mapping>
27+
<security-role-mapping>
28+
<role-name>OTHERROLE</role-name>
29+
<principal-name>javajoe</principal-name>
30+
</security-role-mapping>
31+
</sun-web-app>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
5+
6+
This program and the accompanying materials are made available under the
7+
terms of the Eclipse Public License v. 2.0, which is available at
8+
http://www.eclipse.org/legal/epl-2.0.
9+
10+
This Source Code may also be made available under the following Secondary
11+
Licenses when the conditions for such availability set forth in the
12+
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
13+
version 2 with the GNU Classpath Exception, which is available at
14+
https://www.gnu.org/software/classpath/license.html.
15+
16+
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17+
18+
-->
19+
20+
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 Servlet 2.4//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_5-0.dtd">
21+
<sun-web-app>
22+
<context-root>jaxrs_ee_rs_container_requestcontext_security_web</context-root>
23+
<security-role-mapping>
24+
<role-name>DIRECTOR</role-name>
25+
<principal-name>j2ee</principal-name>
26+
</security-role-mapping>
27+
</sun-web-app>

0 commit comments

Comments
 (0)