diff --git a/glassfish-runner/jaxrs-platform-tck/pom.xml b/glassfish-runner/jaxrs-platform-tck/pom.xml index 6d5323caac..1c6a1cf66b 100644 --- a/glassfish-runner/jaxrs-platform-tck/pom.xml +++ b/glassfish-runner/jaxrs-platform-tck/pom.xml @@ -1,6 +1,7 @@ + - - jakarta - glassfish-restful-tests - 11.0.0-SNAPSHOT - jar - 4.0.0 - Jakarta restful webservices platform tests run on Glassfish - This verifies the compliance of Glassfish using Jakarta restful webservices tests for Jakarta EE Platform - by running jaxrs-platform-tck - + + 4.0.0 - - org.glassfish - standalone-tck + + org.glassfish + standalone-tck + 11.0.0-SNAPSHOT + + + jakarta + glassfish-restful-tests 11.0.0-SNAPSHOT - + jar + Jakarta restful webservices platform tests run on Glassfish + This verifies the compliance of Glassfish using Jakarta restful webservices tests for Jakarta EE Platform + by running jaxrs-platform-tck - - jaxrs-platform-tck - ${project.version} - 7.0.0-M10 - glassfish7 - + + + + + 8.0.0-M5 + glassfish8 + 5.9.1 + jaxrs-platform-tck + ${project.version} + - - - jakarta.tck - common - ${project.version} - - - jakarta.tck - libutil - ${project.version} - - - jakarta.tck - runtime - ${project.version} - - - org.junit.jupiter - junit-jupiter - ${junit.jupiter.version} - - - org.jboss.arquillian.container - arquillian-glassfish-managed-6 - 1.0.0.Alpha1 - - - jakarta.ws.rs - jakarta.ws.rs-api - - - org.glassfish.jersey.core - jersey-client - - - org.glassfish.jersey.core - jersey-common - - - org.glassfish.hk2 - hk2-locator - - - - - jakarta.tck - ${tck.artifactId} - ${tck.version} - test - - - org.glassfish.main.common - simple-glassfish-api - ${glassfish.container.version} - - - org.jboss.arquillian.junit5 - arquillian-junit5-container - 1.7.0.Alpha10 - - - commons-httpclient - commons-httpclient - 3.1 - - - org.glassfish.hk2 - hk2-locator - 3.0.3 - - - org.hamcrest - hamcrest - 2.2 - test - - + + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + + + jakarta.tck + ${tck.artifactId} + ${tck.version} + test + + + org.glassfish.main.common + simple-glassfish-api + ${glassfish.container.version} + + + org.jboss.arquillian.junit5 + arquillian-junit5-container + 1.7.0.Final + + + org.jboss.arquillian.junit5 + arquillian-junit5-core + 1.7.0.Final + + + org.jboss.arquillian.container + arquillian-container-test-spi + 1.7.0.Alpha10 + + + org.omnifaces.arquillian + arquillian-glassfish-server-managed + 1.4 + test + + + commons-httpclient + commons-httpclient + 3.1 + + + org.glassfish.hk2 + hk2-locator + 3.0.3 + + + org.hamcrest + hamcrest + 2.2 + test + + - - - full - - true - - - glassfish - - - - web - - web - - - + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.2.0 + + + 01-unpack + + unpack + + generate-resources + + + + org.glassfish.main.distributions + ${glassfish-artifact-id} + ${glassfish.container.version} + zip + false + ${project.build.directory} + + + + + + + + maven-antrun-plugin + 3.0.0 + + + 02-asadmin-permission + + run + + generate-resources + + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + 03-StopDomain1 + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + stop-domain + + + + + 04-StartDomain1 + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + start-domain + + + + + 05-Enable Trace requests + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + set + server-config.network-config.protocols.protocol.http-listener-1.http.trace-enabled=true + + + + + 06-Delete User j2ee + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + --passwordfile + ${project.basedir}/j2ee.pass + delete-file-user + j2ee + + + 0 + 1 + + + + + 07-Add User j2ee + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + --passwordfile + ${project.basedir}/j2ee.pass + create-file-user + --groups + staff:mgr + j2ee + + + + + 08-Delete User javajoe + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + --passwordfile + ${project.basedir}/javajoe.pass + delete-file-user + javajoe + + + 0 + 1 + + + + + 09-Add User javajoe + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + --passwordfile + ${project.basedir}/javajoe.pass + create-file-user + --groups + guest + javajoe + + + + + 10-list users + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + list-file-users + + + + + 11-StopDomain + + exec + + pre-integration-test + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + + stop-domain + + + + + + + maven-failsafe-plugin + + + gf-tests + + integration-test + verify + + + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-server.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-client.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-common.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-media-sse.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-container-grizzly2-http.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-container-servlet.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-container-servlet-core.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-media-json-binding.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-media-jaxb.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.ws.rs-api.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.xml.bind-api.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.json.bind-api.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.json-api.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/parsson.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/hk2-locator.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jaxb-osgi.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/yasson.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/nucleus-grizzly-all.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.activation-api.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/angus-activation.jar + + jakarta.tck:${tck.artifactId} + + ${project.build.directory}/${glassfish.toplevel.dir} + ${project.build.directory}/${glassfish.toplevel.dir} + org.glassfish.jersey.servlet.ServletContainer + localhost + 8080 + true + j2ee + j2ee + javajoe + javajoe + com.sun.ts.tests.jaxrs.lib.implementation.sun.common.SunRIURL + + + ${project.build.directory}/${glassfish.toplevel.dir} + + + - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.2.0 - - - unpack - pre-integration-test - - unpack - - - - - org.glassfish.main.distributions - ${glassfish-artifact-id} - ${glassfish.container.version} - zip - false - ${project.build.directory} - - - - - - - - exec-maven-plugin - org.codehaus.mojo - - - StopDomain1 - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - stop-domain - - - - - StartDomain1 - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - start-domain - - - - - Enable Trace requests - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - set - server-config.network-config.protocols.protocol.http-listener-1.http.trace-enabled=true - - - - - - Delete User j2ee - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - --passwordfile - ${project.basedir}/j2ee.pass - delete-file-user - j2ee - - - 0 - 1 - - - - - Add User j2ee - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - --passwordfile - ${project.basedir}/j2ee.pass - create-file-user - --groups - staff:mgr - j2ee - - - - - Delete User javajoe - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - --passwordfile - ${project.basedir}/javajoe.pass - delete-file-user - javajoe - - - 0 - 1 - - - - - Add User javajoe - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - --passwordfile - ${project.basedir}/javajoe.pass - create-file-user - --groups - guest - javajoe - - - - - list users - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - list-file-users - - - - - StopDomain - pre-integration-test - - exec - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin - - stop-domain - - - - - - - maven-failsafe-plugin - - - gf-tests - - integration-test - verify - - - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-server.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-client.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-common.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-media-sse.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-container-grizzly2-http.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-container-servlet.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-container-servlet-core.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-media-json-binding.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jersey-media-jaxb.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.ws.rs-api.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.xml.bind-api.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.json.bind-api.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.json-api.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/parsson.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/hk2-locator.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jaxb-osgi.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/yasson.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/nucleus-grizzly-all.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.activation-api.jar - - - ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/angus-activation.jar - - - jakarta.tck:${tck.artifactId} - - ${project.build.directory}/${glassfish.toplevel.dir} - org.glassfish.jersey.servlet.ServletContainer - localhost - 8080 - true - j2ee - j2ee - javajoe - javajoe - com.sun.ts.tests.jaxrs.lib.implementation.sun.common.SunRIURL - - - - ${project.build.directory}/${glassfish.toplevel.dir} - - - + + + + - - - - + + + full + + true + + + glassfish + + + + web + + web + + + diff --git a/jaxrs/pom.xml b/jaxrs/pom.xml index 4580f720a9..a60091a082 100644 --- a/jaxrs/pom.xml +++ b/jaxrs/pom.xml @@ -1,7 +1,7 @@ - @Context - private Application injectedApplication; - - private boolean isJaxrsInjectedPriorToPostConstruct = false; - - @Path("priorroot") - @GET - public String injectPriorPostConstructOnRootResource() { - return String.valueOf(isJaxrsInjectedPriorToPostConstruct); - } - - @Path("priorapp") - @GET - public String injectPriorPostConstructOnApplication() { - return String.valueOf( - getAppHolderSingleton().isUriInfoInjectedBeforePostConstruct()); - } - - @Path("priorprovider") - @GET - public String injectPriorPostConstructOnProvider( - @Context Providers providers) { - StringBuilderProvider sbp = getStringBuilderProvider(); - return String.valueOf(sbp.isApplicationInjectedBeforePostConstruct()); - } - - // - - // - @MatrixParam(value = "matrix") - String matrix; - - @Path("nokeyword") - @GET - public String noInjectOrResourceKeyword() { - return matrix; - } - - // - - // ////////////////////////////////////////////////////////////////// - private static Object lookup(String name) throws NamingException { - InitialContext ic = new InitialContext(); - return ic.lookup(name); - } - - private StringBuilderProvider getStringBuilderProvider() { - return (StringBuilderProvider) providers.getMessageBodyWriter( - StringBuilder.class, StringBuilder.class, (Annotation[]) null, - MediaType.WILDCARD_TYPE); - } - - private ApplicationHolderSingleton getAppHolderSingleton() { - return (ApplicationHolderSingleton) application.getSingletons().iterator() - .next(); - } - -} diff --git a/jaxrs/src/main/java/com/sun/ts/tests/jaxrs/platform/managedbean/StringBuilderProvider.java b/jaxrs/src/main/java/com/sun/ts/tests/jaxrs/platform/managedbean/StringBuilderProvider.java deleted file mode 100644 index e20e609429..0000000000 --- a/jaxrs/src/main/java/com/sun/ts/tests/jaxrs/platform/managedbean/StringBuilderProvider.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package com.sun.ts.tests.jaxrs.platform.managedbean; - -import java.io.IOException; -import java.io.OutputStream; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - -import jakarta.annotation.ManagedBean; -import jakarta.annotation.PostConstruct; -import jakarta.interceptor.Interceptors; -import jakarta.ws.rs.WebApplicationException; -import jakarta.ws.rs.core.Application; -import jakarta.ws.rs.core.Context; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.MultivaluedMap; -import jakarta.ws.rs.ext.MessageBodyWriter; -import jakarta.ws.rs.ext.Provider; - -@Provider -@ManagedBean("provider") -public class StringBuilderProvider implements MessageBodyWriter { - - private int value = 999; - - public int getValue() { - return value; - } - - @Interceptors(InterceptorSingleton.class) - public String getInterceptedValue() { - return String.valueOf(value); - } - - @Override - public long getSize(StringBuilder arg0, Class arg1, Type arg2, - Annotation[] arg3, MediaType arg4) { - return 13; - } - - @Override - public boolean isWriteable(Class type, Type genericType, - Annotation[] annotations, MediaType mediaType) { - return type == StringBuilder.class; - } - - @Override - public void writeTo(StringBuilder t, Class type, Type genericType, - Annotation[] annotations, MediaType mediaType, - MultivaluedMap httpHeaders, OutputStream entityStream) - throws IOException, WebApplicationException { - entityStream.write(t.toString().getBytes()); - } - - // - @Context - private Application application; - - private boolean isApplicationInjectedBeforePostConstruct; - - public boolean isApplicationInjectedBeforePostConstruct() { - return isApplicationInjectedBeforePostConstruct; - } - - @PostConstruct - public void postConstruct() { - value++; - isApplicationInjectedBeforePostConstruct = application != null; - } - // - -} diff --git a/jaxrs/src/main/java/com/sun/ts/tests/jaxrs/platform/managedbean/TSAppConfig.java b/jaxrs/src/main/java/com/sun/ts/tests/jaxrs/platform/managedbean/TSAppConfig.java deleted file mode 100644 index ac3d813b6b..0000000000 --- a/jaxrs/src/main/java/com/sun/ts/tests/jaxrs/platform/managedbean/TSAppConfig.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package com.sun.ts.tests.jaxrs.platform.managedbean; - -import java.util.HashSet; -import java.util.Set; - -import com.sun.ts.tests.jaxrs.common.provider.PrintingErrorHandler; - -import jakarta.annotation.ManagedBean; -import jakarta.annotation.PostConstruct; -import jakarta.ws.rs.core.Application; -import jakarta.ws.rs.core.Context; -import jakarta.ws.rs.core.UriInfo; - -@ManagedBean("application") -public class TSAppConfig extends Application { - - private int value = 99; - - public java.util.Set> getClasses() { - Set> resources = new HashSet>(); - resources.add(ManagedBeanRootResource.class); - resources.add(StringBuilderProvider.class); - resources.add(PrintingErrorHandler.class); - return resources; - } - - @Override - public Set getSingletons() { - Set set = new HashSet(); - set.add(new ApplicationHolderSingleton(this)); - return set; - } - - public int getValue() { - return value; - } - - public void setValue(int value) { - this.value = value; - } - - // - @Context - private UriInfo info; - - private boolean isUriInfoInjectedBeforePostConstruct; - - public boolean isUriInfoInjectedBeforePostConstruct() { - return isUriInfoInjectedBeforePostConstruct; - } - - @PostConstruct - public void postConstruct() { - value++; - isUriInfoInjectedBeforePostConstruct = info != null; - } - // -}