convert tests in spec folder to junit tests - added missing files/imports/dependencies - renamed packages to match new structure
diff --git a/jaxrs-tck/pom.xml b/jaxrs-tck/pom.xml index b01597a..db50a83 100644 --- a/jaxrs-tck/pom.xml +++ b/jaxrs-tck/pom.xml
@@ -138,5 +138,19 @@ <version>2.0.0</version> </dependency> + <dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + <version>3.0.1</version> + </dependency> + + <dependency> + <groupId>jakarta.activation</groupId> + <artifactId>jakarta.activation-api</artifactId> + <version>2.0.1</version> + </dependency> + + + </dependencies> </project> \ No newline at end of file
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/ReplacingOutputStream.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/ReplacingOutputStream.java new file mode 100644 index 0000000..d7b491d --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/ReplacingOutputStream.java
@@ -0,0 +1,90 @@ +/* + * Copyright (c) 2012, 2018 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 jakarta.ws.rs.tck.common.impl; + +import java.io.IOException; +import java.io.OutputStream; + +public class ReplacingOutputStream extends OutputStream { + protected OutputStream wrappedStream; + + protected char what; + + protected char replace; + + protected String newMessage; + + public ReplacingOutputStream(OutputStream wrappedStream, char what, + char replace) { + super(); + this.wrappedStream = wrappedStream; + this.what = what; + this.replace = replace; + this.newMessage = null; + } + + public ReplacingOutputStream(OutputStream wrappedStream, String newMessage) { + super(); + this.wrappedStream = wrappedStream; + this.what = 0; + this.replace = 0; + this.newMessage = newMessage; + } + + @Override + public void write(int b) throws IOException { + write(intToByteArray(b)); + } + + @Override + public void write(byte[] b) throws IOException { + String old = new String(b); + String nw = null; + if (what != 0 && replace != 0) + nw = old.replace(what, replace); + if (newMessage != null) + nw = newMessage; + wrappedStream.write(nw.getBytes()); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + write(b); + } + + /** + * This is a hack for ascii characters only. The correct function should + * convert other bytes as well when appropriate. + */ + public static final byte[] intToByteArray(int value) { + return new byte[] { (byte) (value & 0xff) }; + } + + @Override + public void close() throws IOException { + if (wrappedStream != null) { + wrappedStream.close(); + } + } + + @Override + public void flush() throws IOException { + if (wrappedStream != null) { + wrappedStream.flush(); + } + } +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/SinglevaluedMap.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/SinglevaluedMap.java index 4cd4db4..74bb254 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/SinglevaluedMap.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/SinglevaluedMap.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ - package jakarta.ws.rs.tck.common.impl; +package jakarta.ws.rs.tck.common.impl; import java.util.ArrayList; import java.util.Collection;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringDataSource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringDataSource.java new file mode 100644 index 0000000..865bb8e --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringDataSource.java
@@ -0,0 +1,65 @@ +/* + * 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 jakarta.ws.rs.tck.common.impl; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; + +import jakarta.activation.DataSource; +import jakarta.ws.rs.core.MediaType; + +public class StringDataSource implements DataSource { + + private String value; + + private MediaType mediaType; + + public StringDataSource(String value, MediaType mediaType) { + super(); + this.value = value; + this.mediaType = mediaType; + } + + @Override + public String getContentType() { + return mediaType.getType() + "/" + mediaType.getSubtype(); + } + + @Override + public InputStream getInputStream() throws IOException { + ByteArrayInputStream bais = new ByteArrayInputStream(value.getBytes()); + return bais; + } + + @Override + public String getName() { + return value; + } + + @Override + public OutputStream getOutputStream() throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(value.length()); + OutputStreamWriter osw = new OutputStreamWriter(baos); + osw.write(value); + return baos; + } + +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringSource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringSource.java new file mode 100644 index 0000000..40c8723 --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringSource.java
@@ -0,0 +1,62 @@ +/* + * Copyright (c) 2013, 2018 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 jakarta.ws.rs.tck.common.impl; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + +import javax.xml.transform.stream.StreamSource; + +public class StringSource extends StreamSource { + + private String source; + + @Override + public String getSystemId() { + return source; + } + + public StringSource(String source) { + super(); + this.source = "<stringsource>" + source + "</stringsource>"; + } + + @Override + public void setSystemId(String arg0) { + this.source = arg0; + } + + @Override + public InputStream getInputStream() { + ByteArrayInputStream bais = new ByteArrayInputStream(source.getBytes()); + return bais; + } + + @Override + public Reader getReader() { + InputStreamReader reader = new InputStreamReader(getInputStream()); + return reader; + } + + @Override + public String getPublicId() { + return getSystemId(); + } + +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringStreamingOutput.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringStreamingOutput.java new file mode 100644 index 0000000..5a48c2c --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/impl/StringStreamingOutput.java
@@ -0,0 +1,39 @@ +/* + * 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 jakarta.ws.rs.tck.common.impl; + +import java.io.IOException; +import java.io.OutputStream; + +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.StreamingOutput; + +public class StringStreamingOutput implements StreamingOutput { + + private String value; + + public StringStreamingOutput(String value) { + this.value = value; + } + + @Override + public void write(OutputStream output) + throws IOException, WebApplicationException { + output.write(value.getBytes()); + } + +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/provider/PrintingErrorHandler.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/provider/PrintingErrorHandler.java new file mode 100644 index 0000000..3a9982c --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/provider/PrintingErrorHandler.java
@@ -0,0 +1,42 @@ +/* + * 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 jakarta.ws.rs.tck.common.provider; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.io.Writer; + +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; + +@Provider +public class PrintingErrorHandler implements ExceptionMapper<Throwable> { + + @Override + public Response toResponse(Throwable throwable) { + throwable.printStackTrace(); + + Writer result = new StringWriter(); + PrintWriter printWriter = new PrintWriter(result); + throwable.printStackTrace(printWriter); + return Response.status(Status.NOT_ACCEPTABLE).entity(result.toString()) + .build(); + } + +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/provider/StringBeanEntityProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/provider/StringBeanEntityProvider.java new file mode 100644 index 0000000..1075350 --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/common/provider/StringBeanEntityProvider.java
@@ -0,0 +1,74 @@ +/* + * 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 jakarta.ws.rs.tck.common.provider; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + +import jakarta.ws.rs.tck.common.util.JaxrsUtil; + +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyReader; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; + +@Provider +public class StringBeanEntityProvider + implements MessageBodyReader<StringBean>, MessageBodyWriter<StringBean> { + + @Override + public boolean isWriteable(Class<?> type, Type genericType, + Annotation[] annotations, MediaType mediaType) { + return StringBean.class.isAssignableFrom(type); + } + + @Override + public long getSize(StringBean t, Class<?> type, Type genericType, + Annotation[] annotations, MediaType mediaType) { + return t.get().length(); + } + + @Override + public void writeTo(StringBean t, Class<?> type, Type genericType, + Annotation[] annotations, MediaType mediaType, + MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) + throws IOException, WebApplicationException { + entityStream.write(t.get().getBytes()); + } + + @Override + public boolean isReadable(Class<?> type, Type genericType, + Annotation[] annotations, MediaType mediaType) { + return isWriteable(type, genericType, annotations, mediaType); + } + + @Override + public StringBean readFrom(Class<StringBean> type, Type genericType, + Annotation[] annotations, MediaType mediaType, + MultivaluedMap<String, String> httpHeaders, InputStream entityStream) + throws IOException, WebApplicationException { + String stream = JaxrsUtil.readFromStream(entityStream); + StringBean bean = new StringBean(stream); + return bean; + } + +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ParamEntityPrototype.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ParamEntityPrototype.java new file mode 100644 index 0000000..8f7f43f --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ParamEntityPrototype.java
@@ -0,0 +1,35 @@ +/* + * Copyright (c) 2011, 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 jakarta.ws.rs.tck.ee.rs; + +import jakarta.ws.rs.FormParam; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.MatrixParam; + +/** + * This class is to be used with {Any}Param#value + * + * @see {@link FormParam#value()}, {@link HeaderParam#value()}, + * {@link MatrixParam#value()}... + */ +public abstract class ParamEntityPrototype { + protected String value; + + public String getValue() { + return value; + } +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ext/messagebodyreaderwriter/EntityMessageWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ext/messagebodyreaderwriter/EntityMessageWriter.java new file mode 100644 index 0000000..cac6e91 --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ext/messagebodyreaderwriter/EntityMessageWriter.java
@@ -0,0 +1,75 @@ +/* + * 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 jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter; + +import java.io.IOException; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + +import jakarta.ws.rs.tck.common.AbstractMessageBodyRW; + +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; + +/** + * This class is used by + * com.sun.ts.tests.jaxrs.ee.rs.ext.providers.ProvidersServlet + */ +@Provider +public class EntityMessageWriter extends AbstractMessageBodyRW + implements MessageBodyWriter<ReadableWritableEntity> { + + @Override + public long getSize(ReadableWritableEntity t, Class<?> type, Type genericType, + Annotation[] annotations, MediaType mediaType) { + return t.toXmlString().length(); + } + + @Override + public boolean isWriteable(Class<?> type, Type genericType, + Annotation[] annotations, MediaType mediaType) { + String path = getPathValue(annotations); + if (path == null) + return false; + path = path.toLowerCase(); + boolean writable = path.contains("body"); + writable |= path.contains("head"); + writable |= path.contains("ioexception"); + writable &= MediaType.TEXT_XML_TYPE.isCompatible(mediaType); + writable &= ReadableWritableEntity.class.isAssignableFrom(type); + return writable; + } + + @Override + public void writeTo(ReadableWritableEntity t, Class<?> type, Type genericType, + Annotation[] annotations, MediaType mediaType, + MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) + throws IOException, WebApplicationException { + String path = getPathValue(annotations).toLowerCase(); + if (path.contains("body")) + entityStream.write(t.toXmlString().getBytes()); + else if (path.contains("head")) + httpHeaders.add(ReadableWritableEntity.NAME, t.toXmlString()); + else if (path.contains("ioexception")) + throw new IOException("CTS test IOException"); + } + +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ext/messagebodyreaderwriter/ReadableWritableEntity.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ext/messagebodyreaderwriter/ReadableWritableEntity.java new file mode 100644 index 0000000..5143385 --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/ee/rs/ext/messagebodyreaderwriter/ReadableWritableEntity.java
@@ -0,0 +1,51 @@ +/* + * Copyright (c) 2012, 2018 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 jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter; + +/** + * This class is used by + * com.sun.ts.tests.jaxrs.ee.rs.ext.providers.ProvidersServlet + */ +public class ReadableWritableEntity { + private String entity; + + public static final String NAME = "READABLEWRITEABLE"; + + private static final String PREFIX = "<" + NAME + ">"; + + private static final String SUFFIX = "</" + NAME + ">"; + + public ReadableWritableEntity(String entity) { + this.entity = entity; + } + + public String toXmlString() { + StringBuilder sb = new StringBuilder(); + sb.append(PREFIX).append(entity).append(SUFFIX); + return sb.toString(); + } + + @Override + public String toString() { + return entity; + } + + public static ReadableWritableEntity fromString(String stream) { + String entity = stream.replaceAll(PREFIX, "").replaceAll(SUFFIX, ""); + return new ReadableWritableEntity(entity); + } +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/instance/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/instance/JAXRSClient.java index 38d1437..6430926 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/instance/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/instance/JAXRSClient.java
@@ -14,15 +14,15 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.instance; +package jakarta.ws.rs.tck.spec.client.instance; import java.util.Collection; import java.util.Map; import java.util.Set; -import com.sun.ts.lib.util.TestUtil; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; -import com.sun.ts.tests.jaxrs.common.provider.StringBeanEntityProvider; +import jakarta.ws.rs.tck.lib.util.TestUtil; +import jakarta.ws.rs.tck.common.JAXRSCommonClient; +import jakarta.ws.rs.tck.common.provider.StringBeanEntityProvider; import jakarta.ws.rs.client.Client; import jakarta.ws.rs.client.ClientBuilder; @@ -31,12 +31,17 @@ import jakarta.ws.rs.core.Feature; import jakarta.ws.rs.core.FeatureContext; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 3031443305675236388L; @@ -48,7 +53,19 @@ new JAXRSClient().run(args); } - public JAXRSClient() { + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + + public JAXRSClientIT() { + setup(); Client client = ClientBuilder.newClient(); Configuration config = client.getConfiguration(); registeredPropertyCnt = config.getProperties().size(); @@ -58,6 +75,7 @@ } + /* Run test */ /* * @testName: defaultClientConfigurationPresetTest @@ -67,6 +85,7 @@ * @test_Strategy: This interface supports configuration of: Features, * Properties, Providers */ + @Test public void defaultClientConfigurationPresetTest() throws Fault { Client client = ClientBuilder.newClient(); checkConfig(client, registeredProviderCnt, registeredPropertyCnt); @@ -80,6 +99,7 @@ * @test_Strategy: This interface supports configuration of: Features, * Properties, Providers */ + @Test public void clientConfiguredTest() throws Fault { Client client = ClientBuilder.newClient(); client.register(new StringBeanEntityProvider());
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/JAXRSClient.java index 9e85f69..e1b75aa 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/JAXRSClient.java
@@ -14,12 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.invocations; +package jakarta.ws.rs.tck.spec.client.invocations; import java.net.URI; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; -import com.sun.ts.tests.jaxrs.common.client.JdkLoggingFilter; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JdkLoggingFilter; import jakarta.ws.rs.client.Client; import jakarta.ws.rs.client.ClientBuilder; @@ -28,17 +28,32 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.UriBuilder; +import java.io.InputStream; +import java.io.IOException; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = -3347907896017729013L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_client_invocations_web/resource"); } @@ -46,6 +61,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/client/invocations/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_client_invocations_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: synchronousTest @@ -56,6 +92,7 @@ * invocation synchronously; asynchronous execution is also supported by * calling Invocation.submit(). */ + @Test public void synchronousTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "call")); setProperty(Property.SEARCH_STRING, Resource.class.getName()); @@ -71,6 +108,7 @@ * invocation synchronously; asynchronous execution is also supported by * calling Invocation.submit(). */ + @Test public void asynchronousTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "call")); setProperty(Property.SEARCH_STRING, Resource.class.getName()); @@ -97,6 +135,7 @@ * * Create a new link instance initialized from an existing URI. */ + @Test public void invocationFromLinkTextXmlMediaTypeTest() throws Fault { Response r = invocationFromLinkWithMediaType(MediaType.TEXT_XML); checkResposeForMessage(MediaType.TEXT_XML, r); @@ -114,6 +153,7 @@ * * Create a new link instance initialized from an existing URI. */ + @Test public void invocationFromLinkApplicationJsonMediaTypeTest() throws Fault { Response r = invocationFromLinkWithMediaType(MediaType.APPLICATION_JSON); checkResposeForMessage(MediaType.APPLICATION_JSON, r); @@ -131,6 +171,7 @@ * * Create a new link instance initialized from an existing URI. */ + @Test public void invocationFromLinkTwoMediaTypesTest() throws Fault { String type1 = MediaType.APPLICATION_ATOM_XML; String type2 = MediaType.TEXT_HTML;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/Resource.java index 50d1595..2f360c7 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.invocations; +package jakarta.ws.rs.tck.spec.client.invocations; import java.util.List;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/TSAppConfig.java index fe2271e..c3bd115 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/invocations/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.invocations; +package jakarta.ws.rs.tck.spec.client.invocations; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/JAXRSClient.java index 8ae8df7..e6be15e 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/JAXRSClient.java
@@ -14,20 +14,36 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.resource; +package jakarta.ws.rs.tck.spec.client.resource; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { + +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1339633069677106930L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_client_resource_web/resource"); } @@ -35,6 +51,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/client/resource/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_client_resource_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: checkClientConceptTest @@ -46,6 +83,7 @@ * (iii) create a request from the WebTarget and (iv) submit a request or get * a prepared Invocation for later submission */ + @Test public void checkClientConceptTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "concept")); setProperty(Property.SEARCH_STRING, "concept");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/Resource.java index 7fe5d61..dcf4290 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.resource; +package jakarta.ws.rs.tck.spec.client.resource; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/TSAppConfig.java index 83ea0f3..8085ed4 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/resource/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.resource; +package jakarta.ws.rs.tck.spec.client.resource; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/EntityMessageReader.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/EntityMessageReader.java index 39ba387..462e5fa 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/EntityMessageReader.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/EntityMessageReader.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentities; +package jakarta.ws.rs.tck.spec.client.typedentities; import java.io.BufferedReader; import java.io.IOException; @@ -23,7 +23,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.MediaType;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/EntityMessageWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/EntityMessageWriter.java index 484ac92..d76bc47 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/EntityMessageWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/EntityMessageWriter.java
@@ -14,14 +14,14 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentities; +package jakarta.ws.rs.tck.spec.client.typedentities; import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.MediaType;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/JAXRSClient.java index 5a8e1ca..af3805c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/JAXRSClient.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentities; +package jakarta.ws.rs.tck.spec.client.typedentities; import java.io.BufferedReader; import java.io.ByteArrayInputStream; @@ -31,29 +31,42 @@ import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; -import com.sun.ts.tests.jaxrs.common.impl.SinglevaluedMap; -import com.sun.ts.tests.jaxrs.common.impl.StringDataSource; -import com.sun.ts.tests.jaxrs.common.impl.StringStreamingOutput; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.impl.SinglevaluedMap; +import jakarta.ws.rs.tck.common.impl.StringDataSource; +import jakarta.ws.rs.tck.common.impl.StringStreamingOutput; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; import jakarta.activation.DataSource; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MultivaluedMap; import jakarta.ws.rs.core.StreamingOutput; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1339633069677106930L; private static final String entity = Resource.class.getName(); - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_client_typedentities_web/resource"); } @@ -61,6 +74,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/client/typedentities/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_client_typedentities_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, EntityMessageReader.class, EntityMessageWriter.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: clientAnyReaderUsageTest @@ -69,6 +103,7 @@ * * @test_Strategy: JAX-RS implementations are REQUIRED to use entity providers */ + @Test public void clientAnyReaderUsageTest() throws Fault { addProvider(new EntityMessageReader()); setProperty(Property.REQUEST, buildRequest(Request.GET, "readerprovider")); @@ -91,6 +126,7 @@ * * @test_Strategy: JAX-RS implementations are REQUIRED to use entity providers */ + @Test public void clientAnyWriterUsageTest() throws Fault { ReadableWritableEntity entity = new ReadableWritableEntity( String.valueOf(serialVersionUID)); @@ -113,6 +149,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientByteArrayReaderTest() throws Fault { standardReaderInvocation(MediaType.WILDCARD_TYPE); toStringTest(byte[].class); @@ -126,6 +163,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientStringReaderTest() throws Fault { standardReaderInvocation(MediaType.WILDCARD_TYPE); toStringTest(String.class); @@ -139,6 +177,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientInputStreamReaderTest() throws Fault { standardReaderInvocation(MediaType.WILDCARD_TYPE); InputStream responseEntity = getResponse().readEntity(InputStream.class); @@ -155,6 +194,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientReaderReaderTest() throws Fault { standardReaderInvocation(MediaType.WILDCARD_TYPE); Reader responseEntity = getResponse().readEntity(Reader.class); @@ -170,6 +210,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientFileReaderTest() throws Fault { standardReaderInvocation(MediaType.WILDCARD_TYPE); File responseEntity = getResponse().readEntity(File.class); @@ -192,6 +233,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientDataSourceReaderTest() throws Fault { standardReaderInvocation(MediaType.WILDCARD_TYPE); DataSource responseEntity = getResponse().readEntity(DataSource.class); @@ -213,6 +255,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientSourceReaderTest() throws Fault { standardReaderInvocation(MediaType.TEXT_XML_TYPE); Source responseEntity = getResponse().readEntity(Source.class); @@ -235,6 +278,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientMultivaluedMapReaderTest() throws Fault { standardReaderInvocation(MediaType.APPLICATION_FORM_URLENCODED_TYPE); @SuppressWarnings("unchecked") @@ -258,6 +302,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientByteArrayWriterTest() throws Fault { standardWriterInvocation(entity.getBytes()); } @@ -270,6 +315,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientStringWriterTest() throws Fault { standardWriterInvocation(entity); } @@ -282,6 +328,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientInputStreamWriterTest() throws Fault { ByteArrayInputStream bais = new ByteArrayInputStream(entity.getBytes()); standardWriterInvocation(bais); @@ -296,6 +343,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientReaderWriterTest() throws Fault { ByteArrayInputStream bais = new ByteArrayInputStream(entity.getBytes()); Reader reader = new InputStreamReader(bais); @@ -311,6 +359,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientFileWriterTest() throws Fault { File file = createFileEntity(entity); standardWriterInvocation(file); @@ -325,6 +374,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientDataSourceWriterTest() throws Fault { DataSource ds = new StringDataSource(entity, MediaType.WILDCARD_TYPE); standardWriterInvocation(ds); @@ -338,6 +388,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientSourceWriterTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.APPLICATION_XML_TYPE)); @@ -355,6 +406,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientMultivaluedMapWriterTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.APPLICATION_FORM_URLENCODED_TYPE)); @@ -371,6 +423,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientStreamingOutputWriterTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.APPLICATION_FORM_URLENCODED_TYPE));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/Resource.java index bfa1868..a32bd1c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/Resource.java
@@ -14,9 +14,9 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentities; +package jakarta.ws.rs.tck.spec.client.typedentities; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/TSAppConfig.java index 01770de..2945482 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentities/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentities; +package jakarta.ws.rs.tck.spec.client.typedentities; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/EntityMessageReader.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/EntityMessageReader.java index eecad0f..7566a4b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/EntityMessageReader.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/EntityMessageReader.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentitieswithxmlbinding; +package jakarta.ws.rs.tck.spec.client.typedentitieswithxmlbinding; import java.io.BufferedReader; import java.io.IOException; @@ -23,7 +23,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.MediaType;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/EntityMessageWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/EntityMessageWriter.java index d494509..2c47de8 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/EntityMessageWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/EntityMessageWriter.java
@@ -14,14 +14,14 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentitieswithxmlbinding; +package jakarta.ws.rs.tck.spec.client.typedentitieswithxmlbinding; import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.MediaType;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/JAXRSClient.java index fdb79ae..be62547 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/JAXRSClient.java
@@ -14,28 +14,43 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentitieswithxmlbinding; +package jakarta.ws.rs.tck.spec.client.typedentitieswithxmlbinding; import javax.xml.namespace.QName; +import java.io.InputStream; +import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; import jakarta.ws.rs.core.GenericType; import jakarta.ws.rs.core.MediaType; import jakarta.xml.bind.JAXBElement; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1339633069677106930L; private static final String entity = Resource.class.getName(); - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_client_typedentitieswithxmlbinding_web/resource"); } @@ -43,6 +58,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_client_typedentitieswithxmlbinding_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, EntityMessageReader.class, EntityMessageWriter.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* * @testName: clientJaxbElementReaderTest * @@ -51,6 +87,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientJaxbElementReaderTest() throws Fault { GenericType<JAXBElement<String>> type = new GenericType<JAXBElement<String>>() { }; @@ -79,6 +116,7 @@ * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST * be supported by all JAX-RS implementations */ + @Test public void clientJaxbElementWriterTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.APPLICATION_XML_TYPE));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/Resource.java index dd490c6..01a46b8 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/Resource.java
@@ -14,9 +14,9 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentitieswithxmlbinding; +package jakarta.ws.rs.tck.spec.client.typedentitieswithxmlbinding; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/TSAppConfig.java index dfbb593..5877686 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.typedentitieswithxmlbinding; +package jakarta.ws.rs.tck.spec.client.typedentitieswithxmlbinding; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/webtarget/IteratedList.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/webtarget/IteratedList.java index 3d3d7b9..6ee926d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/webtarget/IteratedList.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/webtarget/IteratedList.java
@@ -14,15 +14,15 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.webtarget; +package jakarta.ws.rs.tck.spec.client.webtarget; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; -import com.sun.ts.lib.harness.EETest.Fault; -import com.sun.ts.lib.util.TestUtil; +import jakarta.ws.rs.tck.common.JAXRSCommonClient.Fault; +import jakarta.ws.rs.tck.lib.util.TestUtil; /** * A RandomAccess collection of objects upon each a certain method is called
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/webtarget/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/webtarget/JAXRSClient.java index 26c2b54..826ab38 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/webtarget/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/client/webtarget/JAXRSClient.java
@@ -14,32 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.client.webtarget; +package jakarta.ws.rs.tck.spec.client.webtarget; import java.lang.reflect.Method; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.sun.ts.lib.util.TestUtil; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; -import com.sun.ts.tests.jaxrs.common.provider.StringBeanEntityProvider; +import jakarta.ws.rs.tck.lib.util.TestUtil; +import jakarta.ws.rs.tck.common.JAXRSCommonClient; +import jakarta.ws.rs.tck.common.provider.StringBeanEntityProvider; import jakarta.ws.rs.client.Client; import jakarta.ws.rs.client.ClientBuilder; import jakarta.ws.rs.client.WebTarget; import jakarta.ws.rs.core.Configuration; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { + +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = -9146409863180750617L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_client_webtarget_web/resource"); } @@ -47,6 +54,17 @@ new JAXRSClient().run(args); } + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: imutableWithRespectToUriMatrixPathTest @@ -57,6 +75,7 @@ * (or URI template): methods for specifying additional path segments and * parameters return a new instance of WebTarget. */ + @Test public void imutableWithRespectToUriMatrixPathTest() throws Fault { IteratedList<WebTarget> targets = new IteratedList<WebTarget>( WebTarget.class); @@ -90,6 +109,7 @@ * (or URI template): methods for specifying additional path segments and * parameters return a new instance of WebTarget. */ + @Test public void imutableWithRespectToUriQueryResolveTemplateTest() throws Fault { IteratedList<WebTarget> targets = new IteratedList<WebTarget>( WebTarget.class); @@ -141,6 +161,7 @@ * their configuration. Thus, configuring a WebTarget does not create new * instances */ + @Test public void mutableWithRespectToConfigTest() throws Fault { // check no WebTarget is returned from configuration // cannot check subclass of Configuration if any because @@ -171,6 +192,7 @@ * * Get access to the underlying Configuration configuration. */ + @Test public void deepCopyConfigWebTargetLevelTest() throws Fault { Client client = ClientBuilder.newClient(); Configuration config = client.getConfiguration(); @@ -196,6 +218,7 @@ * The following Client API types are configurable: Client, Invocation, * Invocation.Builder and WebTarget. */ + @Test public void deepCopyConfigClientLevelTest() throws Fault { Client client = ClientBuilder.newClient(); // Client level inheritance @@ -213,6 +236,7 @@ * @test_Strategy: However, any additional changes to the instance of * WebTarget will not impact the Client's configuration and vice versa. */ + @Test public void webTargetConfigNotImpactClientTest() throws Fault { Client client = ClientBuilder.newClient(); WebTarget target = client.target("resource");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/JAXRSClient.java index d3d08cc..65cb34b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/JAXRSClient.java
@@ -14,24 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.context.client; +package jakarta.ws.rs.tck.spec.context.client; -import static com.sun.ts.tests.jaxrs.spec.context.server.StringBeanEntityProviderWithInjectables.notInjected; +import static jakarta.ws.rs.tck.spec.context.server.StringBeanEntityProviderWithInjectables.notInjected; +import java.io.InputStream; +import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; -import com.sun.ts.tests.jaxrs.common.provider.StringBean; -import com.sun.ts.tests.jaxrs.spec.context.server.StringBeanEntityProviderWithInjectables; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.provider.StringBean; +import jakarta.ws.rs.tck.spec.context.server.StringBeanEntityProviderWithInjectables; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = -2921113736906329195L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_context_client_web/resource"); } @@ -44,6 +59,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/context/client/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_context_client_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: clientWriterTest @@ -61,6 +97,7 @@ * method is fully managed by the JAX-RS implementation or any underlying IoC * container supported by the implementation. */ + @Test public void clientWriterTest() throws Fault { addProvider(StringBeanEntityProviderWithInjectables.class); setRequestContentEntity(new StringBean("stringbean")); @@ -85,6 +122,7 @@ * method is fully managed by the JAX-RS implementation or any underlying IoC * container supported by the implementation. */ + @Test public void clientReaderTest() throws Fault { addProvider(StringBeanEntityProviderWithInjectables.class); setRequestContentEntity("stringbean");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/Resource.java index d360b56..d32757b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.context.client; +package jakarta.ws.rs.tck.spec.context.client; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/TSAppConfig.java index 1b00014..c717806 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/client/TSAppConfig.java
@@ -14,12 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.context.client; +package jakarta.ws.rs.tck.spec.context.client; import java.util.HashSet; import java.util.Set; -import com.sun.ts.tests.jaxrs.common.provider.PrintingErrorHandler; +import jakarta.ws.rs.tck.common.provider.PrintingErrorHandler; import jakarta.ws.rs.core.Application;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/JAXRSClient.java index 50673e3..cdd6d8f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/JAXRSClient.java
@@ -14,20 +14,35 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.context.server; +package jakarta.ws.rs.tck.spec.context.server; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = -8615109992706004114L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_context_server_web/resource"); } @@ -40,6 +55,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/context/server/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_context_server_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, SingletonWithInjectables.class, StringBeanEntityProviderWithInjectables.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* @@ -54,6 +90,7 @@ * An instance can be injected into a class field or method parameter using * the @Context annotation. */ + @Test public void serverWriterInjectionTest() throws Fault { setRequestContentEntity(""); setProperty(Property.REQUEST, buildRequest(Request.POST, "writer")); @@ -73,6 +110,7 @@ * An instance can be injected into a class field or method parameter using * the @Context annotation. */ + @Test public void serverReaderInjectionTest() throws Fault { setRequestContentEntity(""); setProperty(Property.REQUEST, buildRequest(Request.POST, "reader")); @@ -92,6 +130,7 @@ * An instance can be injected into a class field or method parameter using * the @Context annotation. */ + @Test public void resourceInjectionTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "instance")); invoke(); @@ -110,6 +149,7 @@ * An instance can be injected into a class field or method parameter using * the @Context annotation. */ + @Test public void applicationInjectionTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "application")); invoke(); @@ -128,6 +168,7 @@ * An instance can be injected into a class field or method parameter using * the @Context annotation. */ + @Test public void methodArgumentsInjectionTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "method")); invoke();
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/Resource.java index fbd18fc..5f8c79b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/Resource.java
@@ -14,11 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.context.server; +package jakarta.ws.rs.tck.spec.context.server; import java.util.Set; -import com.sun.ts.tests.jaxrs.common.provider.StringBean; +import jakarta.ws.rs.tck.common.provider.StringBean; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/SingletonWithInjectables.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/SingletonWithInjectables.java index 58b1fc9..53e334d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/SingletonWithInjectables.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/SingletonWithInjectables.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.context.server; +package jakarta.ws.rs.tck.spec.context.server; public class SingletonWithInjectables { public SingletonWithInjectables(TSAppConfig config) {
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/StringBeanEntityProviderWithInjectables.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/StringBeanEntityProviderWithInjectables.java index 44aabc3..fe76c41 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/StringBeanEntityProviderWithInjectables.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/StringBeanEntityProviderWithInjectables.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.context.server; +package jakarta.ws.rs.tck.spec.context.server; import java.io.IOException; import java.io.InputStream; @@ -22,8 +22,8 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import com.sun.ts.tests.jaxrs.common.provider.StringBean; -import com.sun.ts.tests.jaxrs.common.provider.StringBeanEntityProvider; +import jakarta.ws.rs.tck.common.provider.StringBean; +import jakarta.ws.rs.tck.common.provider.StringBeanEntityProvider; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.container.ResourceContext;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/TSAppConfig.java index cf36704..0335075 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/context/server/TSAppConfig.java
@@ -14,13 +14,13 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.context.server; +package jakarta.ws.rs.tck.spec.context.server; import java.util.Collections; import java.util.HashSet; import java.util.Set; -import com.sun.ts.tests.jaxrs.common.provider.PrintingErrorHandler; +import jakarta.ws.rs.tck.common.provider.PrintingErrorHandler; import jakarta.ws.rs.client.ClientBuilder; import jakarta.ws.rs.container.ResourceContext;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AbstractAddFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AbstractAddFilter.java index 30cf807..a4d014b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AbstractAddFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AbstractAddFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature; +package jakarta.ws.rs.tck.spec.filter.dynamicfeature; import java.io.IOException; import java.lang.annotation.Annotation;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AbstractAddInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AbstractAddInterceptor.java index 9e2d0ed..58d12b9 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AbstractAddInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AbstractAddInterceptor.java
@@ -14,13 +14,13 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature; +package jakarta.ws.rs.tck.spec.filter.dynamicfeature; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import com.sun.ts.tests.jaxrs.common.util.JaxrsUtil; +import jakarta.ws.rs.tck.common.util.JaxrsUtil; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.ext.ReaderInterceptor;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddDynamicFeature.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddDynamicFeature.java index e14fa0b..9d38440 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddDynamicFeature.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddDynamicFeature.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature; +package jakarta.ws.rs.tck.spec.filter.dynamicfeature; import jakarta.ws.rs.container.DynamicFeature; import jakarta.ws.rs.container.ResourceInfo;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddOneInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddOneInterceptor.java index 0816504..3de9358 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddOneInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddOneInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature; +package jakarta.ws.rs.tck.spec.filter.dynamicfeature; public class AddOneInterceptor extends AbstractAddInterceptor {
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddTenFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddTenFilter.java index 3b2ac5c..8f85ce8 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddTenFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/AddTenFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature; +package jakarta.ws.rs.tck.spec.filter.dynamicfeature; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/JAXRSClient.java index e229f7b..03306f4 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/JAXRSClient.java
@@ -14,23 +14,38 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature; +package jakarta.ws.rs.tck.spec.filter.dynamicfeature; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ /** * Test the interceptor is called when any entity provider is called */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1177743379402950754L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_filter_dynamicfeature_web/resource"); } @@ -43,6 +58,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/filter/dynamicfeature/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_filter_dynamicfeature_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, AddTenFilter.class, AddOneInterceptor.class, AddDynamicFeature.class, AbstractAddInterceptor.class, AbstractAddFilter.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* @@ -58,6 +94,7 @@ * invoked; * */ + @Test public void noBindingTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "nobinding")); setProperty(Property.CONTENT, "0"); @@ -80,6 +117,7 @@ * invoked; * */ + @Test public void dynamicBindingTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "dynamic")); setProperty(Property.CONTENT, "0");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/Resource.java index 4c5cd99..721f533 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature; +package jakarta.ws.rs.tck.spec.filter.dynamicfeature; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/TSAppConfig.java index 331e102..d556dbc 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/dynamicfeature/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature; +package jakarta.ws.rs.tck.spec.filter.dynamicfeature; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AbstractAddFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AbstractAddFilter.java index 2a768bf..6bf7da0 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AbstractAddFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AbstractAddFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import java.io.IOException; import java.lang.annotation.Annotation;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AbstractAddInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AbstractAddInterceptor.java index 8f29b5d..03b0cb2 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AbstractAddInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AbstractAddInterceptor.java
@@ -14,13 +14,13 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import com.sun.ts.tests.jaxrs.common.util.JaxrsUtil; +import jakarta.ws.rs.tck.common.util.JaxrsUtil; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.ext.ReaderInterceptor;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddOneFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddOneFilter.java index afdc74c..3f091ea 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddOneFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddOneFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddOneInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddOneInterceptor.java index 5bfcb12..4f8ef30 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddOneInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddOneInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import jakarta.annotation.Priority; import jakarta.ws.rs.ext.Provider;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddTenGlobalFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddTenGlobalFilter.java index 616b697..08d037b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddTenGlobalFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddTenGlobalFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import jakarta.annotation.Priority; import jakarta.ws.rs.ext.Provider;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddTenGlobalInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddTenGlobalInterceptor.java index 77ccbf0..97b1bbb 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddTenGlobalInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/AddTenGlobalInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/ExceptionNameBinding.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/ExceptionNameBinding.java index e36c3de..23cbc5b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/ExceptionNameBinding.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/ExceptionNameBinding.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import java.lang.annotation.ElementType; import java.lang.annotation.Retention;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/JAXRSClient.java index 4242024..e79d829 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/JAXRSClient.java
@@ -14,25 +14,40 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; import jakarta.ws.rs.core.Response.Status; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ /** * Test the interceptor is called when any entity provider is called */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 4992831116540554144L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_filter_exception_web/resource"); } @@ -45,6 +60,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/filter/exception/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_filter_exception_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, AbstractAddFilter.class, AbstractAddInterceptor.class, AddOneFilter.class, AddOneInterceptor.class, AddTenGlobalFilter.class, AddTenGlobalInterceptor.class, ExceptionNameBinding.class, NeverUsedExceptionMapper.class, PostMatchingThrowingFilter.class, PreMatchingThrowingFilter.class, RuntimeExceptionMapper.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* @@ -60,6 +96,7 @@ * invoked; * */ + @Test public void throwExceptionOnPostMatchingFilterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); setProperty(Property.REQUEST_HEADERS, @@ -81,6 +118,7 @@ * Otherwise, only globally bound filters in the Container Response chain MUST * be invoked */ + @Test public void throwExceptionOnPreMatchingFilterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); setProperty(Property.REQUEST_HEADERS, @@ -99,6 +137,7 @@ * @test_Strategy: When a filter or interceptor method throws an exception, * the JAX-RS runtime will attempt to map the exception */ + @Test public void throwExceptionOnInterceptorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); setProperty(Property.REQUEST_HEADERS, @@ -116,6 +155,7 @@ * * @test_Strategy: Just to be sure we have only one global binding interceptor */ + @Test public void noNameBoundInterceptorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "nobinding")); setProperty(Property.CONTENT, "0"); @@ -135,6 +175,7 @@ * At most one exception mapper will be used in a single request processing * cycle to avoid potentially infinite loops. */ + @Test public void throwSecondExceptionFromMapperFirstFromInterceptorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); @@ -159,6 +200,7 @@ * At most one exception mapper will be used in a single request processing * cycle to avoid potentially infinite loops. */ + @Test public void throwSecondExceptionFromMapperFirstFromPreMatchingFilterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); @@ -183,6 +225,7 @@ * At most one exception mapper will be used in a single request processing * cycle to avoid potentially infinite loops. */ + @Test public void throwSecondExceptionFromMapperFirstFromPostMatchingFilterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); @@ -207,6 +250,7 @@ * At most one exception mapper will be used in a single request processing * cycle to avoid potentially infinite loops. */ + @Test public void throwSecondExceptionFromInterceptorFirstFromInterceptorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); @@ -232,6 +276,7 @@ * At most one exception mapper will be used in a single request processing * cycle to avoid potentially infinite loops. */ + @Test public void throwSecondExceptionFromInterceptorFirstFromPreMatchingFilterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); @@ -257,6 +302,7 @@ * At most one exception mapper will be used in a single request processing * cycle to avoid potentially infinite loops. */ + @Test public void throwSecondExceptionFromInterceptorFirstFromPostMatchingFilterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); @@ -281,6 +327,7 @@ * At most one exception mapper will be used in a single request processing * cycle to avoid potentially infinite loops. */ + @Test public void throwNoExceptionFromPostMatchingFilterFirstFromInterceptorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); @@ -307,6 +354,7 @@ * * The request filter is not used on response from mapper */ + @Test public void throwNoExceptionFromPostMatchingFilterFirstFromPostMatchingFilterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); @@ -333,6 +381,7 @@ * * The request filter is not used on response from mapper */ + @Test public void throwNoExceptionFromPostMatchingFilterFirstFromPreMatchingFilterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo"));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/NeverUsedExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/NeverUsedExceptionMapper.java index 4edb425..0a2ebab 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/NeverUsedExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/NeverUsedExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/PostMatchingThrowingFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/PostMatchingThrowingFilter.java index 4e191a3..36309f3 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/PostMatchingThrowingFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/PostMatchingThrowingFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/PreMatchingThrowingFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/PreMatchingThrowingFilter.java index 5de8e94..35fe3bb 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/PreMatchingThrowingFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/PreMatchingThrowingFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/Resource.java index ab85616..2f5c5da 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/RuntimeExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/RuntimeExceptionMapper.java index cf29654..6125336 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/RuntimeExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/RuntimeExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/TSAppConfig.java index 2c24ace..98e37cd 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/exception/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.exception; +package jakarta.ws.rs.tck.spec.filter.exception; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AbstractAddFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AbstractAddFilter.java index 8d8871e..24c3c4d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AbstractAddFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AbstractAddFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.globalbinding; +package jakarta.ws.rs.tck.spec.filter.globalbinding; import java.io.IOException; import java.lang.annotation.Annotation;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AbstractAddInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AbstractAddInterceptor.java index 49f25b5..f27b0b5 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AbstractAddInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AbstractAddInterceptor.java
@@ -14,13 +14,13 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.globalbinding; +package jakarta.ws.rs.tck.spec.filter.globalbinding; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import com.sun.ts.tests.jaxrs.common.util.JaxrsUtil; +import jakarta.ws.rs.tck.common.util.JaxrsUtil; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.ext.ReaderInterceptor;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AddOneInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AddOneInterceptor.java index 3cb049c..8366d00 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AddOneInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AddOneInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.globalbinding; +package jakarta.ws.rs.tck.spec.filter.globalbinding; import jakarta.ws.rs.ext.Provider;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AddTenFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AddTenFilter.java index 03de42b..c1e384f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AddTenFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/AddTenFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.globalbinding; +package jakarta.ws.rs.tck.spec.filter.globalbinding; import jakarta.ws.rs.ext.Provider;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/GlobalNameBinding.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/GlobalNameBinding.java index 4087e7b..848a50c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/GlobalNameBinding.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/GlobalNameBinding.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.globalbinding; +package jakarta.ws.rs.tck.spec.filter.globalbinding; import java.lang.annotation.ElementType; import java.lang.annotation.Retention;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/JAXRSClient.java index fa9947e..e08198f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/JAXRSClient.java
@@ -14,23 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.globalbinding; +package jakarta.ws.rs.tck.spec.filter.globalbinding; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; + +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ /** * Test the interceptor is called when any entity provider is called */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = -3785330089447087404L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_filter_globalbinding_web/resource"); } @@ -43,6 +59,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/filter/globalbinding/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_filter_globalbinding_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, AbstractAddFilter.class, AbstractAddInterceptor.class, AddOneInterceptor.class, AddTenFilter.class, GlobalNameBinding.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* @@ -54,6 +91,7 @@ * annotation, the application subclass must be annotated as shown above in * order for those filters or interceptors to be globally bound */ + @Test public void nameBoundResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "bind")); setProperty(Property.CONTENT, "0"); @@ -71,6 +109,7 @@ * annotation, the application subclass must be annotated as shown above in * order for those filters or interceptors to be globally bound */ + @Test public void globalBoundResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "nobind")); setProperty(Property.CONTENT, "0");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/Resource.java index 1ed553c..4da9b38 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.globalbinding; +package jakarta.ws.rs.tck.spec.filter.globalbinding; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/TSAppConfig.java index f237025..3df8b6e 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/globalbinding/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.globalbinding; +package jakarta.ws.rs.tck.spec.filter.globalbinding; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/EntityReaderInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/EntityReaderInterceptor.java index 5e088f2..61b560e 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/EntityReaderInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/EntityReaderInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.interceptor; +package jakarta.ws.rs.tck.spec.filter.interceptor; import java.io.ByteArrayInputStream; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/EntityWriterInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/EntityWriterInterceptor.java index e0bcff8..eca196f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/EntityWriterInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/EntityWriterInterceptor.java
@@ -14,11 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.interceptor; +package jakarta.ws.rs.tck.spec.filter.interceptor; import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.impl.ReplacingOutputStream; +import jakarta.ws.rs.tck.common.impl.ReplacingOutputStream; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.MultivaluedMap;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/JAXRSClient.java index 8eb69b0..7a912f8 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/JAXRSClient.java
@@ -14,20 +14,21 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.interceptor; +package jakarta.ws.rs.tck.spec.filter.interceptor; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; +import java.io.InputStream; import javax.xml.namespace.QName; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; -import com.sun.ts.tests.jaxrs.common.impl.StringDataSource; -import com.sun.ts.tests.jaxrs.common.provider.StringBean; -import com.sun.ts.tests.jaxrs.common.provider.StringBeanEntityProvider; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.impl.StringDataSource; +import jakarta.ws.rs.tck.common.provider.StringBean; +import jakarta.ws.rs.tck.common.provider.StringBeanEntityProvider; import jakarta.ws.rs.core.GenericEntity; import jakarta.ws.rs.core.MediaType; @@ -35,15 +36,27 @@ import jakarta.xml.bind.JAXBElement; import jakarta.xml.bind.JAXBException; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ /** * Test the interceptor is called when any entity provider is called */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 3841348335979312551L; @@ -65,7 +78,8 @@ } } - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_filter_interceptor_web/resource"); } @@ -78,6 +92,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/filter/interceptor/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_filter_interceptor_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, EntityReaderInterceptor.class, EntityWriterInterceptor.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /*
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/Resource.java index f83ba5b..eb097bb 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.interceptor; +package jakarta.ws.rs.tck.spec.filter.interceptor; import java.io.ByteArrayInputStream; import java.io.File; @@ -28,11 +28,11 @@ import javax.xml.namespace.QName; import javax.xml.transform.Source; -import com.sun.ts.tests.jaxrs.common.impl.StringDataSource; -import com.sun.ts.tests.jaxrs.common.impl.StringSource; -import com.sun.ts.tests.jaxrs.common.impl.StringStreamingOutput; -import com.sun.ts.tests.jaxrs.common.provider.StringBean; -import com.sun.ts.tests.jaxrs.common.util.JaxrsUtil; +import jakarta.ws.rs.tck.common.impl.StringDataSource; +import jakarta.ws.rs.tck.common.impl.StringSource; +import jakarta.ws.rs.tck.common.impl.StringStreamingOutput; +import jakarta.ws.rs.tck.common.provider.StringBean; +import jakarta.ws.rs.tck.common.util.JaxrsUtil; import jakarta.activation.DataSource; import jakarta.ws.rs.Consumes;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/TSAppConfig.java index 6f6165e..3cea12a 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/interceptor/TSAppConfig.java
@@ -14,12 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.interceptor; +package jakarta.ws.rs.tck.spec.filter.interceptor; import java.util.HashSet; import java.util.Set; -import com.sun.ts.tests.jaxrs.common.provider.StringBeanEntityProvider; +import jakarta.ws.rs.tck.common.provider.StringBeanEntityProvider; import jakarta.ws.rs.core.Application;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/ArrayListEntityProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/ArrayListEntityProvider.java index 64e80e8..b9b8342 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/ArrayListEntityProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/ArrayListEntityProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.io.IOException; import java.io.InputStream; @@ -23,7 +23,7 @@ import java.lang.reflect.Type; import java.util.ArrayList; -import com.sun.ts.tests.jaxrs.common.util.JaxrsUtil; +import jakarta.ws.rs.tck.common.util.JaxrsUtil; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.MediaType;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/FirstReaderInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/FirstReaderInterceptor.java index 406805d..359ca79 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/FirstReaderInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/FirstReaderInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.io.ByteArrayInputStream; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/FirstWriterInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/FirstWriterInterceptor.java index e37f92a..691043f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/FirstWriterInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/FirstWriterInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.io.IOException; import java.util.LinkedList;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/JAXRSClient.java index b89db07..3c69240 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/JAXRSClient.java
@@ -14,31 +14,46 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.util.ArrayList; import java.util.List; +import java.io.InputStream; +import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ /** * Test the interceptor is called when any entity provider is called */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1405911734696409993L; public static final String plaincontent = JAXRSClient.class.getName(); - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_filter_lastvalue_web/resource"); } @@ -51,6 +66,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/filter/lastvalue/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_filter_lastvalue_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, ArrayListEntityProvider.class, FirstReaderInterceptor.class, FirstWriterInterceptor.class, LinkedListEntityProvider.class, SecondReaderInterceptor.class, SecondWriterInterceptor.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* @@ -62,6 +98,7 @@ * set in the context object when calling the wrapped methods * MessageBodyReader.readFrom and MessageBodyWrite.writeTo. */ + @Test public void readerContextOnContainerTest() throws Fault { addInterceptors(FirstReaderInterceptor.class); setProperty(Property.REQUEST, buildRequest(Request.POST, "postlist")); @@ -85,6 +122,7 @@ * set in the context object when calling the wrapped methods * MessageBodyReader.readFrom and MessageBodyWrite.writeTo. */ + @Test public void readerContextOnClientTest() throws Fault { addProvider(FirstReaderInterceptor.class); addProvider(SecondReaderInterceptor.class); @@ -121,6 +159,7 @@ * set in the context object when calling the wrapped methods * MessageBodyReader.readFrom and MessageBodyWrite.writeTo. */ + @Test public void writerContextOnContainerTest() throws Fault { addInterceptors(FirstWriterInterceptor.class); setProperty(Property.REQUEST, buildRequest(Request.GET, "getlist")); @@ -143,6 +182,7 @@ * set in the context object when calling the wrapped methods * MessageBodyReader.readFrom and MessageBodyWrite.writeTo. */ + @Test public void writerContextOnClientTest() throws Fault { addProvider(FirstReaderInterceptor.class); addProvider(SecondReaderInterceptor.class);
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/LinkedListEntityProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/LinkedListEntityProvider.java index 04020db..3a2fbad 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/LinkedListEntityProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/LinkedListEntityProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/Resource.java index 0c3b75a..57a29cc 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.util.ArrayList; import java.util.List;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/SecondReaderInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/SecondReaderInterceptor.java index a2e17f5..1c67aea 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/SecondReaderInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/SecondReaderInterceptor.java
@@ -14,13 +14,13 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; -import com.sun.ts.tests.jaxrs.spec.filter.interceptor.Resource; +import jakarta.ws.rs.tck.spec.filter.interceptor.Resource; import jakarta.annotation.Priority; import jakarta.ws.rs.WebApplicationException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/SecondWriterInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/SecondWriterInterceptor.java index 586f2c7..b0b08f0 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/SecondWriterInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/SecondWriterInterceptor.java
@@ -14,12 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.io.IOException; import java.util.ArrayList; -import com.sun.ts.tests.jaxrs.spec.filter.interceptor.Resource; +import jakarta.ws.rs.tck.spec.filter.interceptor.Resource; import jakarta.annotation.Priority; import jakarta.ws.rs.WebApplicationException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/TSAppConfig.java index da99518..b23c66f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/lastvalue/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.lastvalue; +package jakarta.ws.rs.tck.spec.filter.lastvalue; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AbstractAddInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AbstractAddInterceptor.java index 469d8ad..27fff8c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AbstractAddInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AbstractAddInterceptor.java
@@ -14,13 +14,13 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import com.sun.ts.tests.jaxrs.common.util.JaxrsUtil; +import jakarta.ws.rs.tck.common.util.JaxrsUtil; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.ext.ReaderInterceptor;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AddOneInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AddOneInterceptor.java index 3572679..83b1186 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AddOneInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AddOneInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; import jakarta.ws.rs.ext.Provider;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AddTenInterceptor.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AddTenInterceptor.java index 3bce922..ce6be56 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AddTenInterceptor.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AddTenInterceptor.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; import jakarta.ws.rs.ext.Provider;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AllMethodBindingResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AllMethodBindingResource.java index 83291df..d894159 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AllMethodBindingResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/AllMethodBindingResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/ComplementNameBinding.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/ComplementNameBinding.java index c9ff4a8..830351b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/ComplementNameBinding.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/ComplementNameBinding.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; import java.lang.annotation.ElementType; import java.lang.annotation.Retention;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/JAXRSClient.java index 0602921..92dd22b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/JAXRSClient.java
@@ -14,23 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; + +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ /** * Test the interceptor is called when any entity provider is called */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = -1559382208933998735L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_filter_namebinding_web/resource"); } @@ -43,6 +59,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/filter/namebinding/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_filter_namebinding_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, AbstractAddInterceptor.class, AddOneInterceptor.class, AddTenInterceptor.class, AllMethodBindingResource.class, ComplementNameBinding.class, SingleNameBinding.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* @@ -60,6 +97,7 @@ * getSingletons in an application subclass will bind them globally only if * they are not decorated with a name binding annotation. */ + @Test public void noInterceptorBoundTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "one")); setProperty(Property.SEARCH_STRING, "1"); @@ -82,6 +120,7 @@ * getSingletons in an application subclass will bind them globally only if * they are not decorated with a name binding annotation. */ + @Test public void singleInterceptorBoundTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "ten")); setProperty(Property.SEARCH_STRING, "11"); @@ -104,6 +143,7 @@ * getSingletons in an application subclass will bind them globally only if * they are not decorated with a name binding annotation. */ + @Test public void onlyPartOfUnionOfInterceptorsBoundTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "complement")); setProperty(Property.SEARCH_STRING, "10000"); @@ -126,6 +166,7 @@ * getSingletons in an application subclass will bind them globally only if * they are not decorated with a name binding annotation. */ + @Test public void readerWriterInterceptorBoundTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "echo")); setRequestContentEntity("1111"); @@ -153,6 +194,7 @@ * getSingletons in an application subclass will bind them globally only if * they are not decorated with a name binding annotation. */ + @Test public void resourceAnnotatedFirstMethodInterceptedTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "all/hundred")); setProperty(Property.SEARCH_STRING, "101"); @@ -179,6 +221,7 @@ * getSingletons in an application subclass will bind them globally only if * they are not decorated with a name binding annotation. */ + @Test public void resourceAnnotatedSecondMethodInterceptedTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "all/thousand")); setProperty(Property.SEARCH_STRING, "1011");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/Resource.java index 1c367e1..879419a 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/SingleNameBinding.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/SingleNameBinding.java index 74bf1a5..946187e 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/SingleNameBinding.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/SingleNameBinding.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; import java.lang.annotation.ElementType; import java.lang.annotation.Retention;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/TSAppConfig.java index c44ea61..552d414 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/filter/namebinding/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.filter.namebinding; +package jakarta.ws.rs.tck.spec.filter.namebinding; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ChildResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ChildResource.java index cff8b44..e67c6ea 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ChildResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ChildResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.inheritance; +package jakarta.ws.rs.tck.spec.inheritance; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ChildResource1.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ChildResource1.java index 17a5b25..f06e5c0 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ChildResource1.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ChildResource1.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.inheritance; +package jakarta.ws.rs.tck.spec.inheritance; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/JAXRSClient.java index 1cfe134..0086c50 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/JAXRSClient.java
@@ -14,17 +14,35 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.inheritance; +package jakarta.ws.rs.tck.spec.inheritance; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; -public class JAXRSClient extends JAXRSCommonClient { +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 4535321107880833833L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_inheritance_web"); } @@ -37,6 +55,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/inheritance/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_inheritance_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, ChildResource.class, ChildResource1.class, ParentResource.class, ParentResource1.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* * @class.setup_props: webServerHost; webServerPort; ts_home; */ @@ -49,6 +88,7 @@ * @test_Strategy: Client sends a request on a resource at /InheritanceTest, * Verify that inheritance works. */ + @Test public void test1() throws Fault { setProperty(REQUEST_HEADERS, buildAccept(MediaType.TEXT_PLAIN_TYPE)); setProperty(REQUEST, buildRequest(Request.GET, "InheritanceTest")); @@ -64,6 +104,7 @@ * @test_Strategy: Client sends a request on a resource at /InheritanceTest1, * Verify that inheritance works. */ + @Test public void test2() throws Fault { setProperty(REQUEST_HEADERS, buildAccept(MediaType.TEXT_HTML_TYPE)); setProperty(REQUEST, buildRequest(Request.GET, "InheritanceTest1"));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ParentResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ParentResource.java index ce79199..a08b596 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ParentResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ParentResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.inheritance; +package jakarta.ws.rs.tck.spec.inheritance; import jakarta.ws.rs.GET; import jakarta.ws.rs.Produces;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ParentResource1.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ParentResource1.java index 0ea4c35..9e8a987 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ParentResource1.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/ParentResource1.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.inheritance; +package jakarta.ws.rs.tck.spec.inheritance; import jakarta.ws.rs.GET; import jakarta.ws.rs.Produces;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/TSAppConfig.java index 42b29c1..7f356fc 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/inheritance/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.inheritance; +package jakarta.ws.rs.tck.spec.inheritance; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ClientErrorExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ClientErrorExceptionMapper.java index 282d839..5c8294b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ClientErrorExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ClientErrorExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import jakarta.ws.rs.ClientErrorException; import jakarta.ws.rs.core.Response;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ExceptionFromMappedException.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ExceptionFromMappedException.java index 5646691..1d447f5 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ExceptionFromMappedException.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ExceptionFromMappedException.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; /** * This Exception is meant to be thrown from a Resource, caught by designated
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ExceptionFromMappedExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ExceptionFromMappedExceptionMapper.java index b7fa49b..7a68104 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ExceptionFromMappedExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ExceptionFromMappedExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/FilterChainTestException.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/FilterChainTestException.java index 8590939..0d29267 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/FilterChainTestException.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/FilterChainTestException.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; public class FilterChainTestException extends RuntimeException {
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/FilterChainTestExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/FilterChainTestExceptionMapper.java index adf5322..9bf21a0 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/FilterChainTestExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/FilterChainTestExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/JAXRSClient.java index 03a34e8..0e436a5 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/JAXRSClient.java
@@ -14,23 +14,40 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.Response.Status; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = -8228843141906281907L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_exceptionmapper_web/resource"); } @@ -43,6 +60,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/exceptionmapper/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_exceptionmapper_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, ClientErrorExceptionMapper.class, ExceptionFromMappedException.class, ExceptionFromMappedExceptionMapper.class, FilterChainTestException.class, FilterChainTestExceptionMapper.class, PlainExceptionMapper.class, ResponseFilter.class, RuntimeExceptionMapper.class, ThrowableMapper.class, WebAppExceptionMapper.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: throwableTest @@ -53,6 +91,7 @@ * exception, an implementation MUST use the provider whose generic type is * the nearest superclass of the exception. */ + @Test public void throwableTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "throwable")); setProperty(Property.SEARCH_STRING, ThrowableMapper.class.getName()); @@ -68,6 +107,7 @@ * exception, an implementation MUST use the provider whose generic type is * the nearest superclass of the exception. */ + @Test public void exceptionTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "exception")); setProperty(Property.SEARCH_STRING, PlainExceptionMapper.class.getName()); @@ -83,6 +123,7 @@ * exception, an implementation MUST use the provider whose generic type is * the nearest superclass of the exception. */ + @Test public void runtimeExceptionTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "runtime")); setProperty(Property.SEARCH_STRING, RuntimeExceptionMapper.class.getName()); @@ -98,6 +139,7 @@ * exception, an implementation MUST use the provider whose generic type is * the nearest superclass of the exception. */ + @Test public void webapplicationExceptionTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "webapp")); setProperty(Property.SEARCH_STRING, WebAppExceptionMapper.class.getName()); @@ -113,6 +155,7 @@ * exception, an implementation MUST use the provider whose generic type is * the nearest superclass of the exception. */ + @Test public void clientErrorExceptionTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "clienterror")); setProperty(Property.SEARCH_STRING, @@ -132,6 +175,7 @@ * Section 3.3.3. In particular, a mapped Response MUST be processed using the * ContainerResponse filter chain defined in Chapter 6. */ + @Test public void filterChainTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "chain")); setProperty(Property.SEARCH_STRING, ResponseFilter.class.getName());
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/PlainExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/PlainExceptionMapper.java index e24d7b1..a193a00 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/PlainExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/PlainExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.Provider;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/Resource.java index ad086e4..9b81c42 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import jakarta.ws.rs.ClientErrorException; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ResponseFilter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ResponseFilter.java index 9e0dda0..552d940 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ResponseFilter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ResponseFilter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import java.io.IOException; import java.lang.annotation.Annotation;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/RuntimeExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/RuntimeExceptionMapper.java index a02fac1..0c8547f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/RuntimeExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/RuntimeExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/TSAppConfig.java index 772cb1c..706872d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ThrowableMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ThrowableMapper.java index 970af5f..7a38ad3 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ThrowableMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/ThrowableMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/WebAppExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/WebAppExceptionMapper.java index 4a2bd35..12cd242 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/WebAppExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/exceptionmapper/WebAppExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper; +package jakarta.ws.rs.tck.spec.provider.exceptionmapper; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/JAXRSClient.java index be7737c..a4612ae 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/JAXRSClient.java
@@ -14,23 +14,40 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext; +package jakarta.ws.rs.tck.spec.provider.jaxbcontext; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_jaxbcontext_web/resource"); } @@ -53,6 +70,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/jaxbcontext/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_jaxbcontext_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, JaxbContextProvider.class, SomeJaxbContext.class, SomeMarshaller.class, SomeUnmarshaller.class, TckJaxbProvider.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: readWriteProviderTest @@ -64,6 +102,7 @@ * JAXBContext instances provided by application-supplied context resolvers, * see Section 4.3. */ + @Test public void readWriteProviderTest() throws Fault { setPropertyAndInvoke("jaxb"); }
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/JaxbContextProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/JaxbContextProvider.java index ce56caf..b9d149c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/JaxbContextProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/JaxbContextProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext; +package jakarta.ws.rs.tck.spec.provider.jaxbcontext; import jakarta.ws.rs.ext.ContextResolver; import jakarta.ws.rs.ext.Provider;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/Resource.java index 7ed6f5d..87ad870 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext; +package jakarta.ws.rs.tck.spec.provider.jaxbcontext; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeJaxbContext.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeJaxbContext.java index 365770a..f9d2db0 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeJaxbContext.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeJaxbContext.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext; +package jakarta.ws.rs.tck.spec.provider.jaxbcontext; import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeMarshaller.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeMarshaller.java index b9fb1ea..2e724d7 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeMarshaller.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeMarshaller.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext; +package jakarta.ws.rs.tck.spec.provider.jaxbcontext; import java.io.File; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeUnmarshaller.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeUnmarshaller.java index d2ffacb..3389780 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeUnmarshaller.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/SomeUnmarshaller.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext; +package jakarta.ws.rs.tck.spec.provider.jaxbcontext; import java.io.BufferedReader; import java.io.File;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/TSAppConfig.java index 959608e..c030763 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext; +package jakarta.ws.rs.tck.spec.provider.jaxbcontext; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/TckJaxbProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/TckJaxbProvider.java index ed357ed..06b6adf 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/TckJaxbProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/jaxbcontext/TckJaxbProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext; +package jakarta.ws.rs.tck.spec.provider.jaxbcontext; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/AbstractProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/AbstractProvider.java index 8ac5f43..36602d8 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/AbstractProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/AbstractProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; public abstract class AbstractProvider { public long getLength() {
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/JAXRSClient.java index 075da10..2795208 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/JAXRSClient.java
@@ -14,25 +14,41 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.util.zip.Deflater; +import java.io.InputStream; +import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_overridestandard_web/resource"); } @@ -77,6 +93,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/overridestandard/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_overridestandard_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, AbstractProvider.class, TckBooleanProvider.class, TckByteArrayProvider.class, TckCharacterProvider.class, TckDataSourceProvider.class, TckDataSourceProvider.class, TckFileProvider.class, TckInputStreamProvider.class, TckJaxbProvider.class, TckMapProvider.class, TckNumberProvider.class, TckReaderProvider.class, TckSourceProvider.class, TckStreamingOutputProvider.class, TckStringProvider.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: readWriteByteArrayProviderTest @@ -88,6 +125,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteByteArrayProviderTest() throws Fault { setPropertyAndInvoke("bytearray", MediaType.APPLICATION_XML_TYPE); } @@ -102,6 +140,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteStringProviderTest() throws Fault { setPropertyAndInvoke("string", MediaType.APPLICATION_XML_TYPE); } @@ -116,6 +155,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteInputStreamProviderTest() throws Fault { setPropertyAndInvoke("inputstream", MediaType.APPLICATION_XML_TYPE); } @@ -130,6 +170,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteReaderProviderTest() throws Fault { setPropertyAndInvoke("reader", MediaType.APPLICATION_XML_TYPE); } @@ -144,6 +185,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteFileProviderTest() throws Fault { setPropertyAndInvoke("file", MediaType.APPLICATION_XML_TYPE); } @@ -158,6 +200,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteDataSourceProviderTest() throws Fault { setPropertyAndInvoke("datasource", MediaType.APPLICATION_XML_TYPE); } @@ -172,6 +215,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteSourceProviderTest() throws Fault { setPropertyAndInvoke("source", MediaType.APPLICATION_XML_TYPE); } @@ -186,6 +230,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteJaxbProviderTest() throws Fault { setPropertyAndInvoke("jaxb", MediaType.APPLICATION_XML_TYPE); } @@ -200,6 +245,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteStreamingOutputProviderTest() throws Fault { setPropertyAndInvoke("streamingoutput", MediaType.APPLICATION_XML_TYPE); } @@ -214,6 +260,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteMapProviderTest() throws Fault { setPropertyAndInvoke("map", MediaType.APPLICATION_FORM_URLENCODED_TYPE); } @@ -228,6 +275,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteBooleanProviderTest() throws Fault { MediaType mt = MediaType.TEXT_PLAIN_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, "boolean")); @@ -248,6 +296,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteCharacterProviderTest() throws Fault { MediaType mt = MediaType.TEXT_PLAIN_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, "character")); @@ -268,6 +317,7 @@ * providers when either could handle the same request. * */ + @Test public void readWriteIntegerProviderTest() throws Fault { MediaType mt = MediaType.TEXT_PLAIN_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, "number"));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/Resource.java index 7da1bf4..93630dc 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.File; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TSAppConfig.java index 69b8c7a..e6ce066 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckBooleanProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckBooleanProvider.java index cc26449..97bdb7d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckBooleanProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckBooleanProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckByteArrayProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckByteArrayProvider.java index 306d453..6f142f3 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckByteArrayProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckByteArrayProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckCharacterProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckCharacterProvider.java index f18f2dd..7bb056b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckCharacterProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckCharacterProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckDataSourceProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckDataSourceProvider.java index 5ab416c..95b5e05 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckDataSourceProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckDataSourceProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckFileProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckFileProvider.java index 7801899..87dcd83 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckFileProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckFileProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.BufferedReader; import java.io.File;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckInputStreamProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckInputStreamProvider.java index f438e70..162af5b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckInputStreamProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckInputStreamProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.BufferedReader; import java.io.ByteArrayInputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckJaxbProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckJaxbProvider.java index 7555d6b..70cfc77 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckJaxbProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckJaxbProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckMapProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckMapProvider.java index 0dd0656..d3f1219 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckMapProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckMapProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckNumberProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckNumberProvider.java index 1388510..84c0910 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckNumberProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckNumberProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckReaderProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckReaderProvider.java index ad4f78d..f2277a4 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckReaderProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckReaderProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.BufferedReader; import java.io.ByteArrayInputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckSourceProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckSourceProvider.java index 7baa886..d72063f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckSourceProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckSourceProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckStreamingOutputProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckStreamingOutputProvider.java index ee07070..3b1b3ad 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckStreamingOutputProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckStreamingOutputProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream; @@ -22,7 +22,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import com.sun.ts.tests.jaxrs.common.impl.StringStreamingOutput; +import jakarta.ws.rs.tck.common.impl.StringStreamingOutput; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.MediaType;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckStringProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckStringProvider.java index fb6c531..d7edd0b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckStringProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/overridestandard/TckStringProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.overridestandard; +package jakarta.ws.rs.tck.spec.provider.overridestandard; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AbstractReader.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AbstractReader.java index 6f75939..e0d3d03 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AbstractReader.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AbstractReader.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.reader; +package jakarta.ws.rs.tck.spec.provider.reader; import java.io.BufferedReader; import java.io.IOException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AppJavaReader.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AppJavaReader.java index eb50d9f..cd511a3 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AppJavaReader.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AppJavaReader.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.reader; +package jakarta.ws.rs.tck.spec.provider.reader; import java.lang.annotation.Annotation; import java.lang.reflect.Type;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AppOctetReader.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AppOctetReader.java index 4309b36..204c3e7 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AppOctetReader.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/AppOctetReader.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.reader; +package jakarta.ws.rs.tck.spec.provider.reader; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/EntityForReader.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/EntityForReader.java index 13539ce..a09f075 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/EntityForReader.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/EntityForReader.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.reader; +package jakarta.ws.rs.tck.spec.provider.reader; public class EntityForReader { private String value;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/JAXRSClient.java index 41339a8..1aa0768 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/JAXRSClient.java
@@ -14,24 +14,41 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.reader; +package jakarta.ws.rs.tck.spec.provider.reader; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response.Status; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_reader_web/resource"); } @@ -44,6 +61,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/reader/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_reader_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, AbstractReader.class, AppJavaReader.class, AppOctetReader.class, EntityForReader.class, WildCardReader.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: noEntityProviderTest @@ -53,6 +91,7 @@ * @test_Strategy: An implementation MUST NOT use an entity provider for a * media type that is not supported by that provider. */ + @Test public void noEntityProviderTest() throws Fault { enableAppJava(false); String ct = buildContentType(AbstractReader.NO_PROVIDER_MEDIATYPE); @@ -72,6 +111,7 @@ * @test_Strategy: Obtain the media type of the request. If the request does * not contain a Content-Type header then use application/octet-stream */ + @Test public void meadiaTypeContentTypeTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "plain")); setProperty(Property.REQUEST_HEADERS, @@ -90,6 +130,7 @@ * @test_Strategy: Obtain the media type of the request. If the request does * not contain a Content-Type header then use application/octet-stream */ + @Test public void meadiaTypeDefaultTest() throws Fault { enableAppJava(false); setProperty(Property.REQUEST, buildRequest(Request.POST, "plain")); @@ -108,6 +149,7 @@ * * @test_Strategy: */ + @Test public void iterateAllAppJavaReadersTest() throws Fault { enableAppJava(false); MediaType mt = new MediaType("application", "java"); @@ -131,6 +173,7 @@ * * @test_Strategy: */ + @Test public void iterateFirstAppJavaReaderTest() throws Fault { enableAppJava(true); MediaType mt = new MediaType("application", "java");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/Resource.java index 40f29eb..3b2e73b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.reader; +package jakarta.ws.rs.tck.spec.provider.reader; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/TSAppConfig.java index 5bd0817..649882c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.reader; +package jakarta.ws.rs.tck.spec.provider.reader; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/WildCardReader.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/WildCardReader.java index 9b3f291..36cee13 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/WildCardReader.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/reader/WildCardReader.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.reader; +package jakarta.ws.rs.tck.spec.provider.reader; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/JAXRSClient.java index 5a0b303..8937f98 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/JAXRSClient.java
@@ -14,23 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.sort; +package jakarta.ws.rs.tck.spec.provider.sort; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = -8228843141906281907L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_sort_web/resource"); } @@ -43,6 +59,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/sort/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_sort_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, TextPlainStringBeanEntityProvider.class, TextWildCardStringBeanEntityProvider.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: contentTypeApplicationGotWildCardTest @@ -56,6 +93,7 @@ * * Unexpected providers add "text/" to content */ + @Test public void contentTypeApplicationGotWildCardTest() throws Fault { MediaType type = new MediaType("application", "plain"); setProperty(Property.REQUEST, buildRequest(Request.POST, "")); @@ -81,6 +119,7 @@ *//* * . */ + @Test public void contentTypeTextHmtlGotTextWildCardTest() throws Fault { MediaType type = MediaType.TEXT_HTML_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, "")); @@ -106,6 +145,7 @@ *//* * . */ + @Test public void contentTypeTextXmlGotTextWildCardTest() throws Fault { MediaType type = MediaType.TEXT_XML_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, "")); @@ -131,6 +171,7 @@ *//* * . */ + @Test public void contentTypeTextPlainGotTextPlainTest() throws Fault { MediaType type = MediaType.TEXT_PLAIN_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, ""));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/Resource.java index 429ce96..ec79908 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/Resource.java
@@ -14,9 +14,9 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.sort; +package jakarta.ws.rs.tck.spec.provider.sort; -import com.sun.ts.tests.jaxrs.common.provider.StringBean; +import jakarta.ws.rs.tck.common.provider.StringBean; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TSAppConfig.java index 9cc013e..dd8ef61 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TSAppConfig.java
@@ -14,12 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.sort; +package jakarta.ws.rs.tck.spec.provider.sort; import java.util.HashSet; import java.util.Set; -import com.sun.ts.tests.jaxrs.common.provider.StringBeanEntityProvider; +import jakarta.ws.rs.tck.common.provider.StringBeanEntityProvider; import jakarta.ws.rs.core.Application;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TextPlainStringBeanEntityProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TextPlainStringBeanEntityProvider.java index 29e277f..d018cf6 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TextPlainStringBeanEntityProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TextPlainStringBeanEntityProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.sort; +package jakarta.ws.rs.tck.spec.provider.sort; import java.io.IOException; import java.io.InputStream; @@ -22,8 +22,8 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import com.sun.ts.tests.jaxrs.common.provider.StringBean; -import com.sun.ts.tests.jaxrs.common.provider.StringBeanEntityProvider; +import jakarta.ws.rs.tck.common.provider.StringBean; +import jakarta.ws.rs.tck.common.provider.StringBeanEntityProvider; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.Produces;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TextWildCardStringBeanEntityProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TextWildCardStringBeanEntityProvider.java index 45a6fb9..2e6e563 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TextWildCardStringBeanEntityProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/sort/TextWildCardStringBeanEntityProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.sort; +package jakarta.ws.rs.tck.spec.provider.sort; import java.io.IOException; import java.io.InputStream; @@ -22,8 +22,8 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import com.sun.ts.tests.jaxrs.common.provider.StringBean; -import com.sun.ts.tests.jaxrs.common.provider.StringBeanEntityProvider; +import jakarta.ws.rs.tck.common.provider.StringBean; +import jakarta.ws.rs.tck.common.provider.StringBeanEntityProvider; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.Produces;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/JAXRSClient.java index 7e07139..05c4cca 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/JAXRSClient.java
@@ -14,7 +14,10 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standard; +package jakarta.ws.rs.tck.spec.provider.standard; + +import java.io.InputStream; +import java.io.IOException; import java.lang.reflect.Array; import java.lang.reflect.Field; @@ -22,21 +25,34 @@ import java.util.LinkedList; import java.util.List; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_standard_web/resource"); } @@ -123,6 +139,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/standard/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_standard_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + String[] methodsAll = { "bytearray", "string", "inputstream", "file", "datasource", "streamingoutput" }; @@ -138,6 +175,7 @@ * Java and media type combinations * */ + @Test public void byteArrayProviderTest() throws Fault { for (MediaType media : getMediaTypes(MediaType.class)) setEntityAndPropertyAndInvoke(methodsAll[0], media); // All media @@ -154,6 +192,7 @@ * Java and media type combinations * */ + @Test public void stringProviderTest() throws Fault { for (MediaType media : getMediaTypes(MediaType.class)) setEntityAndPropertyAndInvoke(methodsAll[1], media); // All media @@ -170,6 +209,7 @@ * Java and media type combinations * */ + @Test public void inputStreamProviderTest() throws Fault { for (MediaType media : getMediaTypes(MediaType.class)) setEntityAndPropertyAndInvoke(methodsAll[2], media); // All media @@ -189,6 +229,7 @@ * * JIRA:1078 */ + @Test public void readerProviderTest() throws Fault { for (MediaType media : getMediaTypes(MediaType.class)) setEntityAndPropertyAndInvoke("reader", media); @@ -205,6 +246,7 @@ * Java and media type combinations * */ + @Test public void fileProviderTest() throws Fault { for (MediaType media : getMediaTypes(MediaType.class)) setEntityAndPropertyAndInvoke(methodsAll[3], media); // All media @@ -221,6 +263,7 @@ * Java and media type combinations * */ + @Test public void dataSourceProviderTest() throws Fault { for (MediaType media : getMediaTypes(MediaType.class)) setEntityAndPropertyAndInvoke(methodsAll[4], media); // All media @@ -240,6 +283,7 @@ * application/*+xml) * */ + @Test public void sourceProviderTest() throws Fault { setPropertyAndInvokeXml("source"); } @@ -254,6 +298,7 @@ * Java and media type combinations * */ + @Test public void streamingOutputProviderTest() throws Fault { for (MediaType media : getMediaTypes(MediaType.class)) setEntityAndPropertyAndInvoke(methodsAll[5], media); // All media
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/Resource.java index 232acf6..b626bbb 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standard; +package jakarta.ws.rs.tck.spec.provider.standard; import java.io.File; import java.io.InputStream; @@ -22,7 +22,7 @@ import javax.xml.transform.Source; -import com.sun.ts.tests.jaxrs.common.impl.StringStreamingOutput; +import jakarta.ws.rs.tck.common.impl.StringStreamingOutput; import jakarta.activation.DataSource; import jakarta.ws.rs.Consumes;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/TSAppConfig.java index 1c8456a..a0763c0 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standard/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standard; +package jakarta.ws.rs.tck.spec.provider.standard; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/AbstractProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/AbstractProvider.java index 81ddc38..3d6b950 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/AbstractProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/AbstractProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; public abstract class AbstractProvider { public long getLength() {
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/JAXRSClient.java index a21eeb4..8747a4d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/JAXRSClient.java
@@ -14,28 +14,43 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import javax.xml.namespace.QName; +import java.io.InputStream; +import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MultivaluedHashMap; import jakarta.ws.rs.core.MultivaluedMap; import jakarta.xml.bind.JAXBElement; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_standardhaspriority_web/resource"); } @@ -62,6 +77,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/standardhaspriority/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_standardhaspriority_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, AbstractProvider.class, ProviderWalker.class, TckBooleanProvider.class, TckCharacterProvider.class, TckCharacterProvider.class, TckJaxbProvider.class, TckMapProvider.class, TckNumberProvider.class, TckUniversalProvider.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: readWriteJaxbProviderTest @@ -75,6 +111,7 @@ * application-provided over pre-packaged entity providers. i.e. When have the * same mediaType */ + @Test public void readWriteJaxbProviderTest() throws Fault { JAXBElement<String> element = new JAXBElement<String>(new QName("jaxb"), String.class, "jaxb"); @@ -94,6 +131,7 @@ * application-provided over pre-packaged entity providers. i.e. When have the * same mediaType */ + @Test public void readWriteMapProviderTest() throws Fault { MultivaluedMap<String, String> map = new MultivaluedHashMap<String, String>(); map.add("map", "map"); @@ -113,6 +151,7 @@ * application-provided over pre-packaged entity providers. i.e. When have the * same mediaType */ + @Test public void readWriteBooleanProviderTest() throws Fault { MediaType mt = MediaType.TEXT_PLAIN_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, "boolean")); @@ -135,6 +174,7 @@ * application-provided over pre-packaged entity providers. i.e. When have the * same mediaType */ + @Test public void readWriteCharacterProviderTest() throws Fault { MediaType mt = MediaType.TEXT_PLAIN_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, "character")); @@ -157,6 +197,7 @@ * application-provided over pre-packaged entity providers. i.e. When have the * same mediaType */ + @Test public void readWriteIntegerProviderTest() throws Fault { MediaType mt = MediaType.TEXT_PLAIN_TYPE; setProperty(Property.REQUEST, buildRequest(Request.POST, "number"));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/ProviderWalker.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/ProviderWalker.java index 90b65b2..b7f5c71 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/ProviderWalker.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/ProviderWalker.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/Resource.java index 2fea2a8..a13e6db 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import javax.xml.transform.Source;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TSAppConfig.java index 1be8add..6262eb4 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckBooleanProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckBooleanProvider.java index 5c3608f..d8ca0db 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckBooleanProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckBooleanProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckCharacterProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckCharacterProvider.java index 3c50b3f..8162ce9 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckCharacterProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckCharacterProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckJaxbProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckJaxbProvider.java index b08d028..37c9585 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckJaxbProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckJaxbProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckMapProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckMapProvider.java index 3f6aea2..6ce4e8f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckMapProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckMapProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckNumberProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckNumberProvider.java index ac371a2..3515043 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckNumberProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckNumberProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckUniversalProvider.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckUniversalProvider.java index c92f796..954289f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckUniversalProvider.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardhaspriority/TckUniversalProvider.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority; +package jakarta.ws.rs.tck.spec.provider.standardhaspriority; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/JAXRSClient.java index e0228d9..884c442 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/JAXRSClient.java
@@ -14,17 +14,18 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardnotnull; +package jakarta.ws.rs.tck.spec.provider.standardnotnull; import java.io.File; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; +import java.io.IOException; import javax.xml.transform.Source; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; -import com.sun.ts.tests.jaxrs.common.util.JaxrsUtil; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.util.JaxrsUtil; import jakarta.activation.DataSource; import jakarta.ws.rs.ProcessingException; @@ -37,17 +38,30 @@ import jakarta.ws.rs.core.Response.Status; import jakarta.xml.bind.JAXBElement; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = -3528892672938533655L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_standardnotnull_web/resource"); } @@ -60,6 +74,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/standardnotnull/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_standardnotnull_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* * @testName: serverByteArrayProviderTest * @@ -72,6 +107,7 @@ * corresponding Java object that represents zero-length data; they MUST NOT * return null. */ + @Test public void serverByteArrayProviderTest() throws Fault { setProperty(Property.SEARCH_STRING, Resource.NOTNULL); setProperty(Property.REQUEST, buildRequest(Request.POST, "bytearray")); @@ -88,6 +124,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientByteArrayProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -109,6 +146,7 @@ * corresponding Java object that represents zero-length data; they MUST NOT * return null. */ + @Test public void serverStringProviderTest() throws Fault { setProperty(Property.SEARCH_STRING, Resource.NOTNULL); setProperty(Property.REQUEST, buildRequest(Request.POST, "string")); @@ -125,6 +163,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientStringProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -145,6 +184,7 @@ * corresponding Java object that represents zero-length data; they MUST NOT * return null. */ + @Test public void serverInputStreamProviderTest() throws Fault { setProperty(Property.SEARCH_STRING, Resource.NOTNULL); setProperty(Property.REQUEST, buildRequest(Request.POST, "inputstream")); @@ -161,6 +201,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientInputStreamProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -188,6 +229,7 @@ * corresponding Java object that represents zero-length data; they MUST NOT * return null. */ + @Test public void serverReaderProviderTest() throws Fault { setProperty(Property.SEARCH_STRING, Resource.NOTNULL); setProperty(Property.REQUEST, buildRequest(Request.POST, "reader")); @@ -204,6 +246,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientReaderProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -231,6 +274,7 @@ * corresponding Java object that represents zero-length data; they MUST NOT * return null. */ + @Test public void serverFileProviderTest() throws Fault { setProperty(Property.SEARCH_STRING, Resource.NOTNULL); setProperty(Property.REQUEST, buildRequest(Request.POST, "file")); @@ -247,6 +291,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientFileProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -274,6 +319,7 @@ * corresponding Java object that represents zero-length data; they MUST NOT * return null. */ + @Test public void serverDataSourceProviderTest() throws Fault { setProperty(Property.SEARCH_STRING, Resource.NOTNULL); setProperty(Property.REQUEST, buildRequest(Request.POST, "datasource")); @@ -290,6 +336,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientDataSourceProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -317,6 +364,7 @@ * corresponding Java object that represents zero-length data; they MUST NOT * return null. */ + @Test public void serverSourceProviderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.APPLICATION_XML_TYPE)); @@ -334,6 +382,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientSourceProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -361,6 +410,7 @@ * corresponding Java object that represents zero-length data; they MUST NOT * return null. */ + @Test public void serverMultivaluedMapProviderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.APPLICATION_FORM_URLENCODED_TYPE)); @@ -379,6 +429,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientMultivaluedMapProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -403,6 +454,7 @@ * WebApplicationException with a client error response (HTTP 400) for * zero-length request entities. */ + @Test public void serverJaxbProviderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.APPLICATION_XML_TYPE)); @@ -421,6 +473,7 @@ * for a zero-length response entities returns null or a corresponding Java * object that represents zero-length data. */ + @Test public void clientJaxbProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "null")); setProperty(Property.REQUEST_HEADERS, @@ -446,6 +499,7 @@ * WebApplicationException with a client error response (HTTP 400) for * zero-length request entities. */ + @Test public void serverStreamingOutputProviderTest() throws Fault { String content = "StreamingOutput"; setProperty(Property.REQUEST, @@ -466,6 +520,7 @@ * MUST throw a BadRequestException (400 status) for zero-length request * entities. */ + @Test public void serverBooleanProviderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.TEXT_PLAIN_TYPE)); @@ -486,6 +541,7 @@ * * readEntity throws Processing Exception */ + @Test public void clientBooleanProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -515,6 +571,7 @@ * MUST throw a BadRequestException (400 status) for zero-length request * entities. */ + @Test public void serverCharProviderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.TEXT_PLAIN_TYPE)); @@ -535,6 +592,7 @@ * * readEntity throws Processing Exception */ + @Test public void clientCharProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -564,6 +622,7 @@ * MUST throw a BadRequestException (400 status) for zero-length request * entities. */ + @Test public void serverIntegerProviderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.TEXT_PLAIN_TYPE)); @@ -584,6 +643,7 @@ * * readEntity throws Processing Exception */ + @Test public void clientIntegerProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke(); @@ -613,6 +673,7 @@ * MUST throw a BadRequestException (400 status) for zero-length request * entities. */ + @Test public void serverBigDecimalProviderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.TEXT_PLAIN_TYPE)); @@ -633,6 +694,7 @@ * * readEntity throws Processing Exception */ + @Test public void clientBigDecimalProviderTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "entity")); invoke();
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/Resource.java index eed536a..b3b8e35 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardnotnull; +package jakarta.ws.rs.tck.spec.provider.standardnotnull; import java.io.File; import java.io.InputStream; @@ -24,7 +24,7 @@ import javax.xml.transform.Source; -import com.sun.ts.tests.jaxrs.common.impl.StringStreamingOutput; +import jakarta.ws.rs.tck.common.impl.StringStreamingOutput; import jakarta.activation.DataSource; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/TSAppConfig.java index 048e1ba..d09af70 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardnotnull/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardnotnull; +package jakarta.ws.rs.tck.spec.provider.standardnotnull; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/JAXRSClient.java index 2545c92..b75101a 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/JAXRSClient.java
@@ -14,27 +14,42 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardwithjaxrsclient; +package jakarta.ws.rs.tck.spec.provider.standardwithjaxrsclient; import java.math.BigDecimal; +import java.io.InputStream; +import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MultivaluedHashMap; import jakarta.ws.rs.core.MultivaluedMap; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_standardwithjaxrsclient_web/resource"); } @@ -66,6 +81,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_standardwithjaxrsclient_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* * @testName: mapElementProviderTest * @@ -106,6 +142,7 @@ * primitive types supported via boxing/unboxing conversion. * */ + @Test public void readWriteProviderBoolTest() throws Fault { setProperty(Property.CONTENT, "false"); setProperty(Property.SEARCH_STRING, "false"); @@ -121,6 +158,7 @@ * primitive types supported via boxing/unboxing conversion. * */ + @Test public void readWriteProviderBooleanTest() throws Fault { Boolean bool = Boolean.valueOf(true); setRequestContentEntity(bool); @@ -136,6 +174,7 @@ * @test_Strategy: java.lang.Character. Only for text/plain. Corresponding * primitive types supported via boxing/unboxing conversion. */ + @Test public void readWriteProviderCharTest() throws Fault { setProperty(Property.CONTENT, "x"); setProperty(Property.SEARCH_STRING, "x"); @@ -150,6 +189,7 @@ * @test_Strategy: java.lang.Character. Only for text/plain. Corresponding * primitive types supported via boxing/unboxing conversion. */ + @Test public void readWriteProviderCharacterTest() throws Fault { Character c = Character.valueOf('x'); setRequestContentEntity(c); @@ -165,6 +205,7 @@ * @test_Strategy: java.lang.Number. Only for text/plain. Corresponding * primitive types supported via boxing/unboxing conversion. */ + @Test public void readWriteProviderIntTest() throws Fault { setProperty(Property.CONTENT, String.valueOf(Integer.MAX_VALUE)); setProperty(Property.SEARCH_STRING, String.valueOf(Integer.MAX_VALUE)); @@ -179,6 +220,7 @@ * @test_Strategy: java.lang.Number. Only for text/plain. Corresponding * primitive types supported via boxing/unboxing conversion. */ + @Test public void readWriteProviderLongTest() throws Fault { setProperty(Property.CONTENT, String.valueOf(Long.MAX_VALUE)); setProperty(Property.SEARCH_STRING, String.valueOf(Long.MAX_VALUE)); @@ -193,6 +235,7 @@ * @test_Strategy: java.lang.Number. Only for text/plain. Corresponding * primitive types supported via boxing/unboxing conversion. */ + @Test public void readWriteProviderIntegerTest() throws Fault { Integer i = new Integer(Integer.MAX_VALUE); setRequestContentEntity(i); @@ -208,6 +251,7 @@ * @test_Strategy: java.lang.Number. Only for text/plain. Corresponding * primitive types supported via boxing/unboxing conversion. */ + @Test public void readWriteProviderBigLongTest() throws Fault { Long l = new Long(Long.MAX_VALUE); setRequestContentEntity(l); @@ -223,6 +267,7 @@ * @test_Strategy: java.lang.Number. Only for text/plain. Corresponding * primitive types supported via boxing/unboxing conversion. */ + @Test public void readWriteProviderDoubleTest() throws Fault { Double pi = Math.PI; setRequestContentEntity(pi); @@ -238,6 +283,7 @@ * @test_Strategy: java.lang.Number. Only for text/plain. Corresponding * primitive types supported via boxing/unboxing conversion. */ + @Test public void readWriteProviderBigDecimalTest() throws Fault { BigDecimal bd = new BigDecimal(Integer.MAX_VALUE); setRequestContentEntity(bd);
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/Resource.java index 00ffb9b..cfd5ae7 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardwithjaxrsclient; +package jakarta.ws.rs.tck.spec.provider.standardwithjaxrsclient; import java.math.BigDecimal;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/TSAppConfig.java index 06df9e5..f90c69a 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardwithjaxrsclient; +package jakarta.ws.rs.tck.spec.provider.standardwithjaxrsclient; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/JAXRSClient.java index ad0cc09..d705334 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/JAXRSClient.java
@@ -14,23 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardwithxmlbinding; +package jakarta.ws.rs.tck.spec.provider.standardwithxmlbinding; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import jakarta.ws.rs.tck.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; import jakarta.ws.rs.core.MediaType; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_standardwithxmlbinding_web/resource"); } @@ -76,6 +92,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_standardwithxmlbinding_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* @@ -90,6 +127,7 @@ * jakarta.xml.bind.JAXBElement and application-supplied JAXB classes XML media * types (text/xml, application/xml and application/*+xml) */ + @Test public void jaxbElementProviderTest() throws Fault { setPropertyAndInvokeXml("jaxb"); }
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/Resource.java index 61e8758..8d37a72 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardwithxmlbinding; +package jakarta.ws.rs.tck.spec.provider.standardwithxmlbinding; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/TSAppConfig.java index d5440c9..861fc6b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.standardwithxmlbinding; +package jakarta.ws.rs.tck.spec.provider.standardwithxmlbinding; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/DummyClass.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/DummyClass.java index 75a0eb6..f3e0de6 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/DummyClass.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/DummyClass.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; public class DummyClass {
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/DummyWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/DummyWriter.java index 7bd9956..a9b0e52 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/DummyWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/DummyWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/HolderClass.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/HolderClass.java index ca62c13..90a034b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/HolderClass.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/HolderClass.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; import jakarta.ws.rs.core.Application; import jakarta.ws.rs.core.HttpHeaders;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/HolderResolver.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/HolderResolver.java index bd4818b..bc1f211 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/HolderResolver.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/HolderResolver.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; import jakarta.ws.rs.core.Application; import jakarta.ws.rs.core.Context;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/JAXRSClient.java index da8e232..bf73c4d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/JAXRSClient.java
@@ -14,23 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_visibility_web/resource"); } @@ -43,6 +59,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/visibility/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_visibility_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, DummyClass.class, DummyWriter.class, HolderClass.class, HolderResolver.class, StringReader.class, VisibilityException.class, VisibilityExceptionMapper.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: contextResolverTest @@ -56,6 +93,7 @@ * If more than one public constructor can be used then an implementation MUST * use the one with the most parameters */ + @Test public void contextResolverTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "contextresolver")); setProperty(Property.SEARCH_STRING, HolderClass.OK); @@ -74,6 +112,7 @@ * If more than one public constructor can be used then an implementation MUST * use the one with the most parameters */ + @Test public void exceptionMapperTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "exceptionmapper")); setProperty(Property.SEARCH_STRING, HolderClass.OK); @@ -92,6 +131,7 @@ * If more than one public constructor can be used then an implementation MUST * use the one with the most parameters */ + @Test public void bodyWriterTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "bodywriter")); setProperty(Property.SEARCH_STRING, HolderClass.OK); @@ -110,6 +150,7 @@ * If more than one public constructor can be used then an implementation MUST * use the one with the most parameters */ + @Test public void bodyReaderTest() throws Fault { MediaType type = new MediaType("text", "tck"); setProperty(Property.REQUEST, buildRequest(Request.POST, "bodyreader"));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/Resource.java index 2eb1429..cc4098b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/StringReader.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/StringReader.java index 1aef862..6b00b73 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/StringReader.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/StringReader.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; import java.io.IOException; import java.io.InputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/TSAppConfig.java index 0c9357c..4ad9e4d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/VisibilityException.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/VisibilityException.java index b1a3ea2..c94f274 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/VisibilityException.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/VisibilityException.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; import jakarta.ws.rs.WebApplicationException;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/VisibilityExceptionMapper.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/VisibilityExceptionMapper.java index 4cde127..a3fe441 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/VisibilityExceptionMapper.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/visibility/VisibilityExceptionMapper.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.visibility; +package jakarta.ws.rs.tck.spec.provider.visibility; import jakarta.ws.rs.core.Application; import jakarta.ws.rs.core.Context;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppAnyEntityWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppAnyEntityWriter.java index 9d86072..2b97703 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppAnyEntityWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppAnyEntityWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppJavaEntityWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppJavaEntityWriter.java index c80a5d3..57af5f6 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppJavaEntityWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppJavaEntityWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppXmlObjectWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppXmlObjectWriter.java index f524091..709b5b7 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppXmlObjectWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/AppXmlObjectWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/DefaultEntityWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/DefaultEntityWriter.java index df1867e..f3b0edc 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/DefaultEntityWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/DefaultEntityWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/EntityForWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/EntityForWriter.java index b8fe9a9..cf5b535 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/EntityForWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/EntityForWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; public class EntityForWriter { private String body;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/JAXRSClient.java index 427c0d4..c16c97a 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/JAXRSClient.java
@@ -14,23 +14,40 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; import jakarta.ws.rs.core.MediaType; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_provider_writer_web/resource"); } @@ -43,6 +60,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/provider/writer/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_provider_writer_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, OkResponse.class, EntityForWriter.class, DefaultEntityWriter.class, AppXmlObjectWriter.class, AppJavaEntityWriter.class, AppAnyEntityWriter.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: responseSubClassTest @@ -54,6 +92,7 @@ * value of the entity property * */ + @Test public void responseSubClassTest() throws Fault { setWriter(AppAnyEntityWriter.class); setProperty(Property.REQUEST, buildRequest(Request.GET, "subresponse")); @@ -79,6 +118,7 @@ * object class are sorted first and a secondary key of media type (see * Section 4.2.3). */ + @Test public void supportXmlByDefaultWriterTest() throws Fault { setWriter(DefaultEntityWriter.class); setProperty(Property.REQUEST, buildRequest(Request.GET, "supportxml")); @@ -105,6 +145,7 @@ * object class are sorted first and a secondary key of media type (see * Section 4.2.3). */ + @Test public void supportXmlByXmlWriterTest() throws Fault { setWriter(AppXmlObjectWriter.class); setProperty(Property.REQUEST, buildRequest(Request.GET, "supportxml")); @@ -133,6 +174,7 @@ * object class are sorted first and a secondary key of media type (see * Section 4.2.3). */ + @Test public void supportAllTest() throws Fault { setWriter(DefaultEntityWriter.class); setProperty(Property.REQUEST, buildRequest(Request.GET, "supportall")); @@ -161,6 +203,7 @@ * object class are sorted first and a secondary key of media type (see * Section 4.2.3). */ + @Test public void supportAppJavaTest() throws Fault { setWriter(AppJavaEntityWriter.class); setProperty(Property.REQUEST, buildRequest(Request.POST, "supportmedia"));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/OkResponse.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/OkResponse.java index c866d2d..3034173 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/OkResponse.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/OkResponse.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; import java.lang.annotation.Annotation; import java.net.URI;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/Resource.java index 16a7aac..cf28cd3 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/TSAppConfig.java index 5b82d71..a6702ed 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/provider/writer/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.provider.writer; +package jakarta.ws.rs.tck.spec.provider.writer; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/JAXRSClient.java index d5a58a2..37449e4 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/JAXRSClient.java
@@ -14,23 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence; +package jakarta.ws.rs.tck.spec.resource.annotationprecedence; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response.Status; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_resource_annotationprecedence_web/resource"); } @@ -43,6 +59,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/resource/annotationprecedence/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_resource_annotationprecedence_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, ResourceInterface.class, SuperClass.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: correctTest @@ -52,6 +89,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. */ + @Test public void correctTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "post")); invoke(); @@ -65,6 +103,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (@Path) */ + @Test public void incorrectPathOnClassTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "post") .replace("/resource", "/interfaceresource")); @@ -80,6 +119,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (@Path) */ + @Test public void incorrectPathOnMethodTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "get")); setProperty(Property.STATUS_CODE, getStatusCode(Status.NOT_FOUND)); @@ -94,6 +134,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (@GET) */ + @Test public void correctRequestTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "post")); setProperty(Property.STATUS_CODE, "!" + getStatusCode(Status.OK)); @@ -108,6 +149,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (Content-Type) */ + @Test public void incorrectConsumesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "post")); setProperty(Property.REQUEST_HEADERS, @@ -125,6 +167,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (Accept) */ + @Test public void incorrectProdecesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "post")); setProperty(Property.REQUEST_HEADERS, @@ -141,6 +184,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (Accept, Content-type) */ + @Test public void incorrectProducesConsumesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "post")); setProperty(Property.REQUEST_HEADERS, buildAccept(MediaType.TEXT_XML_TYPE)); @@ -158,6 +202,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (formparam=pqr) */ + @Test public void formParamTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "post")); setProperty(Property.CONTENT, "pqr=hello"); @@ -174,6 +219,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (queryParam=xyz) */ + @Test public void queryParamXyzTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "post?xyz=hello")); setProperty(Property.SEARCH_STRING, "default"); @@ -189,6 +235,7 @@ * @test_Strategy: Annotations on a super-class take precedence over those on * an implemented interface. (queryParam=pqr) */ + @Test public void queryParamPqrTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "post?pqr=hello")); setProperty(Property.SEARCH_STRING, "hello");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/Resource.java index bbc554b..20f461a 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence; +package jakarta.ws.rs.tck.spec.resource.annotationprecedence; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/ResourceInterface.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/ResourceInterface.java index a795f2b..a5d3dc9 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/ResourceInterface.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/ResourceInterface.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence; +package jakarta.ws.rs.tck.spec.resource.annotationprecedence; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DefaultValue;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/SuperClass.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/SuperClass.java index 412b4a2..de0d86c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/SuperClass.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/SuperClass.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence; +package jakarta.ws.rs.tck.spec.resource.annotationprecedence; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DefaultValue;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/TSAppConfig.java index 241d746..222059c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence; +package jakarta.ws.rs.tck.spec.resource.annotationprecedence; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/JAXRSClient.java new file mode 100644 index 0000000..5c22ad2 --- /dev/null +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/JAXRSClient.java
@@ -0,0 +1,289 @@ +/* + * 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 jakarta.ws.rs.tck.spec.resource.annotationprecedence.subclass; + +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; + +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response.Status; + +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; +/* + * @class.setup_props: webServerHost; + * webServerPort; + */ +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { + + private static final long serialVersionUID = 1L; + + public JAXRSClientIT() { + setup(); + setContextRoot( + "/jaxrs_spec_resource_annotationprecedence_subclass_web/resource"); + } + + /** + * Entry point for different-VM execution. It should delegate to method + * run(String[], PrintWriter, PrintWriter), and this method should not contain + * any test configuration. + */ + public static void main(String[] args) { + new JAXRSClient().run(args); + } + + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_resource_annotationprecedence_subclass_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + + /* Run test */ + /* + * @testName: correctTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. + */ + @Test + public void correctTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put")); + invoke(); + } + + /* + * @testName: incorrectPathOnClassTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (@Path) + */ + @Test + public void incorrectPathOnClassTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put") + .replace("/resource", "/interfaceresource")); + setProperty(Property.STATUS_CODE, getStatusCode(Status.NOT_FOUND)); + invoke(); + } + + /* + * @testName: incorrectPathOnClassAndRequestTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (@Path) + */ + @Test + public void incorrectPathOnClassAndRequestTest() throws Fault { + setProperty(Property.REQUEST, + buildRequest(Request.POST, "post").replace("/resource", "/super")); + setProperty(Property.STATUS_CODE, getStatusCode(Status.NOT_FOUND)); + invoke(); + } + + /* + * @testName: incorrectPathOnMethodTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (@Path) + */ + @Test + public void incorrectPathOnMethodTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "post")); + setProperty(Property.STATUS_CODE, getStatusCode(Status.NOT_FOUND)); + invoke(); + } + + /* + * @testName: correctRequestTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (@POST) + */ + @Test + public void correctRequestTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.POST, "put")); + setProperty(Property.STATUS_CODE, "!" + getStatusCode(Status.OK)); + invoke(); + } + + /* + * @testName: incorrectConsumesTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored.(Content-Type) + */ + @Test + public void incorrectConsumesTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put")); + setProperty(Property.REQUEST_HEADERS, + buildContentType(MediaType.TEXT_XML_TYPE)); + setProperty(Property.STATUS_CODE, + getStatusCode(Status.UNSUPPORTED_MEDIA_TYPE)); + invoke(); + } + + /* + * @testName: incorrectProdecesTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (Accept) + */ + @Test + public void incorrectProdecesTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put")); + setProperty(Property.REQUEST_HEADERS, buildAccept(MediaType.TEXT_XML_TYPE)); + setProperty(Property.STATUS_CODE, getStatusCode(Status.NOT_ACCEPTABLE)); + invoke(); + } + + /* + * @testName: correctProducesConsumesTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (Accept, Content-type) + */ + @Test + public void correctProducesConsumesTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put")); + setProperty(Property.REQUEST_HEADERS, + buildAccept(MediaType.TEXT_HTML_TYPE)); + setProperty(Property.REQUEST_HEADERS, + buildContentType(MediaType.TEXT_HTML_TYPE)); + setProperty(Property.STATUS_CODE, getStatusCode(Status.OK)); + invoke(); + } + + /* + * @testName: formParamTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (formparam=pqr) + */ + @Test + public void formParamTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put")); + setProperty(Property.CONTENT, "pqr=hello"); + setProperty(Property.SEARCH_STRING, "subclass"); + setProperty(Property.UNEXPECTED_RESPONSE_MATCH, "hello"); + invoke(); + } + + /* + * @testName: queryParamXyzTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (queryParam=xyz) + */ + @Test + public void queryParamXyzTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put?xyz=hello")); + setProperty(Property.SEARCH_STRING, "subclass"); + setProperty(Property.UNEXPECTED_RESPONSE_MATCH, "hello"); + invoke(); + } + + /* + * @testName: queryParamPqrTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (queryParam=pqr) + */ + @Test + public void queryParamPqrTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put?pqr=hello")); + setProperty(Property.SEARCH_STRING, "subclass"); + setProperty(Property.UNEXPECTED_RESPONSE_MATCH, "hello"); + invoke(); + } + + /* + * @testName: matrixParamPqrTest + * + * @assertion_ids: JAXRS:SPEC:24; + * + * @test_Strategy: If a subclass or implementation method has any JAX-RS + * annotations then all of the annotations on the super class or interface + * method are ignored. (queryParam=pqr) + */ + @Test + public void matrixParamPqrTest() throws Fault { + setProperty(Property.REQUEST, buildRequest(Request.PUT, "put;ijk=hello")); + setProperty(Property.SEARCH_STRING, "hello"); + invoke(); + } +}
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/Resource.java index 0fb4570..c693b83 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/Resource.java
@@ -14,10 +14,10 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence.subclass; +package jakarta.ws.rs.tck.spec.resource.annotationprecedence.subclass; -import com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence.ResourceInterface; -import com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence.SuperClass; +import jakarta.ws.rs.tck.spec.resource.annotationprecedence.ResourceInterface; +import jakarta.ws.rs.tck.spec.resource.annotationprecedence.SuperClass; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DefaultValue;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/TSAppConfig.java index 5936d81..43288bc 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence.subclass; +package jakarta.ws.rs.tck.spec.resource.annotationprecedence.subclass; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/EntityWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/EntityWriter.java index e6afcf0..95f666f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/EntityWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/EntityWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.locator; +package jakarta.ws.rs.tck.spec.resource.locator; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/JAXRSClient.java index aa58200..05fb3bc 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/JAXRSClient.java
@@ -14,20 +14,36 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.locator; +package jakarta.ws.rs.tck.spec.resource.locator; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; +import jakarta.ws.rs.tck.common.JAXRSCommonClient; + +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_resource_locator_web/resource"); } @@ -40,6 +56,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/resource/locator/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_resource_locator_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, EntityWriter.class, LocatorEntity.class, SubResource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: checkEntityIsNotSetTest @@ -52,6 +89,7 @@ * expected to be initialized by their creator and field and bean properties * are not modified by the implementation runtime. */ + @Test public void checkEntityIsNotSetTest() throws Fault { String request = buildRequest(Request.POST, "sub;resmatrix=resarg;submatrix=subarg;entity=entityarg;");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/LocatorEntity.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/LocatorEntity.java index e97c500..ec2c271 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/LocatorEntity.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/LocatorEntity.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.locator; +package jakarta.ws.rs.tck.spec.resource.locator; import jakarta.ws.rs.MatrixParam;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/Resource.java index 85f7e3d..e75c92c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.locator; +package jakarta.ws.rs.tck.spec.resource.locator; import jakarta.ws.rs.MatrixParam; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/SubResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/SubResource.java index 390778f..aff2494 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/SubResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/SubResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.locator; +package jakarta.ws.rs.tck.spec.resource.locator; import jakarta.ws.rs.MatrixParam; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/TSAppConfig.java index c4884a6..f884097 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/locator/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.locator; +package jakarta.ws.rs.tck.spec.resource.locator; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/AnotherResourceLocator.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/AnotherResourceLocator.java index 81d905f..0d4a363 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/AnotherResourceLocator.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/AnotherResourceLocator.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/AnotherSubResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/AnotherSubResource.java index b575c86..af14fd2 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/AnotherSubResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/AnotherSubResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/EmptyResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/EmptyResource.java index 0bb24f2..45bd203 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/EmptyResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/EmptyResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/ExceptionMatcher.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/ExceptionMatcher.java index d64fc1b..0e389d0 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/ExceptionMatcher.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/ExceptionMatcher.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/JAXRSClient.java index edad793..bdffe33 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/JAXRSClient.java
@@ -14,24 +14,40 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response.Status; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 6493953027905734515L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_resource_requestmatching_web"); } @@ -44,6 +60,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/resource/requestmatching/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_resource_requestmatching_web.war"); + archive.addClasses(TSAppConfig.class, MainResource.class, EmptyResource.class, AnotherResourceLocator.class, AnotherSubResource.class, ExceptionMatcher.class, LocatorResource.class, MainResourceLocator.class, MainSubResource.class, YetAnotherSubresource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: emptyUriTest @@ -96,6 +133,7 @@ * * Make sure the server does not return 404 every time */ + @Test public void slashUriTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "")); setProperty(Property.STATUS_CODE, getStatusCode(Status.OK)); @@ -113,6 +151,7 @@ * WebApplicationException with a not found response (HTTP 404 status) and no * entity. The exception MUST be processed as described in section 3.3.4. */ + @Test public void slashWrongUriTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "wrong")); setProperty(Property.SEARCH_STRING, getStatusCode(Status.NOT_FOUND)); @@ -129,6 +168,7 @@ * WebApplicationException with a not found response (HTTP 404 status) and no * entity. The exception MUST be processed as described in section 3.3.4. */ + @Test public void wrongAppNameTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "").replace("web", "wrong")); @@ -146,6 +186,7 @@ * WebApplicationException with a not found response (HTTP 404 status) and no * entity. The exception MUST be processed as described in section 3.3.4. */ + @Test public void slashAppNameTest() throws Fault { setProperty(Property.REQUEST, Request.GET.name() + " /" + MainResource.ID + HTTP11); @@ -164,6 +205,7 @@ * groups with non-default regular expressions as the tertiary key (descending * order). */ + @Test public void descendantResourcePathValueTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/subresource")); @@ -182,6 +224,7 @@ * groups with non-default regular expressions as the tertiary key (descending * order). */ + @Test public void descendantSubResourcePathValueTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/subresource/sub")); @@ -204,6 +247,7 @@ * * @Path on method has precedence over on resource locator */ + @Test public void resourceLocatorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/locator/locator")); @@ -225,6 +269,7 @@ * * Check Resource locator finds subresource */ + @Test public void foundAnotherResourceLocatorByPathTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/locator/sub")); @@ -245,6 +290,7 @@ * * From Alg.2 */ + @Test public void locatorNameTooLongTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/locator/sub/locator")); @@ -264,6 +310,7 @@ * * From Alg.2 */ + @Test public void locatorNameTooLongAgainTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/locator/locator/locator")); @@ -283,6 +330,7 @@ * * From Alg.2 */ + @Test public void methodNotFoundTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/locator/test")); @@ -301,6 +349,7 @@ * exception MUST be processed as described in section 3.3.4. Note the * additional support for HEAD and OPTIONS described in section 3.3.5. */ + @Test public void requestNotSupportedOnResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.PUT, "resource/something")); @@ -320,6 +369,7 @@ * exception MUST be processed as described in section 3.3.4. Note the * additional support for HEAD and OPTIONS described in section 3.3.5. */ + @Test public void requestNotSupportedOnSubResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.PUT, "resource/subresource/something")); @@ -339,6 +389,7 @@ * exception MUST be processed as described in section 3.3.4. Note the * additional support for HEAD and OPTIONS described in section 3.3.5. */ + @Test public void requestNotSupportedOnResourceLocatorTest() throws Fault { String request = buildRequest(Request.PUT, "resource/subresource/consumeslocator"); @@ -359,6 +410,7 @@ * exception MUST be processed as described in section 3.3.4. Note the * additional support for HEAD and OPTIONS described in section 3.3.5. */ + @Test public void requestNotSupportedOnSubResourceLocatorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.PUT, "resource/consumeslocator")); @@ -378,6 +430,7 @@ * exception MUST be processed as described in section 3.3.4. Note the * additional support for HEAD and OPTIONS described in section 3.3.5. */ + @Test public void optionsOnSubResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.OPTIONS, "resource/subresource/something")); @@ -403,6 +456,7 @@ * exception MUST be processed as described in section 3.3.4. Note the * additional support for HEAD and OPTIONS described in section 3.3.5. */ + @Test public void headOnSubResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.HEAD, "resource/subresource/something")); @@ -423,6 +477,7 @@ * status) and no entity. The exception MUST be processed as described in * Section 3.3.4. */ + @Test public void consumesOnResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/consumes")); @@ -445,6 +500,7 @@ * status) and no entity. The exception MUST be processed as described in * Section 3.3.4. */ + @Test public void consumesCorrectContentTypeOnResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/consumes")); @@ -466,6 +522,7 @@ * status) and no entity. The exception MUST be processed as described in * Section 3.3.4. */ + @Test public void consumesOnResourceLocatorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/consumeslocator")); @@ -488,6 +545,7 @@ * status) and no entity. The exception MUST be processed as described in * Section 3.3.4. */ + @Test public void consumesCorrectContentTypeOnResourceLocatorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/consumeslocator")); @@ -510,6 +568,7 @@ * status) and no entity. The exception MUST be processed as described in * Section 3.3.4. */ + @Test public void consumesOnSubResourceLocatorTest() throws Fault { String request = buildRequest(Request.POST, "resource/subresource/consumeslocator"); @@ -533,6 +592,7 @@ * status) and no entity. The exception MUST be processed as described in * Section 3.3.4. */ + @Test public void consumesCorrectContentTypeOnSubResourceLocatorTest() throws Fault { String request = buildRequest(Request.POST, @@ -559,6 +619,7 @@ * acceptable response (HTTP 406 status) and no entity. The exception MUST be * processed as described in Section 3.3.4 */ + @Test public void producesOnResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/produces")); @@ -580,6 +641,7 @@ * acceptable response (HTTP 406 status) and no entity. The exception MUST be * processed as described in Section 3.3.4 */ + @Test public void producesCorrectContentTypeOnResourceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/produces")); @@ -601,6 +663,7 @@ * acceptable response (HTTP 406 status) and no entity. The exception MUST be * processed as described in Section 3.3.4 */ + @Test public void producesOnResourceLocatorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/produceslocator")); @@ -622,6 +685,7 @@ * acceptable response (HTTP 406 status) and no entity. The exception MUST be * processed as described in Section 3.3.4 */ + @Test public void producesCorrectContentTypeOnResourceLocatorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource/produceslocator")); @@ -644,6 +708,7 @@ * acceptable response (HTTP 406 status) and no entity. The exception MUST be * processed as described in Section 3.3.4 */ + @Test public void producesOnSubResourceLocatorTest() throws Fault { String request = buildRequest(Request.POST, "resource/subresource/produceslocator"); @@ -666,6 +731,7 @@ * acceptable response (HTTP 406 status) and no entity. The exception MUST be * processed as described in Section 3.3.4 */ + @Test public void producesCorrectContentTypeOnSubResourceLocatorTest() throws Fault { String request = buildRequest(Request.POST, @@ -685,6 +751,7 @@ * * @test_Strategy: Check sub-resource locator from sub-resource locator */ + @Test public void l2SubResourceLocatorTest() throws Fault { String request = buildRequest(Request.DELETE, "resource/l2locator/l2locator"); @@ -707,6 +774,7 @@ * Like in descendantSubResourcePathValueTest, AnotherSubResource method is * used, because MainSubResource is another object */ + @Test public void consumesOverridesDescendantSubResourcePathValueTest() throws Fault { setProperty(Property.REQUEST, @@ -732,6 +800,7 @@ * Like in descendantSubResourcePathValueTest, AnotherSubResource method is * used, because MainSubResource is another object */ + @Test public void producesOverridesDescendantSubResourcePathValueTest() throws Fault { setProperty(Property.REQUEST, @@ -759,6 +828,7 @@ *//* * and a better match for AnotherSubResource#sub */ + @Test public void producesOverridesDescendantSubResourcePathValuePostTest() throws Fault { setProperty(Property.REQUEST, @@ -783,6 +853,7 @@ * n/* > *//* */ + @Test public void concreteOverStarWhenAcceptStarTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "yas")); setProperty(Property.REQUEST_HEADERS, "Accept: testi/*"); @@ -803,6 +874,7 @@ * using a relative quality factor known as the q parameter. The value of the * q parameter, or q-value, is used to sort the set of accepted */ + @Test public void qualityDeterminesTextATest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "yas")); setProperty(Property.REQUEST_HEADERS, @@ -822,6 +894,7 @@ * using a relative quality factor known as the q parameter. The value of the * q parameter, or q-value, is used to sort the set of accepted */ + @Test public void qualityDeterminesTextBTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "yas")); setProperty(Property.REQUEST_HEADERS, @@ -843,6 +916,7 @@ * server preference is only examined when multiple media types are accepted * by a client with the same q-value. */ + @Test public void producesOverridesDescendantSubResourcePathValueWeightTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "yas")); @@ -862,6 +936,7 @@ * server preference is only examined when multiple media types are accepted * by a client with the same q-value. */ + @Test public void qualityOfSourceOnDifferentMediaTypesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "yas")); setProperty(Property.REQUEST_HEADERS, @@ -879,6 +954,7 @@ * * @test_Strategy: n2/m2 /> n1/m1 and v1 = v2 and v1' = v2' and v1'' <= v2'' */ + @Test public void concreteOverStarTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "yas")); setProperty(Property.REQUEST_HEADERS, "Accept: testi/text");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/LocatorResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/LocatorResource.java index b223228..ede337a 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/LocatorResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/LocatorResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainResource.java index 7c4a3dd..ab5023f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainResourceLocator.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainResourceLocator.java index 6a0be58..b9a11a1 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainResourceLocator.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainResourceLocator.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainSubResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainSubResource.java index ac5742c..ec5feed 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainSubResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/MainSubResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/TSAppConfig.java index 6cc5f09..c553bb6 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/YetAnotherSubresource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/YetAnotherSubresource.java index cade67e..829f33d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/YetAnotherSubresource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/requestmatching/YetAnotherSubresource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.requestmatching; +package jakarta.ws.rs.tck.spec.resource.requestmatching; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/ErrorResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/ErrorResource.java index b8bc173..9682d36 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/ErrorResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/ErrorResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.responsemediatype; +package jakarta.ws.rs.tck.spec.resource.responsemediatype; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/JAXRSClient.java index 9ec389e..1c5b66f 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/JAXRSClient.java
@@ -14,25 +14,40 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.responsemediatype; +package jakarta.ws.rs.tck.spec.resource.responsemediatype; import java.util.List; +import java.io.InputStream; +import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import jakarta.ws.rs.tck.common.JAXRSCommonClient; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response.Status; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JAXRSCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_resource_responsemediatype_web"); } @@ -45,6 +60,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/resource/responsemediatype/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_resource_responsemediatype_web.war"); + archive.addClasses(TSAppConfig.class, MediaResource.class, ErrorResource.class, MediaWriter.class, NoMediaResource.class, StringWriter.class, WeightResource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: responseOverrideTest @@ -55,6 +91,7 @@ * metadata includes the response media type (Mspecified) then set Mselected = * Mspecified, finish. */ + @Test public void responseOverrideTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/responseoverride")); @@ -74,6 +111,7 @@ * * There is no way to get method body through Accept/Produces */ + @Test public void responseNotAllowedToOverrideTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/responseoverride")); @@ -92,6 +130,7 @@ * metadata includes the response media type (Mspecified) then set Mselected = * Mspecified, finish. */ + @Test public void responseOverrideNoProducesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "nomedia/responseoverride")); @@ -111,6 +150,7 @@ * (method) where V (t) represents the values of @Produces on the specified * target t. */ + @Test public void methodProducesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/method")); setProperty(Property.EXPECTED_HEADERS, @@ -126,6 +166,7 @@ * @test_Strategy: Else if the class is annotated with @Produces, set P = V * (class).. */ + @Test public void classProducesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.HEAD, "resource/class")); setProperty(Property.EXPECTED_HEADERS, @@ -141,6 +182,7 @@ * @test_Strategy: Else set P = V (writers) where writers is the set of * MessageBodyWriter that support the class of the returned entity object. */ + @Test public void mesageBodyWriterProducesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "nomedia/list")); setProperty(Property.EXPECTED_HEADERS, @@ -154,6 +196,7 @@ * * @test_Strategy: If P = {}, set P = {*\*}. untestable */ + @Test public void noProducesTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "nomedia/nothing")); setProperty(Property.SEARCH_STRING, "nothing"); @@ -167,6 +210,7 @@ * * @test_Strategy: If P = {}, set P = {*\*}. untestable */ + @Test public void noProducesResponseReturnTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "nomedia/response")); @@ -187,6 +231,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void noPreferenceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "weight")); setProperty(Property.SEARCH_STRING, MediaType.TEXT_PLAIN); @@ -204,6 +249,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void textPreferenceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "weight")); setProperty(Property.REQUEST_HEADERS, "Accept: text/*"); @@ -222,6 +268,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void appPreferenceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "weight")); setProperty(Property.REQUEST_HEADERS, @@ -241,6 +288,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void imagePreferenceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "weight")); setProperty(Property.REQUEST_HEADERS, "Accept: image/*"); @@ -258,6 +306,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void clientImagePreferenceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "weight")); setProperty(Property.REQUEST_HEADERS, @@ -276,6 +325,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void clientXmlHtmlPreferenceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "weight")); setProperty(Property.REQUEST_HEADERS, @@ -295,6 +345,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void clientXmlHtmlPreferenceNoWeightOnServerTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "resource")); setProperty(Property.REQUEST_HEADERS, @@ -314,6 +365,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void clientHtmlXmlPreferenceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "weight")); setProperty(Property.REQUEST_HEADERS, @@ -333,6 +385,7 @@ * specificity (n/m > n\* > *\*), a secondary key of q-value and a tertiary * key of qs-value. */ + @Test public void clientAnyPreferenceTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "weight")); setProperty(Property.REQUEST_HEADERS, "Accept: */*;q=0.8, text/xml;q=0.3"); @@ -353,6 +406,7 @@ * response (HTTP 406 status) and no entity. The exception MUST be processed * as described in section 3.3.4. Finish. */ + @Test public void defaultErrorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "error")); setProperty(Property.REQUEST_HEADERS, "Accept: text/*"); @@ -369,6 +423,7 @@ * response (HTTP 406 status) and no entity. The exception MUST be processed * as described in section 3.3.4. Finish. */ + @Test public void defaultResponseErrorTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.POST, "error")); setProperty(Property.CONTENT, "anything");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/MediaResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/MediaResource.java index 2ddcd41..f8e6271 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/MediaResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/MediaResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.responsemediatype; +package jakarta.ws.rs.tck.spec.resource.responsemediatype; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/MediaWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/MediaWriter.java index 6e80695..39f9bf7 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/MediaWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/MediaWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.responsemediatype; +package jakarta.ws.rs.tck.spec.resource.responsemediatype; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/NoMediaResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/NoMediaResource.java index bbc0846..992bc69 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/NoMediaResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/NoMediaResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.responsemediatype; +package jakarta.ws.rs.tck.spec.resource.responsemediatype; import java.util.List;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/StringWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/StringWriter.java index f436737..842380c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/StringWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/StringWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.responsemediatype; +package jakarta.ws.rs.tck.spec.resource.responsemediatype; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/TSAppConfig.java index f65d2d4..e083472 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.responsemediatype; +package jakarta.ws.rs.tck.spec.resource.responsemediatype; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/WeightResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/WeightResource.java index 0bbf575..5b5172c 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/WeightResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/responsemediatype/WeightResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.responsemediatype; +package jakarta.ws.rs.tck.spec.resource.responsemediatype; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/EnumWithFromStringAndValueOf.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/EnumWithFromStringAndValueOf.java index ee9f7b6..1aefe65 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/EnumWithFromStringAndValueOf.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/EnumWithFromStringAndValueOf.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.valueofandfromstring; +package jakarta.ws.rs.tck.spec.resource.valueofandfromstring; /** * If both methods are present then valueOf MUST be used unless the type is an
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/JAXRSClient.java index e0910c8..f073209 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/JAXRSClient.java
@@ -14,22 +14,39 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.valueofandfromstring; +package jakarta.ws.rs.tck.spec.resource.valueofandfromstring; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; + +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 6626213314312507899L; private static final String DATA = "ASDFGHJKLQWERTYUIOPPPPPPP"; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_resource_valueofandfromstring_web"); } @@ -42,6 +59,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/resource/valueofandfromstring/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_resource_valueofandfromstring_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, EnumWithFromStringAndValueOf.class, ParamEntityWithFromStringAndValueOf.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: enumHeaderTest @@ -51,6 +89,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an enum in which case fromString MUST be used. */ + @Test public void enumHeaderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, "param:" + DATA); setProperty(Property.REQUEST, @@ -68,6 +107,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an enum in which case fromString MUST be used. */ + @Test public void enumCookieTest() throws Fault { setProperty(Property.REQUEST_HEADERS, "Cookie: param=" + DATA); setProperty(Property.REQUEST, @@ -85,6 +125,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an enum in which case fromString MUST be used. */ + @Test public void enumMaxtrixTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/enummatrix;param=" + DATA)); @@ -101,6 +142,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an enum in which case fromString MUST be used. */ + @Test public void enumQueryTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/enumquery?param=" + DATA)); @@ -117,6 +159,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an enum in which case fromString MUST be used. */ + @Test public void enumPathTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/enumpath/" + DATA)); @@ -133,6 +176,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an entity in which case fromString MUST be used. */ + @Test public void entityHeaderTest() throws Fault { setProperty(Property.REQUEST_HEADERS, "param:" + DATA); setProperty(Property.REQUEST, @@ -150,6 +194,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an entity in which case fromString MUST be used. */ + @Test public void entityCookieTest() throws Fault { setProperty(Property.REQUEST_HEADERS, "Cookie: param=" + DATA); setProperty(Property.REQUEST, @@ -167,6 +212,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an entity in which case fromString MUST be used. */ + @Test public void entityMaxtrixTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/entitymatrix;param=" + DATA)); @@ -183,6 +229,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an entity in which case fromString MUST be used. */ + @Test public void entityQueryTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/entityquery?param=" + DATA)); @@ -199,6 +246,7 @@ * @test_Strategy: If both methods are present then valueOf MUST be used * unless the type is an entity in which case fromString MUST be used. */ + @Test public void entityPathTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "resource/entitypath/" + DATA));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/ParamEntityWithFromStringAndValueOf.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/ParamEntityWithFromStringAndValueOf.java index c98d591..bb182a8 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/ParamEntityWithFromStringAndValueOf.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/ParamEntityWithFromStringAndValueOf.java
@@ -14,9 +14,9 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.valueofandfromstring; +package jakarta.ws.rs.tck.spec.resource.valueofandfromstring; -import com.sun.ts.tests.jaxrs.ee.rs.ParamEntityPrototype; +import jakarta.ws.rs.tck.ee.rs.ParamEntityPrototype; /** * If both methods are present then valueOf MUST be used unless the type is an
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/Resource.java index 824237a..6a572fe 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.valueofandfromstring; +package jakarta.ws.rs.tck.spec.resource.valueofandfromstring; import jakarta.ws.rs.CookieParam; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/TSAppConfig.java index 503c344..7668f97 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resource.valueofandfromstring; +package jakarta.ws.rs.tck.spec.resource.valueofandfromstring; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/CookieResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/CookieResource.java index 09fe4b0..6b378da 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/CookieResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/CookieResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resourceconstructor; +package jakarta.ws.rs.tck.spec.resourceconstructor; import jakarta.ws.rs.CookieParam; import jakarta.ws.rs.GET;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/HeaderResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/HeaderResource.java index af4399e..7ab8ea2 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/HeaderResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/HeaderResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resourceconstructor; +package jakarta.ws.rs.tck.spec.resourceconstructor; import jakarta.ws.rs.GET; import jakarta.ws.rs.HeaderParam;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/JAXRSClient.java index 531a1cf..3e25c7a 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/JAXRSClient.java
@@ -14,23 +14,40 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resourceconstructor; +package jakarta.ws.rs.tck.spec.resourceconstructor; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import java.io.InputStream; +import java.io.IOException; + +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; import jakarta.ws.rs.core.Response.Status; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = 1L; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_resourceconstructor_web/resource"); } @@ -43,6 +60,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/resourceconstructor/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_resourceconstructor_web.war"); + archive.addClasses(TSAppConfig.class, Resource.class, CookieResource.class, HeaderResource.class, MatrixResource.class, PathResource.class, QueryResource.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: visibleTest @@ -55,6 +93,7 @@ * A public constructor MAY include parameters annotated with one of the * following: @Context */ + @Test public void visibleTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "mostAttributes")); invoke(); @@ -67,6 +106,7 @@ * * @test_Strategy: Only public methods may be exposed as resource methods. */ + @Test public void packageVisibilityTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "packageVisibility")); @@ -81,6 +121,7 @@ * * @test_Strategy: Only public methods may be exposed as resource methods. */ + @Test public void protectedVisibilityTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "protectedVisibility")); @@ -95,6 +136,7 @@ * * @test_Strategy: Only public methods may be exposed as resource methods. */ + @Test public void privateVisibilityTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "privateVisibility")); @@ -110,6 +152,7 @@ * @test_Strategy: A public constructor MAY include parameters annotated with * one of the following: @HeaderParam */ + @Test public void constructorWithHeaderParamUsedTest() throws Fault { String param = "ABCDEFGH"; setProperty(Property.REQUEST_HEADERS, "param:" + param); @@ -126,6 +169,7 @@ * @test_Strategy: A public constructor MAY include parameters annotated with * one of the following: @HeaderParam */ + @Test public void constructorWithCookieParamUsedTest() throws Fault { String param = "ABCDEFGH"; setProperty(Property.REQUEST_HEADERS, "Cookie: param=" + param); @@ -142,6 +186,7 @@ * @test_Strategy: A public constructor MAY include parameters annotated with * one of the following: @MatrixParam */ + @Test public void constructorWithMatrixParamUsedTest() throws Fault { String param = "ABCDEFGH"; setProperty(Property.REQUEST, @@ -158,6 +203,7 @@ * @test_Strategy: A public constructor MAY include parameters annotated with * one of the following: @QueryParam */ + @Test public void constructorWithQueryParamUsedTest() throws Fault { String param = "ABCDEFGH"; setProperty(Property.REQUEST, @@ -174,6 +220,7 @@ * @test_Strategy: A public constructor MAY include parameters annotated with * one of the following: @PathParam */ + @Test public void constructorWithPathParamUsedTest() throws Fault { String param = "ABCDEFGH"; setProperty(Property.REQUEST, buildRequest(Request.GET, "path/" + param));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/MatrixResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/MatrixResource.java index 76b1a67..ca1d95d 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/MatrixResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/MatrixResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resourceconstructor; +package jakarta.ws.rs.tck.spec.resourceconstructor; import jakarta.ws.rs.GET; import jakarta.ws.rs.MatrixParam;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/PathResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/PathResource.java index 78e5191..3b7a9c3 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/PathResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/PathResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resourceconstructor; +package jakarta.ws.rs.tck.spec.resourceconstructor; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/QueryResource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/QueryResource.java index f7e59b5..d9f0950 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/QueryResource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/QueryResource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resourceconstructor; +package jakarta.ws.rs.tck.spec.resourceconstructor; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/Resource.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/Resource.java index 3be3152..d3e0ef4 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/Resource.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/Resource.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resourceconstructor; +package jakarta.ws.rs.tck.spec.resourceconstructor; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/TSAppConfig.java index 8484a27..5793835 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/resourceconstructor/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.resourceconstructor; +package jakarta.ws.rs.tck.spec.resourceconstructor; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/JAXRSClient.java index 75edafd..0f1b449 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/JAXRSClient.java
@@ -14,25 +14,41 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.returntype; +package jakarta.ws.rs.tck.spec.returntype; import java.util.UUID; +import java.io.InputStream; +import java.io.IOException; -import com.sun.ts.tests.jaxrs.common.client.JaxrsCommonClient; +import jakarta.ws.rs.tck.common.client.JaxrsCommonClient; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response.Status; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; + /* * @class.setup_props: webServerHost; * webServerPort; - * ts_home; */ -public class JAXRSClient extends JaxrsCommonClient { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JaxrsCommonClient { private static final long serialVersionUID = ReturnTypeTest.serialVersionUID; - public JAXRSClient() { + public JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_returntype_web/ReturnTypeTest"); } @@ -45,6 +61,27 @@ new JAXRSClient().run(args); } + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/returntype/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_returntype_web.war"); + archive.addClasses(TSAppConfig.class, ReturnTypeTest.class, UUIDWriter.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; + } + + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); + } + + /* Run test */ /* * @testName: voidTest @@ -55,6 +92,7 @@ * @test_Strategy: Client sends a request on a resource at * /ReturnTypeTest/void, Verify that 204 status returned. */ + @Test public void voidTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "void")); setProperty(Property.STATUS_CODE, getStatusCode(Status.NO_CONTENT)); @@ -70,6 +108,7 @@ * @test_Strategy: Response: 204 status code is used if the entity property is * null. */ + @Test public void nullEntityResponseTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "nullEntityResponse")); @@ -85,6 +124,7 @@ * * @test_Strategy: Response: A null return value results in a 204 status code. */ + @Test public void nullResponseTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "nullResponse")); setProperty(Property.STATUS_CODE, getStatusCode(Status.NO_CONTENT)); @@ -100,6 +140,7 @@ * @test_Strategy: Client sends a request on a resource at * /ReturnTypeTest/get, Verify that 204 status returned. */ + @Test public void nullGenericEntityTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "nullGenericEntityTest")); @@ -117,6 +158,7 @@ * of the GenericEntity. If the return value is not null a 200 status code is * used */ + @Test public void genericEntityTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "genericEntityTest")); @@ -133,6 +175,7 @@ * * @test_Strategy: a null return value results in a 204 status code. */ + @Test public void nullEntityTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "nullEntityTest")); setProperty(Property.STATUS_CODE, getStatusCode(Status.NO_CONTENT)); @@ -147,6 +190,7 @@ * * @test_Strategy: a null return value results in a 204 status code. */ + @Test public void defaultStatusTest() throws Fault { setProperty(Property.REQUEST, buildRequest(Request.GET, "default")); setProperty(Property.SEARCH_STRING, "I am OK"); @@ -163,6 +207,7 @@ * the returned instance. If the return value is not null a 200 status code is * used */ + @Test public void entityBodyTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildAccept(MediaType.TEXT_XML_TYPE)); setProperty(Property.REQUEST, buildRequest(Request.GET, "entitybodytest")); @@ -179,6 +224,7 @@ * @test_Strategy:If the status property of the Response is not set: a 200 * status code is used for a non-null entity property */ + @Test public void entityResponseTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildAccept(MediaType.TEXT_XML_TYPE)); setProperty(Property.REQUEST, @@ -195,6 +241,7 @@ * @test_Strategy: Client sends a request on a resource at * /ReturnTypeTest/notAcceptable, Verify that 406 status returned. */ + @Test public void notAcceptableTest() throws Fault { setProperty(Property.REQUEST_HEADERS, buildAccept(MediaType.TEXT_HTML_TYPE));
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/ReturnTypeTest.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/ReturnTypeTest.java index 846ced3..313724b 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/ReturnTypeTest.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/ReturnTypeTest.java
@@ -14,11 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.returntype; +package jakarta.ws.rs.tck.spec.returntype; import java.util.UUID; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/TSAppConfig.java index 75c53cf..e774fed 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/TSAppConfig.java
@@ -14,12 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.returntype; +package jakarta.ws.rs.tck.spec.returntype; import java.util.HashSet; import java.util.Set; -import com.sun.ts.tests.jaxrs.ee.rs.ext.messagebodyreaderwriter.EntityMessageWriter; +import jakarta.ws.rs.tck.ee.rs.ext.messagebodyreaderwriter.EntityMessageWriter; import jakarta.ws.rs.core.Application;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/UUIDWriter.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/UUIDWriter.java index c3391d5..eb0185e 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/UUIDWriter.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/returntype/UUIDWriter.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.returntype; +package jakarta.ws.rs.tck.spec.returntype; import java.io.IOException; import java.io.OutputStream;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/JAXRSClient.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/JAXRSClient.java index b6b9e72..f8d2aab 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/JAXRSClient.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/JAXRSClient.java
@@ -14,37 +14,54 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.template; +package jakarta.ws.rs.tck.spec.template; import java.io.PrintWriter; +import java.io.InputStream; +import java.io.IOException; -import com.sun.javatest.Status; -import com.sun.ts.tests.jaxrs.common.JAXRSCommonClient; +import jakarta.ws.rs.tck.common.JAXRSCommonClient; -public class JAXRSClient extends JAXRSCommonClient { +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.AfterEach; - public void JAXRSClient() { +@ExtendWith(ArquillianExtension.class) +public class JAXRSClientIT extends JAXRSCommonClient { + + public void JAXRSClientIT() { + setup(); setContextRoot("/jaxrs_spec_templateTest_web"); } - /** - * Entry point for different-VM execution. It should delegate to method - * run(String[], PrintWriter, PrintWriter), and this method should not contain - * any test configuration. - */ - public static void main(String[] args) { - JAXRSClient theTests = new JAXRSClient(); - Status s = theTests.run(args, new PrintWriter(System.out), - new PrintWriter(System.err)); - s.exit(); + + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException{ + InputStream inStream = JAXRSClientIT.class.getClassLoader().getResourceAsStream("jakarta/ws/rs/tck/spec/templateTest/web.xml.template"); + String webXml = editWebXmlString(inStream); + WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxrs_spec_templateTest_web.war"); + archive.addClasses(TSAppConfig.class, TemplateTest.class); + archive.setWebXML(new StringAsset(webXml)); + return archive; } - /** - * Entry point for same-VM execution. In different-VM execution, the main - * method delegates to this method. - */ - public Status run(String[] args, PrintWriter out, PrintWriter err) { - return super.run(args, out, err); + @BeforeEach + void logStartTest(TestInfo testInfo) { + TestUtil.logMsg("STARTING TEST : "+testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + TestUtil.logMsg("FINISHED TEST : "+testInfo.getDisplayName()); } /* @@ -59,6 +76,7 @@ * @test_Strategy: Client sends a request on a resource at /TemplateTest/{id}, * Verify that correct resource method invoked through use of URI Template */ + @Test public void Test1() throws Fault { setProperty(REQUEST, "GET " + "/jaxrs_spec_templateTest_web/TemplateTest/xyz HTTP/1.1"); @@ -75,6 +93,7 @@ * @test_Strategy:Client sends a request on a resource at /TemplateTest/{id], * Verify that correct resource method invoked through use of URI Template */ + @Test public void Test2() throws Fault { setProperty(REQUEST, "GET " + "/jaxrs_spec_templateTest_web/TemplateTest/xyz/abc HTTP/1.1"); @@ -91,6 +110,7 @@ * @test_Strategy:Client sends a request on a resource at /TemplateTest/{id], * Verify that correct resource method invoked through use of URI Template */ + @Test public void Test3() throws Fault { setProperty(REQUEST, "GET " + "/jaxrs_spec_templateTest_web/TemplateTest/xyz/abc/def HTTP/1.1"); @@ -107,6 +127,7 @@ * @test_Strategy:Client sends a request on a resource at /TemplateTest/{id], * Verify that correct resource method invoked through use of URI Template */ + @Test public void Test4() throws Fault { setProperty(REQUEST, "GET " + "/jaxrs_spec_templateTest_web/TemplateTest/xy/abc/def HTTP/1.1"); @@ -123,6 +144,7 @@ * @test_Strategy:Client sends a request on a resource at /TemplateTest/{id], * Verify that correct resource method invoked through use of URI Template */ + @Test public void Test5() throws Fault { setProperty(REQUEST, "GET " + "/jaxrs_spec_templateTest_web/TemplateTest/abc/test.html HTTP/1.1"); @@ -139,6 +161,7 @@ * @test_Strategy:Client sends a request on a resource at /TemplateTest/{id], * Verify that correct resource method invoked through use of URI Template */ + @Test public void Test6() throws Fault { setProperty(REQUEST, "GET " + "/jaxrs_spec_templateTest_web/TemplateTest/abc/def/test.xml HTTP/1.1");
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/TSAppConfig.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/TSAppConfig.java index bd8551d..e446918 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/TSAppConfig.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/TSAppConfig.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.template; +package jakarta.ws.rs.tck.spec.template; import java.util.HashSet; import java.util.Set;
diff --git a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/TemplateTest.java b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/TemplateTest.java index 3b97d75..19d5834 100644 --- a/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/TemplateTest.java +++ b/jaxrs-tck/src/main/java/jakarta/ws/rs/tck/spec/template/TemplateTest.java
@@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package com.sun.ts.tests.jaxrs.spec.template; +package jakarta.ws.rs.tck.spec.template; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path;
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/invocations/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/invocations/web.xml.template index 629e97c..193a009 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/invocations/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/invocations/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.client.invocations.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.client.invocations.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/resource/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/resource/web.xml.template index f6ec41e..c7006d4 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/resource/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/resource/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.client.resource.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.client.resource.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/web.xml.template index 6f535ad..8c64936 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/typedentitieswithxmlbinding/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.client.typedentitieswithxmlbinding.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.client.typedentitieswithxmlbinding.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/typeidentities/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/typeidentities/web.xml.template index 0a0209a..d8b0233 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/typeidentities/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/client/typeidentities/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.client.typedentities.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.client.typedentities.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/context/client/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/context/client/web.xml.template index ec5c436..1c8c5bf 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/context/client/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/context/client/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.context.client.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.context.client.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/context/server/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/context/server/web.xml.template index 01c6216..c0a9c39 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/context/server/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/context/server/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.context.server.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.context.server.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/dynamicfeature/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/dynamicfeature/web.xml.template index f99c401..34d7cee 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/dynamicfeature/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/dynamicfeature/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.filter.dynamicfeature.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.filter.dynamicfeature.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/exception/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/exception/web.xml.template index b317cdc..5116bcd 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/exception/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/exception/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.filter.exception.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.filter.exception.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/globalbinding/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/globalbinding/web.xml.template index 3ea4095..3295bf9 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/globalbinding/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/globalbinding/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.filter.globalbinding.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.filter.globalbinding.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/interceptor/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/interceptor/web.xml.template index b1989d1..99324f8 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/interceptor/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/interceptor/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.filter.interceptor.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.filter.interceptor.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/lastvalue/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/lastvalue/web.xml.template index 42fdb97..2cb95db 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/lastvalue/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/lastvalue/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.filter.lastvalue.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.filter.lastvalue.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/namebinding/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/namebinding/web.xml.template index 0ae3051..19e146d 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/namebinding/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/filter/namebinding/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.filter.namebinding.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.filter.namebinding.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/inheritance/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/inheritance/web.xml.template index 5ed2eff..a83a159 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/inheritance/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/inheritance/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.inheritance.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.inheritance.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/exceptionmapper/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/exceptionmapper/web.xml.template index 3b64627..7c540d6 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/exceptionmapper/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/exceptionmapper/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.exceptionmapper.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.exceptionmapper.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/jaxbcontext/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/jaxbcontext/web.xml.template index 169faef..692a5f0 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/jaxbcontext/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/jaxbcontext/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.jaxbcontext.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.jaxbcontext.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/overridestandard/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/overridestandard/web.xml.template index a7c69da..fe9e1ef 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/overridestandard/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/overridestandard/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.overridestandard.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.overridestandard.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/reader/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/reader/web.xml.template index 4642e2e..d2bdc06 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/reader/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/reader/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.reader.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.reader.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/sort/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/sort/web.xml.template index 6526152..a249123 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/sort/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/sort/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.sort.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.sort.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standard/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standard/web.xml.template index b655db1..3095ea1 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standard/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standard/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.standard.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.standard.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardhaspriority/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardhaspriority/web.xml.template index 47771d0..f0eb58e 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardhaspriority/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardhaspriority/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.standardhaspriority.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardnotnull/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardnotnull/web.xml.template index 0d27cac..0f15c23 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardnotnull/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardnotnull/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.standardnotnull.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.standardnotnull.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/web.xml.template index 25f8a0a..d1bb535 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardwithjaxrsclient/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.standardwithjaxrsclient.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.standardwithjaxrsclient.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/web.xml.template index dd7b951..c51da8a 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/standardwithxmlbinding/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.standardwithxmlbinding.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.standardwithxmlbinding.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/visibility/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/visibility/web.xml.template index bd99fdf..611c7d4 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/visibility/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/visibility/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.visibility.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.visibility.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/writer/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/writer/web.xml.template index ad6f366..0201816 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/writer/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/provider/writer/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.provider.writer.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.provider.writer.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/web.xml.template index c9804db..8c11d50 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/annotationprecedence/subclass/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence.subclass.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.resource.annotationprecedence.subclass.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/annotationprecedence/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/annotationprecedence/web.xml.template index f7f1a94..91e2d9c 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/annotationprecedence/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/annotationprecedence/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.resource.annotationprecedence.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.resource.annotationprecedence.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/locator/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/locator/web.xml.template index b6ae649..905515a 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/locator/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/locator/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.resource.locator.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.resource.locator.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/requestmatching/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/requestmatching/web.xml.template index e4b967d..3d346d7 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/requestmatching/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/requestmatching/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.resource.requestmatching.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.resource.requestmatching.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/responsemediatype/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/responsemediatype/web.xml.template index bf24446..09f482d 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/responsemediatype/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/responsemediatype/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.resource.responsemediatype.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.resource.responsemediatype.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/web.xml.template index 7bd4efc..58218bb 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resource/valueofandfromstring/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.resource.valueofandfromstring.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.resource.valueofandfromstring.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resourceconstructor/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resourceconstructor/web.xml.template index 7a6bca1..562e189 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resourceconstructor/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/resourceconstructor/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.resourceconstructor.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.resourceconstructor.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/returntype/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/returntype/web.xml.template index e3ea772..bee890f 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/returntype/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/returntype/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.returntype.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.returntype.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
diff --git a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/template/web.xml.template b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/template/web.xml.template index a0765ae..c6b2fbd 100644 --- a/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/template/web.xml.template +++ b/jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/spec/template/web.xml.template
@@ -23,7 +23,7 @@ <servlet-class>servlet_adaptor</servlet-class> <init-param> <param-name>jakarta.ws.rs.Application</param-name> - <param-value>com.sun.ts.tests.jaxrs.spec.template.TSAppConfig</param-value> + <param-value>jakarta.ws.rs.tck.spec.template.TSAppConfig</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>