Removes JaxbLink and related classes and tests (#1232)
* Removes JaxbLink and related classes and tests. Include some minor cleanup of versions and version management in pom files too.
* Updates copyright headers.
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
---------
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
diff --git a/jaxrs-api/pom.xml b/jaxrs-api/pom.xml
index ac9d90c..55749c1 100644
--- a/jaxrs-api/pom.xml
+++ b/jaxrs-api/pom.xml
@@ -95,72 +95,10 @@
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
<dependency>
- <groupId>jakarta.xml.bind</groupId>
- <artifactId>jakarta.xml.bind-api</artifactId>
- </dependency>
- <dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
- <!-- JAXB Implementation -->
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>codemodel</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-jxc</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-runtime</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>txw2</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-xjc</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>xsom</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.sun.istack</groupId>
- <artifactId>istack-commons-runtime</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.istack</groupId>
- <artifactId>istack-commons-tools</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind.external</groupId>
- <artifactId>relaxng-datatype</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind.external</groupId>
- <artifactId>rngom</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- End JAXB Implementation -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Link.java b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Link.java
index 6f03b86..dbd415c 100644
--- a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Link.java
+++ b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Link.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 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
@@ -16,18 +16,11 @@
package jakarta.ws.rs.core;
-import javax.xml.namespace.QName;
import java.net.URI;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
-import java.util.Map.Entry;
import jakarta.ws.rs.ext.RuntimeDelegate;
-import jakarta.xml.bind.annotation.XmlAnyAttribute;
-import jakarta.xml.bind.annotation.XmlAttribute;
-import jakarta.xml.bind.annotation.adapters.XmlAdapter;
/**
* <p>
@@ -402,187 +395,4 @@
*/
public Link buildRelativized(URI uri, Object... values);
}
-
- /**
- * Value type for {@link jakarta.ws.rs.core.Link} that can be marshalled and
- * unmarshalled by JAXB.
- *
- * Note that usage of this class requires the Jakarta XML Binding API and an implementation. The Jakarta RESTful Web
- * Services implementation is not required to provide these dependencies.
- *
- * @see jakarta.ws.rs.core.Link.JaxbAdapter
- * @since 2.0
- * @deprecated
- */
- @Deprecated
- public static class JaxbLink {
-
- private URI uri;
- private Map<QName, Object> params;
-
- /**
- * Default constructor needed during unmarshalling.
- */
- public JaxbLink() {
- }
-
- /**
- * Construct an instance from a URI and no parameters.
- *
- * @param uri underlying URI.
- */
- public JaxbLink(final URI uri) {
- this.uri = uri;
- }
-
- /**
- * Construct an instance from a URI and some parameters.
- *
- * @param uri underlying URI.
- * @param params parameters of this link.
- */
- public JaxbLink(final URI uri, final Map<QName, Object> params) {
- this.uri = uri;
- this.params = params;
- }
-
- /**
- * Get the underlying URI for this link.
- *
- * @return underlying URI.
- */
- @XmlAttribute(name = "href")
- public URI getUri() {
- return uri;
- }
-
- /**
- * Get the parameter map for this link.
- *
- * @return parameter map.
- */
- @XmlAnyAttribute
- public Map<QName, Object> getParams() {
- if (params == null) {
- params = new HashMap<QName, Object>();
- }
- return params;
- }
-
- /**
- * Set the underlying URI for this link.
- *
- * This setter is needed for JAXB unmarshalling.
- */
- void setUri(final URI uri) {
- this.uri = uri;
- }
-
- /**
- * Set the parameter map for this link.
- *
- * This setter is needed for JAXB unmarshalling.
- */
- void setParams(final Map<QName, Object> params) {
- this.params = params;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof JaxbLink)) {
- return false;
- }
-
- JaxbLink jaxbLink = (JaxbLink) o;
-
- if (uri != null ? !uri.equals(jaxbLink.uri) : jaxbLink.uri != null) {
- return false;
- }
-
- if (params == jaxbLink.params) {
- return true;
- }
- if (params == null) {
- // if this.params is 'null', consider other.params equal to empty
- return jaxbLink.params.isEmpty();
- }
- if (jaxbLink.params == null) {
- // if other.params is 'null', consider this.params equal to empty
- return params.isEmpty();
- }
-
- return params.equals(jaxbLink.params);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(uri, params);
- }
-
- }
-
- /**
- * An implementation of JAXB {@link jakarta.xml.bind.annotation.adapters.XmlAdapter} that maps the JAX-RS
- * {@link jakarta.ws.rs.core.Link} type to a value that can be marshalled and unmarshalled by JAXB. The following example
- * shows how to use this adapter on a JAXB bean class:
- *
- * <pre>
- * @XmlRootElement
- * public class MyModel {
- *
- * private Link link;
- *
- * @XmlElement(name="link")
- * @XmlJavaTypeAdapter(JaxbAdapter.class)
- * public Link getLink() {
- * return link;
- * }
- * ...
- * }
- * </pre>
- *
- * Note that usage of this class requires the Jakarta XML Binding API and an implementation. The Jakarta RESTful Web
- * Services implementation is not required to provide these dependencies.
- *
- * @see jakarta.ws.rs.core.Link.JaxbLink
- * @since 2.0
- * @deprecated
- */
- @Deprecated
- public static class JaxbAdapter extends XmlAdapter<JaxbLink, Link> {
-
- /**
- * Convert a {@link JaxbLink} into a {@link Link}.
- *
- * @param v instance of type {@link JaxbLink}.
- * @return mapped instance of type {@link JaxbLink}
- */
- @Override
- public Link unmarshal(final JaxbLink v) {
- Link.Builder lb = Link.fromUri(v.getUri());
- for (Entry<QName, Object> e : v.getParams().entrySet()) {
- lb.param(e.getKey().getLocalPart(), e.getValue().toString());
- }
- return lb.build();
- }
-
- /**
- * Convert a {@link Link} into a {@link JaxbLink}.
- *
- * @param v instance of type {@link Link}.
- * @return mapped instance of type {@link JaxbLink}.
- */
- @Override
- public JaxbLink marshal(final Link v) {
- JaxbLink jl = new JaxbLink(v.getUri());
- for (Entry<String, String> e : v.getParams().entrySet()) {
- final String name = e.getKey();
- jl.getParams().put(new QName("", name), e.getValue());
- }
- return jl;
- }
- }
}
diff --git a/jaxrs-api/src/main/java/module-info.java b/jaxrs-api/src/main/java/module-info.java
index aa24390..b0dd78b 100644
--- a/jaxrs-api/src/main/java/module-info.java
+++ b/jaxrs-api/src/main/java/module-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2021 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017 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
@@ -19,8 +19,6 @@
*/
module jakarta.ws.rs {
- requires static jakarta.xml.bind;
-
requires java.logging;
exports jakarta.ws.rs;
@@ -33,6 +31,4 @@
uses jakarta.ws.rs.client.ClientBuilder;
uses jakarta.ws.rs.ext.RuntimeDelegate;
uses jakarta.ws.rs.sse.SseEventSource.Builder;
-
- opens jakarta.ws.rs.core to jakarta.xml.bind;
}
diff --git a/jaxrs-api/src/test/java/jakarta/ws/rs/core/JaxbLinkTest.java b/jaxrs-api/src/test/java/jakarta/ws/rs/core/JaxbLinkTest.java
deleted file mode 100644
index 99af1e7..0000000
--- a/jaxrs-api/src/test/java/jakarta/ws/rs/core/JaxbLinkTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2014, 2021 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.core;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.stream.StreamSource;
-
-import org.junit.jupiter.api.Test;
-
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.JAXBElement;
-import jakarta.xml.bind.Marshaller;
-import jakarta.xml.bind.Unmarshaller;
-
-/**
- * Unit test for JAX-RS Link marshalling and unmarshalling via JAXB.
- *
- * @author Marek Potociar (marek.potociar at oracle.com)
- */
-public class JaxbLinkTest {
-
- @Test
- public void testSerializationOfJaxbLink() throws Exception {
- JAXBContext jaxbContext = JAXBContext.newInstance(Link.JaxbLink.class);
- final Marshaller marshaller = jaxbContext.createMarshaller();
- final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
-
- Map<QName, Object> expectedParams = new HashMap<QName, Object>();
- final QName qName = new QName("http://example.ns", "foo");
- expectedParams.put(qName, "test");
- final URI expectedUri = URI.create("/foo/bar");
- Link.JaxbLink expected = new Link.JaxbLink(expectedUri, expectedParams);
-
- final StringWriter writer = new StringWriter();
-
- JAXBElement<Link.JaxbLink> jaxbLinkJAXBElement = new JAXBElement<Link.JaxbLink>(new QName("", "link"), Link.JaxbLink.class, expected);
- marshaller.marshal(jaxbLinkJAXBElement, writer);
-
- final Link.JaxbLink actual = unmarshaller.unmarshal(new StreamSource(
- new StringReader(writer.toString())), Link.JaxbLink.class).getValue();
-
- assertEquals(expected, actual, "Unmarshalled JaxbLink instance not equal to the marshalled one.");
- assertEquals(expectedUri, actual.getUri(), "Unmarshalled JaxbLink instance URI not equal to original.");
- assertEquals(expectedParams, actual.getParams(), "Unmarshalled JaxbLink instance params not equal to original.");
- }
-
- @Test
- public void testEqualsHashCode() throws Exception {
- Link.JaxbLink first = new Link.JaxbLink();
- Link.JaxbLink second = new Link.JaxbLink();
-
- // trigger lazy initialization on first
- first.getParams();
-
- assertThat(first, equalTo(second));
- assertThat(second, equalTo(first));
- assertThat(first.hashCode(), equalTo(second.hashCode()));
- }
-}
diff --git a/jaxrs-tck/pom.xml b/jaxrs-tck/pom.xml
index 3f336b4..f87f056 100644
--- a/jaxrs-tck/pom.xml
+++ b/jaxrs-tck/pom.xml
@@ -34,6 +34,15 @@
<version>4.0.0-SNAPSHOT</version>
</parent>
+ <properties>
+ <json.api.version>2.0.1</json.api.version>
+ <json.bind.api.version>2.0.0</json.bind.api.version>
+ <xml.bind.api.version>4.0.0</xml.bind.api.version>
+ <servlet.api.version>6.0.0</servlet.api.version>
+ <common.httpclient.version>3.1</common.httpclient.version>
+ <arquillian.version>1.8.0.Final</arquillian.version>
+ </properties>
+
<dependencies>
<dependency>
<groupId>jakarta.ws.rs</groupId>
@@ -44,13 +53,13 @@
<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
- <version>2.0.0</version>
+ <version>${json.bind.api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
- <version>2.0.1</version>
+ <version>${json.api.version}</version>
</dependency>
<dependency>
@@ -61,7 +70,7 @@
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
+ <version>${common.httpclient.version}</version>
</dependency>
<dependency>
@@ -72,7 +81,7 @@
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
- <version>1.8.0.Final</version>
+ <version>${arquillian.version}</version>
</dependency>
<dependency>
@@ -83,6 +92,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
+ <version>${xml.bind.api.version}</version>
</dependency>
<dependency>
@@ -93,7 +103,7 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
- <version>6.0.0</version>
+ <version>${servlet.api.version}</version>
<scope>provided</scope>
</dependency>
diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JAXRSClientIT.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JAXRSClientIT.java
deleted file mode 100644
index 6b4d33e..0000000
--- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JAXRSClientIT.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2014, 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 ee.jakarta.tck.ws.rs.api.rs.core.linkjaxbadapter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.nio.charset.Charset;
-
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
-
-import jakarta.ws.rs.core.Link;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.ext.RuntimeDelegate;
-import ee.jakarta.tck.ws.rs.common.JAXRSCommonClient;
-import ee.jakarta.tck.ws.rs.lib.util.TestUtil;
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.JAXBException;
-import jakarta.xml.bind.Marshaller;
-import jakarta.xml.bind.Unmarshaller;
-
-import org.junit.jupiter.api.Tag;
-
-/*
- * @class.setup_props: webServerHost;
- * webServerPort;
- * ts_home;
- */
-public class JAXRSClientIT extends JAXRSCommonClient {
-
- private static final long serialVersionUID = -5902280515880564932L;
-
- protected static final String url = "some://where.at:port/";
-
- protected static final String rel = "Relation";
-
- protected static final String media = MediaType.APPLICATION_SVG_XML;
-
- protected static final String title = "XTitleX";
-
- protected static final String[] param_names = { "name1", "name2" };
-
- protected static final String[] param_vals = { "val1", "val2" };
-
- @BeforeEach
- void logStartTest(TestInfo testInfo) {
- TestUtil.logMsg("STARTING TEST : " + testInfo.getDisplayName());
- }
-
- @AfterEach
- void logFinishTest(TestInfo testInfo) {
- TestUtil.logMsg("FINISHED TEST : " + testInfo.getDisplayName());
- }
-
- /*
- * @testName: marshallTest
- *
- * @assertion_ids: JAXRS:JAVADOC:815; JAXRS:JAVADOC:816;
- *
- * @test_Strategy:
- */
- @Test
- @Tag("xml_binding")
- public void marshallTest() throws Fault {
- Link link = RuntimeDelegate.getInstance().createLinkBuilder().uri(url).title(title).rel(rel).type(media)
- .param(param_names[0], param_vals[0]).param(param_names[1], param_vals[1]).build();
- Model model = new Model(link);
-
- ByteArrayOutputStream ostream = new ByteArrayOutputStream(1000);
- JAXBContext jc = null;
- Marshaller marshaller = null;
- byte[] array = null;
- try {
- jc = JAXBContext.newInstance(Model.class);
- marshaller = jc.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- marshaller.marshal(model, ostream);
-
- array = ostream.toByteArray();
- String string = new String(array, Charset.defaultCharset());
- assertContains(string, "link href=", "Marshalled Link", string,
- "does not contain expected uri reference field");
- assertContains(string, url, "Marshalled Link", string, " does not contain expected uri reference", url);
- assertContains(string, media, "MediaType has not been marshalled in", string);
- assertContains(string, title, "Title has not been marshalled in", string);
- assertContains(string, rel, "Relation has not been marshalled in", string);
- assertContains(string, param_names[0], "parameter name", param_names[0], "has not been marshalled in",
- string);
- assertContains(string, param_names[1], "parameter name", param_names[1], "has not been marshalled in",
- string);
- assertContains(string, param_vals[0], "parameter value", param_vals[0], "has not been marshalled in",
- string);
- assertContains(string, param_vals[1], "parameter value", param_vals[1], "has not been marshalled in",
- string);
- logMsg("Marshalled Link contains expected", string);
- } catch (JAXBException e) {
- throw new Fault(e);
- }
- //return array;
- }
-
- /*
- * @testName: unmarshallTest
- *
- * @assertion_ids: JAXRS:JAVADOC:815; JAXRS:JAVADOC:816; JAXRS:JAVADOC:818;
- *
- * @test_Strategy: Test whether a class with Link can be unmarshalled fine
- */
- @Test
- @Tag("xml_binding")
- public void unmarshallTest() throws Fault {
-
- Link link = RuntimeDelegate.getInstance().createLinkBuilder().uri(url).title(title).rel(rel).type(media)
- .param(param_names[0], param_vals[0]).param(param_names[1], param_vals[1]).build();
- Model model = new Model(link);
-
- ByteArrayOutputStream ostream = new ByteArrayOutputStream(1000);
- JAXBContext jc = null;
- Marshaller marshaller = null;
- byte[] array = null;
-
-
- Unmarshaller unmarshaller = null;
- ByteArrayInputStream istream = null;
- Model unmarshalledModel = null;
- try {
-
- jc = JAXBContext.newInstance(Model.class);
- marshaller = jc.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- marshaller.marshal(model, ostream);
- array = ostream.toByteArray();
-
- istream = new ByteArrayInputStream(array);
-
- jc = JAXBContext.newInstance(Model.class);
- unmarshaller = jc.createUnmarshaller();
- unmarshalledModel = (Model) unmarshaller.unmarshal(istream);
- link = unmarshalledModel.getLink();
-
- assertContains(link.toString(), url, "unmarshalled link", link, "does not contain expected url", url);
- assertContains(link.getRel(), rel, "unmarshalled link", link, "does not contain expected relation", rel);
- assertContains(link.getTitle(), title, "unmarshalled link", link, "does not contain expected title", title);
- assertContains(link.getType(), media, "unmarshalled link", link, "does not contain expected media type",
- media);
- assertTrue(link.getParams().size() > 2,
- "unmarshalled link " + link + " does not contain expected parameters");
- assertContains(link.getParams().get(param_names[0]), param_vals[0], "unmarshalled link", link,
- "does not contain expected parameter", param_names[0], "=", param_vals[0]);
- assertContains(link.getParams().get(param_names[1]), param_vals[1], "unmarshalled link", link,
- "does not contain expected parameter", param_names[1], "=", param_vals[1]);
- logMsg("unmarshalled Link contains expected url, title, media type, and parameters", link);
- } catch (JAXBException e) {
- throw new Fault(e);
- }
- }
-}
diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JaxbAdapterEx.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JaxbAdapterEx.java
deleted file mode 100644
index a8b9192..0000000
--- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JaxbAdapterEx.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014, 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 ee.jakarta.tck.ws.rs.api.rs.core.linkjaxbadapter;
-
-import jakarta.ws.rs.core.Link;
-import jakarta.ws.rs.core.Link.JaxbAdapter;
-import jakarta.ws.rs.core.Link.JaxbLink;
-import jakarta.xml.bind.annotation.adapters.XmlAdapter;
-
-public class JaxbAdapterEx extends XmlAdapter<JaxbLinkEx, Link> {
-
- /**
- * Convert a {@link JaxbLink} into a {@link Link}.
- *
- * @param v instance of type {@link JaxbLink}.
- * @return mapped instance of type {@link JaxbLink}
- */
- @Override
- public Link unmarshal(JaxbLinkEx ex) {
- JaxbLink link = new JaxbLink(ex.getUri(), ex.getParams());
- return new JaxbAdapter().unmarshal(link);
- }
-
- /**
- * Convert a {@link Link} into a {@link JaxbLink}.
- *
- * @param v instance of type {@link Link}.
- * @return mapped instance of type {@link JaxbLink}.
- */
- @Override
- public JaxbLinkEx marshal(Link v) {
- JaxbLink link = new JaxbAdapter().marshal(v);
- JaxbLinkEx jle = new JaxbLinkEx(link.getUri(), link.getParams());
- return jle;
- }
-}
diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JaxbLinkEx.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JaxbLinkEx.java
deleted file mode 100644
index c22a258..0000000
--- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/JaxbLinkEx.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2014, 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 ee.jakarta.tck.ws.rs.api.rs.core.linkjaxbadapter;
-
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import jakarta.xml.bind.annotation.XmlAnyAttribute;
-import jakarta.xml.bind.annotation.XmlAttribute;
-import jakarta.xml.bind.annotation.XmlRootElement;
-
-/**
- * JaxbLink with setters and xml annotations
- */
-@XmlRootElement
-public class JaxbLinkEx {
-
- protected URI uri;
-
- protected Map<QName, Object> params;
-
- /**
- * Default constructor needed during unmarshalling.
- */
- public JaxbLinkEx() {
- }
-
- /**
- * Construct an instance from a URI and no parameters.
- *
- * @param uri underlying URI.
- */
- public JaxbLinkEx(URI uri) {
- this.uri = uri;
- }
-
- /**
- * Construct an instance from a URI and some parameters.
- *
- * @param uri underlying URI.
- * @param params parameters of this link.
- */
- public JaxbLinkEx(URI uri, Map<QName, Object> params) {
- this.uri = uri;
- this.params = params;
- }
-
- /**
- * Get the underlying URI for this link.
- *
- * @return underlying URI.
- */
- @XmlAttribute(name = "href")
- public URI getUri() {
- return uri;
- }
-
- /**
- * Get the parameter map for this link.
- *
- * @return parameter map.
- */
- @XmlAnyAttribute
- public Map<QName, Object> getParams() {
- if (params == null) {
- params = new HashMap<QName, Object>();
- }
- return params;
- }
-
- public void setUri(final URI uri) {
- this.uri = uri;
- }
-
- public void setParams(final Map<QName, Object> params) {
- this.params = params;
- }
-}
diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/Model.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/Model.java
deleted file mode 100644
index f1f11bb..0000000
--- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxbadapter/Model.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014, 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 ee.jakarta.tck.ws.rs.api.rs.core.linkjaxbadapter;
-
-import jakarta.ws.rs.core.Link;
-import jakarta.ws.rs.ext.RuntimeDelegate;
-import jakarta.xml.bind.annotation.XmlAccessType;
-import jakarta.xml.bind.annotation.XmlAccessorType;
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlRootElement;
-import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.FIELD)
-public class Model {
-
- public Model(Link link) {
- super();
- this.link = link;
- }
-
- public Model() {
- link = RuntimeDelegate.getInstance().createLinkBuilder().uri("default://constructor.model/was/used").build();
- }
-
- @XmlElement
- @XmlJavaTypeAdapter(JaxbAdapterEx.class)
- Link link;
-
- public Link getLink() {
- return link;
- }
-
- public void setLink(Link lnk) {
- link = lnk;
- }
-}
diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxblink/JAXRSClientIT.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxblink/JAXRSClientIT.java
deleted file mode 100644
index d4735bb..0000000
--- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/api/rs/core/linkjaxblink/JAXRSClientIT.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2014, 2021 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 ee.jakarta.tck.ws.rs.api.rs.core.linkjaxblink;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-
-import javax.xml.namespace.QName;
-
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
-
-import jakarta.ws.rs.core.Link;
-import ee.jakarta.tck.ws.rs.common.JAXRSCommonClient;
-import ee.jakarta.tck.ws.rs.lib.util.TestUtil;
-
-/*
- * @class.setup_props: webServerHost;
- * webServerPort;
- * ts_home;
- */
-public class JAXRSClientIT extends JAXRSCommonClient {
-
- private static final long serialVersionUID = -6053007016837644641L;
-
- @BeforeEach
- void logStartTest(TestInfo testInfo) {
- TestUtil.logMsg("STARTING TEST : " + testInfo.getDisplayName());
- }
-
- @AfterEach
- void logFinishTest(TestInfo testInfo) {
- TestUtil.logMsg("FINISHED TEST : " + testInfo.getDisplayName());
- }
-
- /*
- * @testName: defaultConstructorTest
- *
- * @assertion_ids: JAXRS:JAVADOC:822; JAXRS:JAVADOC:820; JAXRS:JAVADOC:821;
- *
- * @test_Strategy: Default constructor needed during unmarshalling.
- * JaxbLink.getParams; JaxbLink.getUri
- */
- @Test
- public void defaultConstructorTest() throws Fault {
- Link.JaxbLink jaxbLink = new Link.JaxbLink();
- boolean getUri = jaxbLink.getUri() == null || jaxbLink.getUri().toASCIIString() == null
- || jaxbLink.getUri().toASCIIString().isEmpty();
- assertTrue(getUri, "JaxbLink.getUri() is unexpectedly preset to " + jaxbLink.getUri());
- logMsg("Link.JaxbLink.getUri() is empty as expected");
- boolean params = jaxbLink.getParams() == null || jaxbLink.getParams().isEmpty();
- assertTrue(params, "JaxbLink.getParams() is unexpectedly preset to " + jaxbLink.getParams());
- logMsg("Link.JaxbLink.getParams() is empty as expected");
- }
-
- /*
- * @testName: uriConstructorTest
- *
- * @assertion_ids: JAXRS:JAVADOC:823; JAXRS:JAVADOC:820; JAXRS:JAVADOC:821;
- *
- * @test_Strategy: Construct an instance from a URI and no parameters.
- * JaxbLink.getParams; JaxbLink.getUri
- */
- @Test
- public void uriConstructorTest() throws Fault {
- String uri = "protocol://domain2.domain1:port";
- URI fromString = uriFromString(uri);
- Link.JaxbLink jaxbLink = new Link.JaxbLink(fromString);
-
- boolean getUri = jaxbLink.getUri().equals(fromString);
- assertTrue(getUri, "JaxbLink.getUri() is unexpectedly preset to " + jaxbLink.getUri());
- logMsg("Link.JaxbLink.getUri() is", uri, "as expected");
-
- boolean params = jaxbLink.getParams() == null || jaxbLink.getParams().isEmpty();
- assertTrue(params, "JaxbLink.getParams() is unexpectedly preset to " + jaxbLink.getParams());
- logMsg("Link.JaxbLink.getParams() is empty as expected");
- }
-
- /*
- * @testName: uriParamsConstructorTest
- *
- * @assertion_ids: JAXRS:JAVADOC:824; JAXRS:JAVADOC:820; JAXRS:JAVADOC:821;
- *
- * @test_Strategy: Construct an instance from a URI and some parameters.
- * JaxbLink.getParams; JaxbLink.getUri
- */
- @Test
- public void uriParamsConstructorTest() throws Fault {
- String uri = "protocol://domain2.domain1:port";
- String q = "qName";
- QName qName = new QName(q);
- URI fromString = uriFromString(uri);
- java.util.Map<QName, Object> map;
- map = new HashMap<QName, Object>();
- map.put(qName, q);
- Link.JaxbLink jaxbLink = new Link.JaxbLink(fromString, map);
-
- boolean getUri = jaxbLink.getUri().equals(fromString);
- assertTrue(getUri, "JaxbLink.getUri() is unexpectedly preset to " + jaxbLink.getUri());
- logMsg("Link.JaxbLink.getUri() is", uri, "as expected");
-
- boolean params = jaxbLink.getParams().containsKey(qName) && jaxbLink.getParams().get(qName).equals(q);
- assertTrue(params, "JaxbLink.getParams() is unexpectedly set to " + jaxbLink.getParams());
- logMsg("Link.JaxbLink.getParams() contains", q, "as expected");
- }
-
- // //////////////////////////////////////////////////////////////////////
- private static URI uriFromString(String uri) throws Fault {
- URI fromString = null;
- try {
- fromString = new URI(uri);
- } catch (URISyntaxException e) {
- throw new Fault(e);
- }
- return fromString;
- }
-}
diff --git a/pom.xml b/pom.xml
index a6d5248..89297d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,7 +110,6 @@
<inject.api.version>2.0.0</inject.api.version>
<validation.api.version>3.0.0</validation.api.version>
<concurrent.api.version>2.0.0</concurrent.api.version>
- <xml.binding.api.version>4.0.0</xml.binding.api.version>
<cdi.api.version>3.0.0</cdi.api.version>
<junit.version>5.10.2</junit.version>
<org.glassfish.jaxb.version>4.0.3</org.glassfish.jaxb.version>
@@ -171,133 +170,6 @@
<version>${concurrent.api.version}</version>
</dependency>
<dependency>
- <groupId>jakarta.xml.bind</groupId>
- <artifactId>jakarta.xml.bind-api</artifactId>
- <version>${xml.binding.api.version}</version>
- </dependency>
- <!-- JAXB Implementation -->
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>codemodel</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-core</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-jxc</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-runtime</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>txw2</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-xjc</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>xsom</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>com.sun.istack</groupId>
- <artifactId>istack-commons-runtime</artifactId>
- <version>${com.sun.istack.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.sun.istack</groupId>
- <artifactId>istack-commons-tools</artifactId>
- <version>${com.sun.istack.version}</version>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind.external</groupId>
- <artifactId>relaxng-datatype</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind.external</groupId>
- <artifactId>rngom</artifactId>
- <version>${org.glassfish.jaxb.version}</version>
- <exclusions>
- <exclusion>
- <groupId>relaxngDatatype</groupId>
- <artifactId>relaxngDatatype</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.xml.bind.external</groupId>
- <artifactId>relaxng-datatype</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- End JAXB Implementation -->
- <dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>