diff --git a/CHANGELOG.md b/CHANGELOG.md index ee11e413e..6f05e0561 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,17 +7,20 @@ - Introducing capability to set the servletUri to be used by the OAuthConfiguration ### Changed - +- 🧨Migrated from Javax to Jakarta packages +- upgrade to Jersey 3.1.5 - Kotlin 1.9.0 is used; `kotlin-stdlib-jdk8` dependency was replaced with `kotlin-stdlib` due to [Kotlin updates](https://kotlinlang.org/docs/whatsnew18.html#updated-jvm-compilation-target). - Allow application to reset the oauth token cached within the server, when it deems that it is no longer valid - 🧨Corrected cardinality and range of the oslc_config:acceptedBy property (from String[0..1] to Resource[0..*]) - changed scope of dependencies in oauth-webapp to avoid inclusion multiple times during runtime. +- Migrated from Javax to Jakarta packages, including upgrade to Jersey 3.1.5 ### Deprecated ### Removed - 🧨 Support for JDK 11 (and all versions below 17) is removed. **JDK 17 is the new baseline for Eclipse Lyo.** The SDK and sample code has been tested using JDK 17, 20, and 21-ea. +- 🧨 Support for Java EE and Jakarta EE 8 is removed. ### Fixed diff --git a/client/oslc-client/pom.xml b/client/oslc-client/pom.xml index 880bceb30..306f50419 100644 --- a/client/oslc-client/pom.xml +++ b/client/oslc-client/pom.xml @@ -1,167 +1,186 @@ - - 4.0.0 + + 4.0.0 - - org.eclipse.lyo.clients - clients-parent - 6.0.0-SNAPSHOT - ../pom.xml - - - oslc-client + + org.eclipse.lyo.clients + clients-parent 6.0.0-SNAPSHOT - Lyo :: Client :: OSLC JAX-RS 2.0 (new) - Eclipse Lyo OSLC Java client based on OSLC4J and JAX-RS 2.0 + ../pom.xml + - - - org.eclipse.lyo.clients - oslc-client-base - ${v.lyo} - + oslc-client + 6.0.0-SNAPSHOT + Lyo :: Client :: OSLC JAX-RS 2.0 (new) + Eclipse Lyo OSLC Java client based on OSLC4J and JAX-RS 2.0 + + + + org.eclipse.lyo.clients + oslc-client-base + ${v.lyo} + - - org.slf4j - slf4j-api - ${v.slf4j} - - - org.apache.jena - apache-jena-libs - pom - ${v.jena} - - - org.apache.httpcomponents - httpclient - ${v.httpclient} - - - commons-logging - commons-logging - - - - - org.slf4j - jcl-over-slf4j - ${v.slf4j} - - - net.oauth.core - oauth - 20100527 - - - net.oauth.core - oauth-consumer - 20100527 - - - net.oauth.core - oauth-httpclient4 - 20090913 - - - org.apache.httpcomponents - httpclient - - - - - org.eclipse.lyo.oslc4j.core - oslc4j-core - ${v.lyo} - - - org.eclipse.lyo.oslc4j.core - oslc4j-jena-provider - ${v.lyo} - - - org.eclipse.lyo.oslc4j.core - oslc4j-json4j-provider - ${v.lyo} - + + org.slf4j + slf4j-api + ${v.slf4j} + + + org.apache.jena + apache-jena-libs + pom + ${v.jena} + + + org.apache.httpcomponents + httpclient + ${v.httpclient} + + + commons-logging + commons-logging + + + + + org.slf4j + jcl-over-slf4j + ${v.slf4j} + + + org.eclipse.lyo.server + net.oauth.core-oauth-jakarta + ${v.lyo} + + + + net.oauth.core + oauth + + + + + org.eclipse.lyo.server + net.oauth.core-oauth-consumer-jakarta + ${v.lyo} + + + + net.oauth.core + oauth-consumer + + + + + org.eclipse.lyo.server + net.oauth.core-oauth-httpclient4-jakarta + ${v.lyo} + + + + net.oauth.core + oauth-httpclient4 + + + + + org.eclipse.lyo.oslc4j.core + oslc4j-core + ${v.lyo} + + + org.eclipse.lyo.oslc4j.core + oslc4j-jena-provider + ${v.lyo} + + + org.eclipse.lyo.oslc4j.core + oslc4j-json4j-provider + ${v.lyo} + - - javax.servlet - javax.servlet-api - - - - - jakarta.ws.rs - jakarta.ws.rs-api - provided - + + jakarta.servlet + jakarta.servlet-api + + + jakarta.ws.rs + jakarta.ws.rs-api + - - - org.slf4j - slf4j-simple - ${v.slf4j} - test - - - org.mockito - mockito-core - test - - - org.junit.jupiter - junit-jupiter-api - test - - - junit - junit - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.junit.vintage - junit-vintage-engine - test - - - - org.assertj - assertj-core - test - + + + org.slf4j + slf4j-simple + ${v.slf4j} + test + + + org.mockito + mockito-core + test + + + org.junit.jupiter + junit-jupiter-api + test + + + junit + junit + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine + test + + + + org.assertj + assertj-core + test + - - org.glassfish.jersey.core - jersey-client - test - - - org.glassfish.jersey.inject - jersey-hk2 - test - + + org.glassfish.jersey.core + jersey-client + test + + + org.glassfish.jersey.inject + jersey-hk2 + test + - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - + + + + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/IOslcClient.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/IOslcClient.java index f94f98183..9de98e718 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/IOslcClient.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/IOslcClient.java @@ -14,8 +14,9 @@ package org.eclipse.lyo.client; import java.util.Map; -import javax.ws.rs.client.Client; -import javax.ws.rs.core.Response; + +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.core.Response; /** * An OSLC Client that extends the JAX-RS 2.0 REST client with OSLC specific CRUD and diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/JEEFormAuthenticator.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/JEEFormAuthenticator.java index fee5f9b6f..1c29b6c94 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/JEEFormAuthenticator.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/JEEFormAuthenticator.java @@ -13,26 +13,27 @@ */ package org.eclipse.lyo.client; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.ws.rs.ProcessingException; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.client.ClientRequestFilter; -import javax.ws.rs.client.ClientResponseContext; -import javax.ws.rs.client.ClientResponseFilter; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; import java.io.InputStream; import java.util.ArrayList; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import jakarta.ws.rs.ProcessingException; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientRequestContext; +import jakarta.ws.rs.client.ClientRequestFilter; +import jakarta.ws.rs.client.ClientResponseContext; +import jakarta.ws.rs.client.ClientResponseFilter; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.Form; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedHashMap; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; + /** * A filter that can be registered in order to non-preemptively handle JEE Form * based authentication challenges. @@ -85,7 +86,7 @@ public JEEFormAuthenticator(final String baseUri, final String username, final S * authenticate the user, and then retries the request with the updated * session information. * - * @see javax.ws.rs.client.ClientResponseFilter#filter(javax.ws.rs.client.ClientRequestContext, javax.ws.rs.client.ClientResponseContext) + * @see jakarta.ws.rs.client.ClientResponseFilter#filter(jakarta.ws.rs.client.ClientRequestContext, jakarta.ws.rs.client.ClientResponseContext) */ @Override public void filter(ClientRequestContext request, ClientResponseContext response) { diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcClient.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcClient.java index 53b39c116..53f93c922 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcClient.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcClient.java @@ -13,6 +13,16 @@ */ package org.eclipse.lyo.client; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + import org.apache.http.HttpHeaders; import org.apache.http.HttpStatus; import org.eclipse.lyo.client.exception.ResourceNotFoundException; @@ -27,22 +37,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation.Builder; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation.Builder; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; /** * An OSLC Client that extends the JAX-RS 2.0 REST client with OSLC specific CRUD and diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcClientBuilder.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcClientBuilder.java index 0a223af06..9c126730c 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcClientBuilder.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcClientBuilder.java @@ -13,11 +13,11 @@ */ package org.eclipse.lyo.client; -import javax.ws.rs.client.ClientBuilder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.client.ClientBuilder; + public class OslcClientBuilder { private String version; private ClientBuilder clientBuilder; diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClient.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClient.java index cca96897b..49ee64059 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClient.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClient.java @@ -21,20 +21,20 @@ import java.util.Map; import java.util.Optional; -import javax.ws.rs.HttpMethod; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.core.Response; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.client.HttpClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import jakarta.ws.rs.HttpMethod; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.core.Response; import net.oauth.OAuthAccessor; import net.oauth.OAuthException; import net.oauth.OAuthMessage; import net.oauth.client.OAuthClient; import net.oauth.client.httpclient4.HttpClient4; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.client.HttpClient; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class OslcOAuthClient implements IOslcClient { diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClientBuilder.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClientBuilder.java index aeb03ea79..df9f041c4 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClientBuilder.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClientBuilder.java @@ -13,11 +13,10 @@ */ package org.eclipse.lyo.client; -import javax.ws.rs.client.ClientBuilder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.client.ClientBuilder; import net.oauth.OAuthAccessor; import net.oauth.OAuthConsumer; import net.oauth.OAuthServiceProvider; diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/RootServicesHelper.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/RootServicesHelper.java index 63877621a..cdbf8dbdf 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/RootServicesHelper.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/RootServicesHelper.java @@ -13,7 +13,11 @@ */ package org.eclipse.lyo.client; -import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.StatusLine; @@ -33,13 +37,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; + +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriBuilder; /** * Helper class to assist in retrieval of attributes from the IBM Rational diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/UnderlyingHttpClient.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/UnderlyingHttpClient.java index 3150e93af..015676205 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/UnderlyingHttpClient.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/UnderlyingHttpClient.java @@ -13,9 +13,10 @@ */ package org.eclipse.lyo.client; -import javax.ws.rs.client.Client; import org.apache.http.client.HttpClient; +import jakarta.ws.rs.client.Client; + public interface UnderlyingHttpClient { /** diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQuery.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQuery.java index 4226d58d2..0c2befb23 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQuery.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQuery.java @@ -14,12 +14,11 @@ package org.eclipse.lyo.client.query; -import javax.ws.rs.core.Response; - -import org.eclipse.lyo.client.OslcClient; import org.eclipse.lyo.client.OSLCConstants; +import org.eclipse.lyo.client.OslcClient; -import javax.ws.rs.client.WebTarget; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.Response; /** * Represents an OSLC query (HTTP GET) request to be made of a remote system. diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQueryResult.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQueryResult.java index 70a6f2eb9..5654c10c7 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQueryResult.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQueryResult.java @@ -21,14 +21,6 @@ import javax.xml.datatype.DatatypeConfigurationException; -import javax.ws.rs.core.Response; - -import org.eclipse.lyo.client.OSLCConstants; -import org.eclipse.lyo.oslc4j.core.exception.LyoModelException; -import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; -import org.eclipse.lyo.oslc4j.core.model.OslcConstants; -import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; - import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Property; @@ -40,6 +32,13 @@ import org.apache.jena.rdf.model.Statement; import org.apache.jena.rdf.model.StmtIterator; import org.apache.jena.vocabulary.RDFS; +import org.eclipse.lyo.client.OSLCConstants; +import org.eclipse.lyo.oslc4j.core.exception.LyoModelException; +import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; +import org.eclipse.lyo.oslc4j.core.model.OslcConstants; +import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; + +import jakarta.ws.rs.core.Response; /** diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/resources/RmUtil.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/resources/RmUtil.java index e731ef8b0..44682a82c 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/resources/RmUtil.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/resources/RmUtil.java @@ -13,19 +13,20 @@ */ package org.eclipse.lyo.client.resources; -import net.oauth.OAuthException; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import org.eclipse.lyo.client.OSLCConstants; import org.eclipse.lyo.client.OslcClient; import org.eclipse.lyo.client.exception.ResourceNotFoundException; -import org.eclipse.lyo.client.OSLCConstants; import org.eclipse.lyo.oslc4j.core.model.CreationFactory; import org.eclipse.lyo.oslc4j.core.model.ResourceShape; import org.eclipse.lyo.oslc4j.core.model.Service; import org.eclipse.lyo.oslc4j.core.model.ServiceProvider; -import javax.ws.rs.core.Response; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; +import jakarta.ws.rs.core.Response; +import net.oauth.OAuthException; @Deprecated public final class RmUtil { diff --git a/client/oslc-client/src/test/java/org/eclipse/lyo/client/test/OslcClientTest.java b/client/oslc-client/src/test/java/org/eclipse/lyo/client/test/OslcClientTest.java index cc000c867..25729d7a4 100644 --- a/client/oslc-client/src/test/java/org/eclipse/lyo/client/test/OslcClientTest.java +++ b/client/oslc-client/src/test/java/org/eclipse/lyo/client/test/OslcClientTest.java @@ -20,8 +20,6 @@ import java.io.IOException; import java.net.URISyntaxException; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status.Family; import javax.xml.namespace.QName; import org.eclipse.lyo.client.OSLCConstants; @@ -29,6 +27,9 @@ import org.eclipse.lyo.oslc4j.core.model.ServiceProvider; import org.junit.jupiter.api.Test; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status.Family; + public class OslcClientTest { /* * Tests that the RDF/XML MessageBodyWriter doesn't go into an infinite loop when diff --git a/client/oslc-client/src/test/java/org/eclipse/lyo/client/test/OslcQueryResultTest.java b/client/oslc-client/src/test/java/org/eclipse/lyo/client/test/OslcQueryResultTest.java index 717a8b12f..3add622b6 100644 --- a/client/oslc-client/src/test/java/org/eclipse/lyo/client/test/OslcQueryResultTest.java +++ b/client/oslc-client/src/test/java/org/eclipse/lyo/client/test/OslcQueryResultTest.java @@ -18,9 +18,6 @@ import java.io.InputStream; - -import javax.ws.rs.core.Response; - import org.eclipse.lyo.client.OslcClient; import org.eclipse.lyo.client.query.OslcQuery; import org.eclipse.lyo.client.query.OslcQueryParameters; @@ -29,6 +26,8 @@ import org.junit.Test; import org.mockito.Mockito; +import jakarta.ws.rs.core.Response; + /** * @author Samuel Padgett */ diff --git a/core/lyo-core-settings/pom.xml b/core/lyo-core-settings/pom.xml index 0c149d965..034f79bd4 100644 --- a/core/lyo-core-settings/pom.xml +++ b/core/lyo-core-settings/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> oslc4j-core-build org.eclipse.lyo.oslc4j.core @@ -17,15 +17,12 @@ - - javax.servlet - javax.servlet-api - provided + jakarta.servlet + jakarta.servlet-api jakarta.ws.rs jakarta.ws.rs-api - provided org.apache.jena @@ -33,8 +30,8 @@ pom - javax.annotation - javax.annotation-api + jakarta.annotation + jakarta.annotation-api org.apache.httpcomponents diff --git a/core/lyo-core-settings/src/main/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtils.java b/core/lyo-core-settings/src/main/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtils.java index 307030f00..197dea7f6 100644 --- a/core/lyo-core-settings/src/main/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtils.java +++ b/core/lyo-core-settings/src/main/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtils.java @@ -27,8 +27,7 @@ import java.util.Calendar; import java.util.HashSet; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.UriBuilder; + import javax.xml.XMLConstants; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; @@ -51,6 +50,9 @@ import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.ws.rs.core.UriBuilder; + // TODO: Lyo6 extract to LyoServletUriUtils public class OSLC4JUtils { diff --git a/core/lyo-core-settings/src/test/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtilsTest.java b/core/lyo-core-settings/src/test/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtilsTest.java index 27027a469..19d0f8811 100644 --- a/core/lyo-core-settings/src/test/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtilsTest.java +++ b/core/lyo-core-settings/src/test/java/org/eclipse/lyo/oslc4j/core/OSLC4JUtilsTest.java @@ -13,16 +13,19 @@ */ package org.eclipse.lyo.oslc4j.core; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import java.net.MalformedURLException; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import static org.junit.Assert.*; import org.apache.commons.lang3.tuple.Pair; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import static org.mockito.Mockito.when; + +import jakarta.servlet.http.HttpServletRequest; public class OSLC4JUtilsTest { diff --git a/core/oslc-trs/pom.xml b/core/oslc-trs/pom.xml index e40ec4c13..efc9d0638 100644 --- a/core/oslc-trs/pom.xml +++ b/core/oslc-trs/pom.xml @@ -29,8 +29,8 @@ pom - javax.annotation - javax.annotation-api + jakarta.annotation + jakarta.annotation-api org.apache.httpcomponents diff --git a/core/oslc4j-core/pom.xml b/core/oslc4j-core/pom.xml index 035bf39bd..eb853df39 100644 --- a/core/oslc4j-core/pom.xml +++ b/core/oslc4j-core/pom.xml @@ -40,8 +40,8 @@ pom - javax.annotation - javax.annotation-api + jakarta.annotation + jakarta.annotation-api org.apache.httpcomponents diff --git a/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/OslcMediaType.java b/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/OslcMediaType.java index 23d4a19fc..1faa62ecd 100644 --- a/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/OslcMediaType.java +++ b/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/OslcMediaType.java @@ -13,7 +13,7 @@ */ package org.eclipse.lyo.oslc4j.core.model; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MediaType; public interface OslcMediaType { diff --git a/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ResourceShapeFactory.java b/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ResourceShapeFactory.java index 26ef6ce61..6b2cc2689 100644 --- a/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ResourceShapeFactory.java +++ b/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ResourceShapeFactory.java @@ -30,10 +30,25 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.ws.rs.core.UriBuilder; import org.eclipse.lyo.oslc4j.core.CoreHelper; -import org.eclipse.lyo.oslc4j.core.annotation.*; +import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValue; +import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValues; +import org.eclipse.lyo.oslc4j.core.annotation.OslcDefaultValue; +import org.eclipse.lyo.oslc4j.core.annotation.OslcDescription; +import org.eclipse.lyo.oslc4j.core.annotation.OslcHidden; +import org.eclipse.lyo.oslc4j.core.annotation.OslcMaxSize; +import org.eclipse.lyo.oslc4j.core.annotation.OslcMemberProperty; +import org.eclipse.lyo.oslc4j.core.annotation.OslcName; +import org.eclipse.lyo.oslc4j.core.annotation.OslcOccurs; +import org.eclipse.lyo.oslc4j.core.annotation.OslcPropertyDefinition; +import org.eclipse.lyo.oslc4j.core.annotation.OslcRange; +import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly; +import org.eclipse.lyo.oslc4j.core.annotation.OslcRepresentation; +import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape; +import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle; +import org.eclipse.lyo.oslc4j.core.annotation.OslcValueShape; +import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType; import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; import org.eclipse.lyo.oslc4j.core.exception.OslcCoreDuplicatePropertyDefinitionException; import org.eclipse.lyo.oslc4j.core.exception.OslcCoreInvalidOccursException; @@ -46,6 +61,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.core.UriBuilder; + public class ResourceShapeFactory { private final static Logger log = LoggerFactory.getLogger(ResourceShapeFactory.class); diff --git a/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java b/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java index 6c22c57b5..86735020b 100644 --- a/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java +++ b/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java @@ -20,10 +20,7 @@ import java.net.URLEncoder; import java.util.HashMap; import java.util.Map; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.core.UriBuilder; + import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory; import org.eclipse.lyo.oslc4j.core.annotation.OslcDialog; import org.eclipse.lyo.oslc4j.core.annotation.OslcDialogs; @@ -34,6 +31,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.UriBuilder; + public final class ServiceProviderFactory { private final static Logger log = LoggerFactory.getLogger(ServiceProviderFactory.class); diff --git a/core/oslc4j-core/src/test/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactoryTest.java b/core/oslc4j-core/src/test/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactoryTest.java index b5f3976ee..1448fea83 100644 --- a/core/oslc4j-core/src/test/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactoryTest.java +++ b/core/oslc4j-core/src/test/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactoryTest.java @@ -1,12 +1,15 @@ package org.eclipse.lyo.oslc4j.core.model; +import static org.junit.Assert.assertEquals; + import java.util.HashMap; -import javax.ws.rs.Path; + import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory; -import static org.junit.Assert.*; import org.junit.Test; import org.mockito.Mockito; +import jakarta.ws.rs.Path; + /** * Unit test for verifying {@link ServiceProviderFactory} URI-related code. * @author Andrew Berezovskyi (andriib@kth.se) diff --git a/core/oslc4j-jena-provider/pom.xml b/core/oslc4j-jena-provider/pom.xml index 2be514698..3451b0b53 100644 --- a/core/oslc4j-jena-provider/pom.xml +++ b/core/oslc4j-jena-provider/pom.xml @@ -1,158 +1,151 @@ - - 4.0.0 - - org.eclipse.lyo.oslc4j.core - oslc4j-core-build - 6.0.0-SNAPSHOT - ../oslc4j-core-build/pom.xml - - oslc4j-jena-provider - Lyo :: Core :: Jena Provider - JAX-RS provider for reading and writing RDF content using the Eclipse Lyo OSLC4J SDK. + + 4.0.0 + + org.eclipse.lyo.oslc4j.core + oslc4j-core-build + 6.0.0-SNAPSHOT + ../oslc4j-core-build/pom.xml + + oslc4j-jena-provider + Lyo :: Core :: Jena Provider + JAX-RS provider for reading and writing RDF content using the + Eclipse Lyo OSLC4J SDK. - - + + - - - org.eclipse.lyo.oslc4j.core - oslc4j-core - + + + org.eclipse.lyo.oslc4j.core + oslc4j-core + - - javax.servlet - javax.servlet-api - provided - - - jakarta.ws.rs - jakarta.ws.rs-api - provided - + + jakarta.servlet + jakarta.servlet-api + + + jakarta.ws.rs + jakarta.ws.rs-api + - - org.slf4j - slf4j-api - - - org.apache.jena - apache-jena-libs - pom - - - javax.annotation - javax.annotation-api - - - org.apache.httpcomponents - httpclient - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - - org.slf4j - jcl-over-slf4j - - - jakarta.annotation - jakarta.annotation-api - + + org.slf4j + slf4j-api + + + org.apache.jena + apache-jena-libs + pom + + + jakarta.annotation + jakarta.annotation-api + + + org.apache.httpcomponents + httpclient + + + + + org.apache.httpcomponents + httpclient + + + commons-logging + commons-logging + + + + + org.slf4j + jcl-over-slf4j + + + jakarta.annotation + jakarta.annotation-api + - + - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - - org.junit.vintage - junit-vintage-engine - test - - - - org.junit.jupiter - junit-jupiter-params - test - - - org.assertj - assertj-core - test - - - org.slf4j - slf4j-simple - test - - - org.glassfish.jersey.containers - jersey-container-servlet - test - - - org.glassfish.jersey.inject - jersey-hk2 - test - - - org.glassfish.jersey.core - jersey-server - test - - - org.glassfish.jersey.core - jersey-common - test - + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + org.junit.vintage + junit-vintage-engine + test + + + + org.junit.jupiter + junit-jupiter-params + test + + + org.assertj + assertj-core + test + + + org.slf4j + slf4j-simple + test + + + org.glassfish.jersey.containers + jersey-container-servlet + test + + + org.glassfish.jersey.inject + jersey-hk2 + test + + + org.glassfish.jersey.core + jersey-server + test + + + org.glassfish.jersey.core + jersey-common + test + - - - org.glassfish.jersey.test-framework.providers - jersey-test-framework-provider-grizzly2 - ${v.jersey} - test - - - - - javax.servlet - javax.servlet-api - - - + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + ${v.jersey} + test - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - + + + + + + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java index 41828901a..2b3418227 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/AbstractOslcRdfXmlProvider.java @@ -22,15 +22,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.ResponseBuilder; -import javax.ws.rs.ext.Providers; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.RDFReaderI; @@ -49,6 +41,16 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.ResponseBuilder; +import jakarta.ws.rs.ext.Providers; + /** * @author Russell Boykin, Alberto Giammaria, Chris Peters, Gianluca Bernardini, Andrew Berezovskyi */ diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcCompactRdfProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcCompactRdfProvider.java index e4bc29fce..d62767f8b 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcCompactRdfProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcCompactRdfProvider.java @@ -19,18 +19,18 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.model.Compact; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +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; + /** * @author Russell Boykin, Alberto Giammaria, Chris Peters, Gianluca Bernardini */ diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdArrayProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdArrayProvider.java index 3918f4a5a..0deaf9488 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdArrayProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdArrayProvider.java @@ -13,11 +13,12 @@ */ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + /** * @author Andrew Berezovskyi * @since 2.4.0 diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdCollectionProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdCollectionProvider.java index e59a5465d..0f86e04d6 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdCollectionProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdCollectionProvider.java @@ -13,11 +13,12 @@ */ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + /** * @author Andrew Berezovskyi * @since 2.4.0 diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdProvider.java index 7b511a74c..909007137 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcJsonLdProvider.java @@ -13,11 +13,12 @@ */ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + /** * @author Andrew Berezovskyi * @since 2.4.0 diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlArrayProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlArrayProvider.java index ab36e9525..711d6848b 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlArrayProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlArrayProvider.java @@ -19,17 +19,17 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +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; + /** * @author Russell Boykin, Alberto Giammaria, Chris Peters, Gianluca Bernardini, Andrew Berezovskyi */ diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlCollectionProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlCollectionProvider.java index f1d63ff54..25a677b97 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlCollectionProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlCollectionProvider.java @@ -37,20 +37,20 @@ import java.util.SortedSet; import java.util.TreeSet; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.CoreHelper; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +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; + /** * * @author Russell Boykin, Alberto Giammaria, Chris Peters, Gianluca Bernardini, Andrew Berezovskyi diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java index 768a27c83..a62973a12 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java @@ -25,15 +25,6 @@ import java.util.Collection; import java.util.Map; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.CoreHelper; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; import org.eclipse.lyo.oslc4j.core.model.FilteredResource; @@ -44,6 +35,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +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; + /** * @author Russell Boykin, Alberto Giammaria, Chris Peters, Gianluca Bernardini, Steve Pitschke */ diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java index 48911f20f..163386b80 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlArrayProvider.java @@ -18,15 +18,15 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.APPLICATION_RDF_XML}) @Consumes({OslcMediaType.APPLICATION_RDF_XML}) diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java index 62896d84d..a9d791070 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleRdfXmlCollectionProvider.java @@ -19,15 +19,15 @@ import java.lang.reflect.Type; import java.util.Collection; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.Provider; + /** * @author Russell Boykin, Alberto Giammaria, Chris Peters, Gianluca Bernardini, Andrew Berezovskyi */ diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleXmlArrayProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleXmlArrayProvider.java index c04ec95ab..594a95db3 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleXmlArrayProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleXmlArrayProvider.java @@ -14,12 +14,12 @@ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) @Consumes({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleXmlCollectionProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleXmlCollectionProvider.java index 06d7e8df7..566f009a7 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleXmlCollectionProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcSimpleXmlCollectionProvider.java @@ -14,12 +14,12 @@ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) @Consumes({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleArrayProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleArrayProvider.java index 474640c6c..5ee8257a2 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleArrayProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleArrayProvider.java @@ -14,12 +14,12 @@ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.TEXT_TURTLE}) @Consumes({OslcMediaType.TEXT_TURTLE}) diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleCollectionProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleCollectionProvider.java index 582d7e455..24bc54fd3 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleCollectionProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleCollectionProvider.java @@ -14,12 +14,12 @@ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.TEXT_TURTLE}) @Consumes({OslcMediaType.TEXT_TURTLE}) diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleProvider.java index c46158040..79341da23 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcTurtleProvider.java @@ -14,12 +14,12 @@ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.TEXT_TURTLE}) @Consumes({OslcMediaType.TEXT_TURTLE}) diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlArrayProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlArrayProvider.java index 4848a89ee..0cb023a3c 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlArrayProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlArrayProvider.java @@ -14,12 +14,12 @@ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) @Consumes({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlCollectionProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlCollectionProvider.java index 48fbe2fd4..ba78f52c9 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlCollectionProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlCollectionProvider.java @@ -14,12 +14,12 @@ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) @Consumes({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) diff --git a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlProvider.java b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlProvider.java index fad0687b7..bde97af8c 100644 --- a/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlProvider.java +++ b/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcXmlProvider.java @@ -14,12 +14,12 @@ package org.eclipse.lyo.oslc4j.provider.jena; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; - -import javax.ws.rs.ext.Provider; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; + @Provider @Produces({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) @Consumes({OslcMediaType.APPLICATION_XML, OslcMediaType.TEXT_XML}) diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/ProviderCollectionResource.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/ProviderCollectionResource.java index 184564bef..223422213 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/ProviderCollectionResource.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/ProviderCollectionResource.java @@ -1,5 +1,11 @@ package org.eclipse.lyo.oslc4j.provider.jena; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + import org.eclipse.lyo.oslc4j.core.OSLC4JConstants; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; import org.eclipse.lyo.oslc4j.core.annotation.OslcQueryCapability; @@ -7,26 +13,21 @@ import org.eclipse.lyo.oslc4j.provider.jena.test.resources.TestResource; import org.eclipse.lyo.oslc4j.provider.jena.test.resources.TestResourceNonQ; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import java.io.IOException; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.GenericEntity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriBuilder; +import jakarta.ws.rs.core.UriInfo; @Path("/test") public class ProviderCollectionResource { diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/RdfJenaProviderCollectionTest.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/RdfJenaProviderCollectionTest.java index 3e1ef5eef..7cda5778d 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/RdfJenaProviderCollectionTest.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/RdfJenaProviderCollectionTest.java @@ -1,5 +1,15 @@ package org.eclipse.lyo.oslc4j.provider.jena; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assumptions.assumeFalse; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + +import java.io.InputStream; +import java.lang.reflect.Array; +import java.util.List; +import java.util.Set; +import java.util.stream.Stream; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Resource; @@ -28,17 +38,8 @@ import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.Response; -import java.io.InputStream; -import java.lang.reflect.Array; -import java.util.List; -import java.util.Set; -import java.util.stream.Stream; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assumptions.assumeFalse; -import static org.junit.jupiter.api.Assumptions.assumeTrue; +import jakarta.ws.rs.core.GenericType; +import jakarta.ws.rs.core.Response; public class RdfJenaProviderCollectionTest extends JerseyTest { diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/shapefactory/resources/ILocalShape.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/shapefactory/resources/ILocalShape.java index 0b19c8427..368f73c61 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/shapefactory/resources/ILocalShape.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/shapefactory/resources/ILocalShape.java @@ -17,41 +17,15 @@ package org.eclipse.lyo.oslc4j.provider.jena.shapefactory.resources; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.text.SimpleDateFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.Iterator; - -import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValue; -import org.eclipse.lyo.oslc4j.core.annotation.OslcDescription; -import org.eclipse.lyo.oslc4j.core.annotation.OslcMemberProperty; import org.eclipse.lyo.oslc4j.core.annotation.OslcName; import org.eclipse.lyo.oslc4j.core.annotation.OslcNamespace; import org.eclipse.lyo.oslc4j.core.annotation.OslcOccurs; import org.eclipse.lyo.oslc4j.core.annotation.OslcPropertyDefinition; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRdfCollectionType; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRange; import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRepresentation; import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape; -import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle; import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType; -import org.eclipse.lyo.oslc4j.core.model.AbstractResource; -import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.core.model.Occurs; -import org.eclipse.lyo.oslc4j.core.model.OslcConstants; -import org.eclipse.lyo.oslc4j.core.model.Representation; import org.eclipse.lyo.oslc4j.core.model.ValueType; -import org.eclipse.lyo.oslc4j.provider.jena.shapefactory.resources.Oslc_sdDomainConstants; // Start of user code imports diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/JsonLdTest.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/JsonLdTest.java index 3f643cec3..814ab0769 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/JsonLdTest.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/JsonLdTest.java @@ -13,13 +13,15 @@ */ package org.eclipse.lyo.oslc4j.provider.jena.test; -import com.github.jsonldjava.utils.Obj; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; + import org.apache.jena.ext.com.google.common.collect.ImmutableList; -import javax.ws.rs.core.MultivaluedHashMap; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; import org.eclipse.lyo.oslc4j.core.model.ServiceProvider; import org.eclipse.lyo.oslc4j.provider.jena.OslcJsonLdArrayProvider; @@ -28,7 +30,7 @@ import org.junit.Ignore; import org.junit.Test; -import static org.junit.Assert.*; +import jakarta.ws.rs.core.MultivaluedHashMap; /** * Created on 2018-03-03 diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/RdfXmlAbbreviatedWriterTest.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/RdfXmlAbbreviatedWriterTest.java index f5ccf2166..fb472a891 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/RdfXmlAbbreviatedWriterTest.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/RdfXmlAbbreviatedWriterTest.java @@ -13,6 +13,9 @@ */ package org.eclipse.lyo.oslc4j.provider.jena.test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -25,9 +28,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.eclipse.lyo.oslc4j.core.model.QueryCapability; @@ -41,7 +42,9 @@ import org.eclipse.lyo.oslc4j.provider.jena.RdfXmlAbbreviatedWriter; import org.junit.Test; -import static org.junit.Assert.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; public class RdfXmlAbbreviatedWriterTest { @Test diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ReifiedLinksTest.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ReifiedLinksTest.java index 2fb4e230b..adaaee4a2 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ReifiedLinksTest.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ReifiedLinksTest.java @@ -1,18 +1,21 @@ package org.eclipse.lyo.oslc4j.provider.jena.test; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; + import java.lang.reflect.InvocationTargetException; import java.net.URI; import java.net.URISyntaxException; import java.util.List; + import javax.xml.datatype.DatatypeConfigurationException; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ReifiedStatement; -import static org.assertj.core.api.Assertions.assertThat; import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; import org.eclipse.lyo.oslc4j.provider.jena.test.resources.ResourceWithReifiedLinks; -import static org.junit.Assert.*; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ServiceProviderTest.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ServiceProviderTest.java index 4c7f83d48..83b48916c 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ServiceProviderTest.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ServiceProviderTest.java @@ -13,21 +13,22 @@ */ package org.eclipse.lyo.oslc4j.provider.jena.test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.io.InputStream; import java.net.URI; import java.util.Arrays; import java.util.List; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; import org.eclipse.lyo.oslc4j.core.model.Service; import org.eclipse.lyo.oslc4j.core.model.ServiceProvider; import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; import org.junit.Test; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; - public class ServiceProviderTest { @Test public void testUsage() throws Exception { diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ShapeTest.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ShapeTest.java index 2c4896ad1..b28a42c4f 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ShapeTest.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/ShapeTest.java @@ -25,14 +25,14 @@ import java.util.Collection; import java.util.List; -import javax.ws.rs.core.MediaType; - import org.eclipse.lyo.oslc4j.core.model.AllowedValues; import org.eclipse.lyo.oslc4j.core.model.Property; import org.eclipse.lyo.oslc4j.core.model.ResourceShape; import org.eclipse.lyo.oslc4j.provider.jena.OslcTurtleProvider; import org.junit.Test; +import jakarta.ws.rs.core.MediaType; + public class ShapeTest { @Test public void allowedAndDefaultValuesTest() throws Exception { diff --git a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/TurtleTest.java b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/TurtleTest.java index c34ae7fe2..cb26da82b 100644 --- a/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/TurtleTest.java +++ b/core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/TurtleTest.java @@ -17,12 +17,12 @@ import java.io.InputStream; -import javax.ws.rs.core.MediaType; - import org.eclipse.lyo.oslc4j.core.model.ServiceProvider; import org.eclipse.lyo.oslc4j.provider.jena.OslcTurtleProvider; import org.junit.Test; +import jakarta.ws.rs.core.MediaType; + public class TurtleTest { @Test @SuppressWarnings({ diff --git a/core/oslc4j-json4j-provider/pom.xml b/core/oslc4j-json4j-provider/pom.xml index 9dcccd045..ea981e83e 100644 --- a/core/oslc4j-json4j-provider/pom.xml +++ b/core/oslc4j-json4j-provider/pom.xml @@ -1,133 +1,125 @@ - - 4.0.0 - - org.eclipse.lyo.oslc4j.core - oslc4j-core-build - 6.0.0-SNAPSHOT - ../oslc4j-core-build/pom.xml - - oslc4j-json4j-provider - Lyo :: Core :: JSON4J Provider (legacy) - JAX-RS provider for reading and writing OSLC 2.0 JSON content using the Eclipse Lyo OSLC4J SDK. + + 4.0.0 + + org.eclipse.lyo.oslc4j.core + oslc4j-core-build + 6.0.0-SNAPSHOT + ../oslc4j-core-build/pom.xml + + oslc4j-json4j-provider + Lyo :: Core :: JSON4J Provider (legacy) + JAX-RS provider for reading and writing OSLC 2.0 JSON content + using the Eclipse Lyo OSLC4J SDK. - - + + - - - org.eclipse.lyo.oslc4j.core - oslc4j-core-wink - ${v.lyo} - + + + org.eclipse.lyo.oslc4j.core + oslc4j-core-wink + ${v.lyo} + - - org.apache.wink - wink-json4j - 1.4 - - - javax.servlet - javax.servlet-api - provided - - - jakarta.ws.rs - jakarta.ws.rs-api - provided - + + org.apache.wink + wink-json4j + 1.4 + + + jakarta.servlet + jakarta.servlet-api + + + jakarta.ws.rs + jakarta.ws.rs-api + - - - org.junit.jupiter - junit-jupiter-api - test - - + + org.junit.jupiter + junit-jupiter-api + test + + - - org.junit.jupiter - junit-jupiter-engine - test - - - - org.junit.jupiter - junit-jupiter-params - test - - - org.assertj - assertj-core - test - - - org.glassfish.jersey.containers - jersey-container-servlet - test - - - org.glassfish.jersey.inject - jersey-hk2 - test - - - org.glassfish.jersey.core - jersey-server - test - - - org.glassfish.jersey.core - jersey-common - test - + + org.junit.jupiter + junit-jupiter-engine + test + + + + org.junit.jupiter + junit-jupiter-params + test + + + org.assertj + assertj-core + test + + + org.glassfish.jersey.containers + jersey-container-servlet + test + + + org.glassfish.jersey.inject + jersey-hk2 + test + + + org.glassfish.jersey.core + jersey-server + test + + + org.glassfish.jersey.core + jersey-common + test + - - - org.glassfish.jersey.test-framework.providers - jersey-test-framework-provider-grizzly2 - ${v.jersey} - test - - - - - javax.servlet - javax.servlet-api - - - + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + ${v.jersey} + test + - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - + + + + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + diff --git a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java index f964ea2ef..6a86a530c 100644 --- a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java +++ b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/AbstractOslcRdfJsonProvider.java @@ -21,17 +21,6 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.ResponseBuilder; -import javax.ws.rs.ext.Providers; - import org.apache.wink.json4j.JSONObject; import org.eclipse.lyo.oslc4j.core.OSLC4JConstants; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; @@ -42,6 +31,16 @@ import org.eclipse.lyo.oslc4j.core.model.ResponseInfo; import org.eclipse.lyo.oslc4j.core.model.ResponseInfoArray; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.ResponseBuilder; +import jakarta.ws.rs.ext.Providers; + /** * Use JSON-LD support in Jena provider. */ diff --git a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcCompactJsonProvider.java b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcCompactJsonProvider.java index 8a1c7e7e7..7401de774 100644 --- a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcCompactJsonProvider.java +++ b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcCompactJsonProvider.java @@ -19,18 +19,18 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.model.Compact; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +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; + /** * Use JSON-LD support in Jena provider. */ diff --git a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonArrayProvider.java b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonArrayProvider.java index 560326b6f..bee0743d5 100644 --- a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonArrayProvider.java +++ b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonArrayProvider.java @@ -19,17 +19,17 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +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; + /** * Use JSON-LD support in Jena provider. */ diff --git a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonCollectionProvider.java b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonCollectionProvider.java index ea3773f43..19ec1d72a 100644 --- a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonCollectionProvider.java +++ b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonCollectionProvider.java @@ -37,20 +37,20 @@ import java.util.SortedSet; import java.util.TreeSet; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.CoreHelper; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +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; + /** * Use JSON-LD support in Jena provider. */ diff --git a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java index 2012a6609..7c6195dff 100644 --- a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java +++ b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcRdfJsonProvider.java @@ -25,15 +25,6 @@ import java.util.Collection; import java.util.Map; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; import org.eclipse.lyo.oslc4j.core.model.FilteredResource; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; @@ -43,6 +34,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +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; + /** * Use JSON-LD support in Jena provider. */ diff --git a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java index e2016ded0..9716957d8 100644 --- a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java +++ b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonArrayProvider.java @@ -18,15 +18,15 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.Provider; + /** * Use JSON-LD support in Jena provider. */ diff --git a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java index 283a7df10..ca4c3e30c 100644 --- a/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java +++ b/core/oslc4j-json4j-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcSimpleRdfJsonCollectionProvider.java @@ -19,15 +19,15 @@ import java.lang.reflect.Type; import java.util.Collection; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.Provider; - import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.Provider; + /** * Use JSON-LD support in Jena provider. */ diff --git a/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcJsonProviderCollectionTest.java b/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcJsonProviderCollectionTest.java index c17b5095b..6687233cf 100644 --- a/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcJsonProviderCollectionTest.java +++ b/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/OslcJsonProviderCollectionTest.java @@ -1,5 +1,16 @@ package org.eclipse.lyo.oslc4j.provider.json4j; +import static org.assertj.core.api.Assertions.assertThat; + +import java.lang.reflect.Array; +import java.lang.reflect.InvocationTargetException; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Set; +import java.util.stream.Stream; + +import javax.xml.datatype.DatatypeConfigurationException; + import org.apache.wink.json4j.JSONException; import org.apache.wink.json4j.JSONObject; import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; @@ -21,18 +32,9 @@ import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.datatype.DatatypeConfigurationException; -import java.lang.reflect.Array; -import java.lang.reflect.InvocationTargetException; -import java.net.URISyntaxException; -import java.util.List; -import java.util.Set; -import java.util.stream.Stream; - -import static org.assertj.core.api.Assertions.*; +import jakarta.ws.rs.core.GenericType; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; public class OslcJsonProviderCollectionTest extends JerseyTest { diff --git a/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/ProviderCollectionResource.java b/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/ProviderCollectionResource.java index 03d117a2e..5abbe4ab1 100644 --- a/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/ProviderCollectionResource.java +++ b/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/ProviderCollectionResource.java @@ -1,37 +1,33 @@ package org.eclipse.lyo.oslc4j.provider.json4j; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + import org.eclipse.lyo.oslc4j.core.OSLC4JConstants; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; import org.eclipse.lyo.oslc4j.core.annotation.OslcQueryCapability; -import org.eclipse.lyo.oslc4j.core.model.OslcConstants; import org.eclipse.lyo.oslc4j.core.model.OslcMediaType; import org.eclipse.lyo.oslc4j.provider.json4j.test.resources.TestResource; import org.eclipse.lyo.oslc4j.provider.json4j.test.resources.TestResourceNonQ; -import org.junit.Test; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import java.io.IOException; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.IntStream; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.GenericEntity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriBuilder; +import jakarta.ws.rs.core.UriInfo; @Path("/test") public class ProviderCollectionResource { diff --git a/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/test/JsonOslcNameTest.java b/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/test/JsonOslcNameTest.java index ea84179e9..8f8b4c93f 100644 --- a/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/test/JsonOslcNameTest.java +++ b/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/test/JsonOslcNameTest.java @@ -13,6 +13,10 @@ */ package org.eclipse.lyo.oslc4j.provider.json4j.test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -21,8 +25,6 @@ import java.util.ArrayList; import java.util.List; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; import javax.xml.namespace.QName; import org.apache.wink.json4j.JSONArray; @@ -34,8 +36,10 @@ import org.eclipse.lyo.oslc4j.provider.json4j.test.resources.EmptyNameResource; import org.eclipse.lyo.oslc4j.provider.json4j.test.resources.TestResource; import org.eclipse.lyo.oslc4j.provider.json4j.test.resources.UnnamedResource; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; /** * Tests Json working with different combinations of OslcName annotation. @@ -63,7 +67,7 @@ public void testJenaOslcNameEmptyString() throws Exception { final OslcRdfJsonProvider oslcRdfJsonProvider = new OslcRdfJsonProvider(); JSONObject jsonObject = getJSONObject(resource, oslcRdfJsonProvider); JSONArray rdfTypes = jsonObject.getJSONArray("rdf:type"); - Assert.assertTrue("Model should not contain RDF type as OslcName is empty", rdfTypes.isEmpty()); + assertTrue(rdfTypes.isEmpty(), "Model should not contain RDF type as OslcName is empty"); } private JSONObject getJSONObject(Object resource, final OslcRdfJsonProvider oslcRdfJsonProvider) @@ -90,7 +94,7 @@ public void testJenaOslcNameEmptyStringAndOtherTypes() throws Exception { final OslcRdfJsonProvider oslcRdfJsonProvider = new OslcRdfJsonProvider(); JSONObject jsonObject = getJSONObject(resource, oslcRdfJsonProvider); JSONArray rdfTypes = jsonObject.getJSONArray("rdf:type"); - Assert.assertEquals("Model should contain only added RDF type", rdfTypes.size(), 1); + assertEquals(1, rdfTypes.size(),"Model should contain only added RDF type"); verifyRDFTypes(new String[] { typeToAdd }, rdfTypes); } @@ -105,7 +109,7 @@ public void testJenaRegularOslcName() throws Exception { final OslcRdfJsonProvider oslcRdfJsonProvider = new OslcRdfJsonProvider(); JSONObject jsonObject = getJSONObject(resource, oslcRdfJsonProvider); JSONArray rdfTypes = jsonObject.getJSONArray("rdf:type"); - Assert.assertEquals("Model should contain default RDF type", rdfTypes.size(), 1); + assertEquals(1, rdfTypes.size(),"Model should contain default RDF type"); verifyRDFTypes(new String[] { TestResource.TEST_NAMESPACE + "Test" }, rdfTypes); } @@ -123,7 +127,7 @@ public void testJenaDefaultOslcName() throws Exception { final OslcRdfJsonProvider oslcRdfJsonProvider = new OslcRdfJsonProvider(); JSONObject jsonObject = getJSONObject(resource, oslcRdfJsonProvider); JSONArray rdfTypes = jsonObject.getJSONArray("rdf:type"); - Assert.assertFalse("Model should contain RDF types", rdfTypes.isEmpty()); + assertFalse( rdfTypes.isEmpty(), "Model should contain RDF types"); verifyRDFTypes(new String[] { typeToAdd, TestResource.TEST_NAMESPACE + "UnnamedResource" }, rdfTypes); } @@ -135,8 +139,7 @@ private void verifyRDFTypes(String[] expectedRDFTypes, JSONArray rdfTypes) throw actualRdfTypesList.add(type); } for (String expectedRdfType : expectedRDFTypes) { - Assert.assertTrue("Resource should contain RDF type " + expectedRdfType, - actualRdfTypesList.contains(expectedRdfType)); + assertTrue(actualRdfTypesList.contains(expectedRdfType), "Resource should contain RDF type " + expectedRdfType); } } diff --git a/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/test/TestInvalidTypesJson.java b/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/test/TestInvalidTypesJson.java index ed2e3205e..dedd67c3f 100644 --- a/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/test/TestInvalidTypesJson.java +++ b/core/oslc4j-json4j-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/json4j/test/TestInvalidTypesJson.java @@ -11,39 +11,35 @@ * * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause */ + package org.eclipse.lyo.oslc4j.provider.json4j.test; +import static org.junit.jupiter.api.Assertions.assertThrows; + import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import javax.ws.rs.WebApplicationException; - import org.eclipse.lyo.oslc4j.provider.json4j.OslcRdfJsonProvider; import org.eclipse.lyo.oslc4j.provider.json4j.test.resources.TestResource; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import jakarta.ws.rs.WebApplicationException; @SuppressWarnings("deprecation") -public class TestInvalidTypesJson -{ - @Test(expected = WebApplicationException.class) - public void testInvalidJavaAboutRelativeURI() - throws IOException, - URISyntaxException - { - final TestResource relativeUri = new TestResource(); - - relativeUri.setAbout(new URI("relative")); - - final OslcRdfJsonProvider oslcRdfJsonProvider = new OslcRdfJsonProvider(); - - oslcRdfJsonProvider.writeTo(relativeUri, - null, - null, - null, - null, - null, - null); - - } +public class TestInvalidTypesJson { + @Test + public void testInvalidJavaAboutRelativeURI() throws IOException, URISyntaxException { + assertThrows(WebApplicationException.class, () -> { + + final TestResource relativeUri = new TestResource(); + + relativeUri.setAbout(new URI("relative")); + + final OslcRdfJsonProvider oslcRdfJsonProvider = new OslcRdfJsonProvider(); + + oslcRdfJsonProvider.writeTo(relativeUri, null, null, null, null, null, null); + }); + + } } diff --git a/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/MarshallerConstants.java b/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/MarshallerConstants.java index 9a5b73839..e2b5ab859 100644 --- a/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/MarshallerConstants.java +++ b/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/MarshallerConstants.java @@ -13,7 +13,7 @@ */ package org.eclipse.lyo.core.utils.marshallers; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MediaType; public class MarshallerConstants { //Media Types diff --git a/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/OSLC4JMarshaller.java b/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/OSLC4JMarshaller.java index 7874b77eb..24cbe574d 100644 --- a/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/OSLC4JMarshaller.java +++ b/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/OSLC4JMarshaller.java @@ -13,20 +13,23 @@ */ package org.eclipse.lyo.core.utils.marshallers; -import java.io.OutputStream; - -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; +import static org.eclipse.lyo.core.utils.marshallers.MarshallerConstants.MT_N3; +import static org.eclipse.lyo.core.utils.marshallers.MarshallerConstants.MT_N_TRIPLES; +import static org.eclipse.lyo.core.utils.marshallers.MarshallerConstants.MT_OSLC_COMPACT; +import static org.eclipse.lyo.core.utils.marshallers.MarshallerConstants.MT_RDF_XML; +import static org.eclipse.lyo.core.utils.marshallers.MarshallerConstants.MT_TURTLE; -import org.apache.wink.json4j.JSONObject; -import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; -import org.eclipse.lyo.oslc4j.provider.json4j.JsonHelper; +import java.io.OutputStream; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.RDFWriterI; import org.apache.jena.util.FileUtils; +import org.apache.wink.json4j.JSONObject; +import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; +import org.eclipse.lyo.oslc4j.provider.json4j.JsonHelper; -import static org.eclipse.lyo.core.utils.marshallers.MarshallerConstants.*; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; public class OSLC4JMarshaller { OSLC4JContext context = new OSLC4JContext(); diff --git a/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/OSLC4JUnmarshaller.java b/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/OSLC4JUnmarshaller.java index e1431c1ea..d95e442ce 100644 --- a/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/OSLC4JUnmarshaller.java +++ b/core/oslc4j-utils/src/main/java/org/eclipse/lyo/core/utils/marshallers/OSLC4JUnmarshaller.java @@ -22,16 +22,16 @@ import java.lang.reflect.InvocationTargetException; import java.net.URISyntaxException; -import javax.ws.rs.core.MediaType; import javax.xml.datatype.DatatypeConfigurationException; -import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; -import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; - import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.RDFReaderI; import org.apache.jena.util.FileUtils; +import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; +import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; + +import jakarta.ws.rs.core.MediaType; public class OSLC4JUnmarshaller { diff --git a/domains/oslc-domains/pom.xml b/domains/oslc-domains/pom.xml index 70da282c2..7a2468eda 100644 --- a/domains/oslc-domains/pom.xml +++ b/domains/oslc-domains/pom.xml @@ -1,79 +1,81 @@ - 4.0.0 - - - - org.eclipse.lyo - lyo-parent - 6.0.0-SNAPSHOT - ../../pom.xml - - + + org.eclipse.lyo - oslc-domains + lyo-parent 6.0.0-SNAPSHOT - jar - Lyo :: Domains - - + org.eclipse.lyo + oslc-domains + 6.0.0-SNAPSHOT + jar + Lyo :: Domains + + - - + - - - - - - + - - + - - - javax.servlet - javax.servlet-api - provided - - - javax.servlet.jsp.jstl - javax.servlet.jsp.jstl-api - provided - + + + jakarta.servlet + jakarta.servlet-api + + + jakarta.servlet.jsp.jstl + jakarta.servlet.jsp.jstl-api + - - - org.eclipse.lyo.oslc4j.core - oslc4j-core - - + + org.eclipse.lyo.oslc4j.core + oslc4j-core + + - - + - - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/pom.xml b/pom.xml index 199a4b38b..dabfdff49 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.eclipse.lyo lyo-parent @@ -20,7 +21,7 @@ 1.9.21 1.9.10 - 2.35 + 3.1.5 3.1.0 4.8.0 @@ -35,9 +36,12 @@ https://eclipse.org/lyo - The Eclipse Lyo project is focused on providing an SDK to enable adoption of OSLC specifications. OSLC (Open - Services for Lifecycle Collaboration) is an open community dedicated to reducing barriers for lifecycle tool - integration. The community authors specifications for exposing lifecycle artifacts through uniform (REST) + The Eclipse Lyo project is focused on providing an SDK to enable adoption of + OSLC specifications. OSLC (Open + Services for Lifecycle Collaboration) is an open community dedicated to + reducing barriers for lifecycle tool + integration. The community authors specifications for exposing lifecycle + artifacts through uniform (REST) interfaces and relying on Internet and Linked Data standards. @@ -134,7 +138,8 @@ jena-staging Apache Jena staging - https://repository.apache.org/content/repositories/orgapachejena-1052 + + https://repository.apache.org/content/repositories/orgapachejena-1052 false @@ -190,7 +195,8 @@ dash-licenses-snapshots - https://repo.eclipse.org/content/repositories/dash-licenses-snapshots/ + + https://repo.eclipse.org/content/repositories/dash-licenses-snapshots/ true @@ -214,9 +220,9 @@ - javax.servlet.jsp.jstl - javax.servlet.jsp.jstl-api - 1.2.2 + jakarta.servlet.jsp.jstl + jakarta.servlet.jsp.jstl-api + 3.0.0 org.eclipse.lyo.oslc4j.core @@ -236,12 +242,18 @@ jakarta.xml.bind jakarta.xml.bind-api - 2.3.3 + 4.0.2 + + + jakarta.annotation + jakarta.annotation-api + 2.1.1 + provided org.glassfish.jaxb jaxb-runtime - 2.3.6 + 4.0.5 @@ -297,12 +309,12 @@ jakarta.ws.rs jakarta.ws.rs-api - 2.1.6 + 3.1.0 - javax.servlet - javax.servlet-api - 3.1.0 + jakarta.servlet + jakarta.servlet-api + 6.0.0 org.glassfish.jersey.containers @@ -383,16 +395,10 @@ guava ${v.guava} - - jakarta.annotation - jakarta.annotation-api - 1.3.5 - provided - jakarta.activation jakarta.activation-api - 1.2.2 + 2.1.3 provided @@ -425,7 +431,8 @@ maven-compiler-plugin 3.12.1 - -Xlint:fallthrough,unchecked,removal,deprecation,dep-ann,varargs,overloads,serial,try,finally + + -Xlint:fallthrough,unchecked,removal,deprecation,dep-ann,varargs,overloads,serial,try,finally @@ -446,21 +453,6 @@ maven-javadoc-plugin 3.6.3 - - - - OslcSchema - X - - - OslcNamespaceDefinition - X - - - Deprecated - X - - all,-accessibility,-html,-missing @@ -486,7 +478,8 @@ maven-surefire-plugin 3.2.5 - + false @@ -535,7 +528,7 @@ org.apache.logging.log4j:log4j-core - + diff --git a/server/net.oauth.core-oauth-consumer-jakarta/pom.xml b/server/net.oauth.core-oauth-consumer-jakarta/pom.xml new file mode 100644 index 000000000..68dbd584a --- /dev/null +++ b/server/net.oauth.core-oauth-consumer-jakarta/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + + org.eclipse.lyo.oslc4j.server + lyo-server-build + 6.0.0-SNAPSHOT + ../pom.xml + + org.eclipse.lyo.server + net.oauth.core-oauth-consumer-jakarta + jar + + + net.oauth.core + oauth-consumer + + + + + + org.eclipse.transformer + transformer-maven-plugin + 0.5.0 + true + + + true + + + + + default-jar + + jar + + + + net.oauth.core + oauth-consumer + + + + + + + + + diff --git a/server/net.oauth.core-oauth-httpclient4-jakarta/pom.xml b/server/net.oauth.core-oauth-httpclient4-jakarta/pom.xml new file mode 100644 index 000000000..3a30a1e58 --- /dev/null +++ b/server/net.oauth.core-oauth-httpclient4-jakarta/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + org.eclipse.lyo.oslc4j.server + lyo-server-build + 6.0.0-SNAPSHOT + ../pom.xml + + org.eclipse.lyo.server + net.oauth.core-oauth-httpclient4-jakarta + jar + + + net.oauth.core + oauth-httpclient4 + + + org.apache.httpcomponents + httpclient + + + + + + + + org.eclipse.transformer + transformer-maven-plugin + 0.5.0 + true + + + true + + + + + default-jar + + jar + + + + net.oauth.core + oauth-httpclient4 + + + + + + + + + diff --git a/server/net.oauth.core-oauth-jakarta/pom.xml b/server/net.oauth.core-oauth-jakarta/pom.xml new file mode 100644 index 000000000..e1620ae9a --- /dev/null +++ b/server/net.oauth.core-oauth-jakarta/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + + org.eclipse.lyo.oslc4j.server + lyo-server-build + 6.0.0-SNAPSHOT + ../pom.xml + + org.eclipse.lyo.server + net.oauth.core-oauth-jakarta + jar + + + net.oauth.core + oauth + + + + + + org.eclipse.transformer + transformer-maven-plugin + 0.5.0 + true + + + true + + + + + default-jar + + jar + + + + net.oauth.core + oauth + + + + + + + + + diff --git a/server/net.oauth.core-oauth-provider-jakarta/pom.xml b/server/net.oauth.core-oauth-provider-jakarta/pom.xml new file mode 100644 index 000000000..5488d39d7 --- /dev/null +++ b/server/net.oauth.core-oauth-provider-jakarta/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + + org.eclipse.lyo.oslc4j.server + lyo-server-build + 6.0.0-SNAPSHOT + ../pom.xml + + org.eclipse.lyo.server + net.oauth.core-oauth-provider-jakarta + jar + + + net.oauth.core + oauth-provider + + + + + + org.eclipse.transformer + transformer-maven-plugin + 0.5.0 + true + + + true + + + + + default-jar + + jar + + + + net.oauth.core + oauth-provider + + + + + + + + + diff --git a/server/oauth-consumer-store/pom.xml b/server/oauth-consumer-store/pom.xml index 338175dbc..2469934f8 100644 --- a/server/oauth-consumer-store/pom.xml +++ b/server/oauth-consumer-store/pom.xml @@ -29,8 +29,8 @@ pom - javax.annotation - javax.annotation-api + jakarta.annotation + jakarta.annotation-api org.apache.httpcomponents diff --git a/server/oauth-core/pom.xml b/server/oauth-core/pom.xml index 0e407377b..0ef21dbeb 100644 --- a/server/oauth-core/pom.xml +++ b/server/oauth-core/pom.xml @@ -29,23 +29,52 @@ jakarta.ws.rs-api - net.oauth.core - oauth + org.eclipse.lyo.server + net.oauth.core-oauth-jakarta + ${v.lyo} + + + + net.oauth.core + oauth + + - net.oauth.core - oauth-consumer + org.eclipse.lyo.server + net.oauth.core-oauth-consumer-jakarta + ${v.lyo} + + + + net.oauth.core + oauth-consumer + + - net.oauth.core - oauth-provider + org.eclipse.lyo.server + net.oauth.core-oauth-provider-jakarta + ${v.lyo} + + + + net.oauth.core + oauth-provider + + - javax.servlet - javax.servlet-api - provided + jakarta.servlet + jakarta.servlet-api org.slf4j diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/Application.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/Application.java index 970141af4..a840aabb5 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/Application.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/Application.java @@ -13,7 +13,7 @@ */ package org.eclipse.lyo.server.oauth.core; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** * Handles authentication with the backend system. diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/AuthenticationException.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/AuthenticationException.java index 6f32a869c..e60eb2798 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/AuthenticationException.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/AuthenticationException.java @@ -13,7 +13,7 @@ */ package org.eclipse.lyo.server.oauth.core; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** * An exception indicating that authentication failed. diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/OAuthConfiguration.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/OAuthConfiguration.java index 01f61e994..c35016fee 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/OAuthConfiguration.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/OAuthConfiguration.java @@ -13,18 +13,18 @@ */ package org.eclipse.lyo.server.oauth.core; -import javax.servlet.http.HttpServletResponse; - -import net.oauth.OAuthProblemException; -import net.oauth.OAuthValidator; -import net.oauth.SimpleOAuthValidator; -import net.oauth.http.HttpMessage; +import jakarta.servlet.http.HttpServletResponse; import org.eclipse.lyo.server.oauth.core.consumer.ConsumerStore; import org.eclipse.lyo.server.oauth.core.consumer.ConsumerStoreException; import org.eclipse.lyo.server.oauth.core.token.SimpleTokenStrategy; import org.eclipse.lyo.server.oauth.core.token.TokenStrategy; +import net.oauth.OAuthProblemException; +import net.oauth.OAuthValidator; +import net.oauth.SimpleOAuthValidator; +import net.oauth.http.HttpMessage; + /** * Manages the OAuth provider configuration, including the validator, consumer store, and * token strategy. diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/OAuthRequest.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/OAuthRequest.java index b1d4d1e8e..18c40394c 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/OAuthRequest.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/OAuthRequest.java @@ -16,10 +16,14 @@ import java.io.IOException; import java.net.URISyntaxException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.UriBuilder; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import jakarta.ws.rs.core.UriBuilder; import net.oauth.OAuth; import net.oauth.OAuthAccessor; import net.oauth.OAuthException; @@ -28,10 +32,6 @@ import net.oauth.OAuthValidator; import net.oauth.server.OAuthServlet; -import org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Validates that a request is authorized. The request must contain a valid * access token and pass {@link OAuthValidator} tests. To change the validator @@ -120,7 +120,7 @@ public LyoOAuthConsumer getConsumer() { * using the validator set in the {@link OAuthConfiguration}. *

* If the request fails validation, you can use - * {@link OAuthServlet#handleException(javax.servlet.http.HttpServletResponse, Exception, String)} + * {@link OAuthServlet#handleException(jakarta.servlet.http.HttpServletResponse, Exception, String)} * to send an unauthorized response. * * @throws OAuthException if the request fails validation diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/SimpleTokenStrategy.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/SimpleTokenStrategy.java index c62865e15..82176e384 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/SimpleTokenStrategy.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/SimpleTokenStrategy.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.UUID; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.eclipse.lyo.server.oauth.core.OAuthRequest; diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/TokenStrategy.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/TokenStrategy.java index d321516f3..0f306a977 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/TokenStrategy.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/token/TokenStrategy.java @@ -15,14 +15,13 @@ import java.io.IOException; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; + +import org.eclipse.lyo.server.oauth.core.OAuthRequest; -import net.oauth.OAuthAccessor; import net.oauth.OAuthException; import net.oauth.OAuthMessage; -import org.eclipse.lyo.server.oauth.core.OAuthRequest; - /** * Manages and validates OAuth tokens and token secrets. * {@link SimpleTokenStrategy} is a basic implementation, but you can implement diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java index 0f8b4d537..c73e490c4 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java @@ -16,26 +16,18 @@ import java.io.IOException; import java.net.URISyntaxException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; - -import net.oauth.OAuth; -import net.oauth.OAuthAccessor; -import net.oauth.OAuthException; -import net.oauth.OAuthMessage; -import net.oauth.OAuthProblemException; -import net.oauth.http.HttpMessage; -import net.oauth.server.OAuthServlet; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpSessionEvent; +import jakarta.servlet.http.HttpSessionListener; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; import org.eclipse.lyo.server.oauth.core.Application; @@ -49,6 +41,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import net.oauth.OAuth; +import net.oauth.OAuthAccessor; +import net.oauth.OAuthException; +import net.oauth.OAuthMessage; +import net.oauth.OAuthProblemException; +import net.oauth.http.HttpMessage; +import net.oauth.server.OAuthServlet; + /** *

Overview

* Purpose: Provide a JEE Servlet filter base implementation for accepting diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/RestException.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/RestException.java index 22eb80db5..3fc9f0786 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/RestException.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/RestException.java @@ -13,7 +13,7 @@ */ package org.eclipse.lyo.server.oauth.core.utils; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; /** * Holds a status code and error message for an error response. diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/UnauthorizedException.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/UnauthorizedException.java index a723ea78b..4f33efe82 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/UnauthorizedException.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/UnauthorizedException.java @@ -13,7 +13,7 @@ */ package org.eclipse.lyo.server.oauth.core.utils; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; /** * Corresponds to an HTTP 401 response. diff --git a/server/oauth-webapp/pom.xml b/server/oauth-webapp/pom.xml index 747710a88..548ede7c4 100644 --- a/server/oauth-webapp/pom.xml +++ b/server/oauth-webapp/pom.xml @@ -16,19 +16,9 @@ + - - - net.oauth.core - oauth - provided - - - net.oauth.core - oauth-provider - provided - - org.eclipse.lyo.server @@ -39,14 +29,14 @@ - javax.servlet.jsp.jstl - javax.servlet.jsp.jstl-api + jakarta.servlet.jsp.jstl + jakarta.servlet.jsp.jstl-api provided - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api provided diff --git a/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/CSRFPrevent.java b/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/CSRFPrevent.java index 8b212e168..37b339504 100644 --- a/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/CSRFPrevent.java +++ b/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/CSRFPrevent.java @@ -13,15 +13,16 @@ */ package org.eclipse.lyo.server.oauth.webapp.services; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import jakarta.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; + /** * Checks requests to see if they have the right X-CSRF-Prevent header values. * diff --git a/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/ConsumersService.java b/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/ConsumersService.java index f96c35040..8e2095a3c 100644 --- a/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/ConsumersService.java +++ b/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/ConsumersService.java @@ -16,22 +16,8 @@ import java.util.Collection; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import net.oauth.OAuthProblemException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.wink.json4j.JSONArray; import org.apache.wink.json4j.JSONException; @@ -43,6 +29,20 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.FormParam; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import net.oauth.OAuthProblemException; + /** * Manages OAuth consumers for this provider. * diff --git a/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/OAuthService.java b/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/OAuthService.java index cde971f07..e2027aeeb 100644 --- a/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/OAuthService.java +++ b/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/OAuthService.java @@ -20,31 +20,9 @@ import java.util.List; import java.util.UUID; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriBuilder; - -import net.oauth.OAuth; -import net.oauth.OAuth.Parameter; -import net.oauth.OAuthAccessor; -import net.oauth.OAuthException; -import net.oauth.OAuthMessage; -import net.oauth.OAuthProblemException; -import net.oauth.OAuthValidator; -import net.oauth.server.OAuthServlet; -import net.oauth.signature.OAuthSignatureMethod; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.wink.json4j.JSON; import org.apache.wink.json4j.JSONException; @@ -59,6 +37,27 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.FormParam; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.core.UriBuilder; +import net.oauth.OAuth; +import net.oauth.OAuth.Parameter; +import net.oauth.OAuthAccessor; +import net.oauth.OAuthException; +import net.oauth.OAuthMessage; +import net.oauth.OAuthProblemException; +import net.oauth.OAuthValidator; +import net.oauth.server.OAuthServlet; + /** * Issues OAuth request tokens, handles authentication, and then exchanges * request tokens for access tokens based on the OAuth configuration set in the diff --git a/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/OAuthServletListener.java b/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/OAuthServletListener.java index 30262b969..75d0c9c14 100644 --- a/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/OAuthServletListener.java +++ b/server/oauth-webapp/src/main/java/org/eclipse/lyo/server/oauth/webapp/services/OAuthServletListener.java @@ -14,13 +14,13 @@ package org.eclipse.lyo.server.oauth.webapp.services; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; + import org.eclipse.lyo.server.oauth.core.OAuthConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - public class OAuthServletListener implements ServletContextListener { private static final Logger log = LoggerFactory.getLogger(OAuthServletListener.class); diff --git a/server/oauth-webapp/src/main/webapp/WEB-INF/web.xml b/server/oauth-webapp/src/main/webapp/WEB-INF/web.xml index 593d8fcd2..ec1d01d2b 100644 --- a/server/oauth-webapp/src/main/webapp/WEB-INF/web.xml +++ b/server/oauth-webapp/src/main/webapp/WEB-INF/web.xml @@ -12,11 +12,11 @@ --> - + xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee/ + https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" + version="5.0"> Eclipse Lyo Sample OAuth Provider An example demonstrating the Lyo OAuth provider framework. diff --git a/server/pom.xml b/server/pom.xml index ca3e40686..cfe2be6a4 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -19,6 +19,10 @@ oauth-consumer-store oauth-webapp oslc-ui-model + net.oauth.core-oauth-jakarta + net.oauth.core-oauth-consumer-jakarta + net.oauth.core-oauth-provider-jakarta + net.oauth.core-oauth-httpclient4-jakarta @@ -38,6 +42,11 @@ oauth-provider 20100527 + + net.oauth.core + oauth-httpclient4 + 20090913 + org.apache.wink wink-server @@ -54,12 +63,6 @@ stax-api 1.0.1 - - javax.servlet - javax.servlet-api - 3.1.0 - provided - @@ -83,6 +86,9 @@ org.apache.maven.plugins maven-javadoc-plugin + + net.oauth.core-oauth-jakarta, net.oauth.core-oauth-consumer-jakarta, net.oauth.core-oauth-provider-jakarta + diff --git a/store/store-core/pom.xml b/store/store-core/pom.xml index 2590f8d55..35b9288aa 100644 --- a/store/store-core/pom.xml +++ b/store/store-core/pom.xml @@ -63,8 +63,8 @@ pom - javax.annotation - javax.annotation-api + jakarta.annotation + jakarta.annotation-api org.apache.httpcomponents diff --git a/store/store-core/src/main/java/org/eclipse/lyo/store/Store.java b/store/store-core/src/main/java/org/eclipse/lyo/store/Store.java index 33b36f17e..b3b0d37a5 100644 --- a/store/store-core/src/main/java/org/eclipse/lyo/store/Store.java +++ b/store/store-core/src/main/java/org/eclipse/lyo/store/Store.java @@ -1,5 +1,14 @@ package org.eclipse.lyo.store; +import java.net.URI; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; + +import org.apache.jena.arq.querybuilder.SelectBuilder; + /* * Copyright (c) 2020 Contributors to the Eclipse Foundation * @@ -15,14 +24,6 @@ */ import org.apache.jena.rdf.model.Model; -import org.apache.jena.arq.querybuilder.SelectBuilder; -import java.net.URISyntaxException; -import java.net.URI; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Set; import org.eclipse.lyo.oslc4j.core.model.IResource; /** diff --git a/store/store-core/src/main/java/org/eclipse/lyo/store/StorePool.java b/store/store-core/src/main/java/org/eclipse/lyo/store/StorePool.java index acb222230..f58f85085 100644 --- a/store/store-core/src/main/java/org/eclipse/lyo/store/StorePool.java +++ b/store/store-core/src/main/java/org/eclipse/lyo/store/StorePool.java @@ -1,5 +1,9 @@ package org.eclipse.lyo.store; +import java.net.URI; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; + /* * Copyright (c) 2020 Contributors to the Eclipse Foundation * @@ -21,10 +25,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.net.URI; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingQueue; - public class StorePool { public final static URI DEFAULT_GRAPH_JENA = URI.create("urn:x-arq:DefaultGraph"); diff --git a/store/store-core/src/main/java/org/eclipse/lyo/store/internals/DatasetBuilder.java b/store/store-core/src/main/java/org/eclipse/lyo/store/internals/DatasetBuilder.java index a597300aa..f62fbbd69 100644 --- a/store/store-core/src/main/java/org/eclipse/lyo/store/internals/DatasetBuilder.java +++ b/store/store-core/src/main/java/org/eclipse/lyo/store/internals/DatasetBuilder.java @@ -1,5 +1,9 @@ package org.eclipse.lyo.store.internals; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + /* * Copyright (c) 2020 Contributors to the Eclipse Foundation * @@ -18,9 +22,6 @@ import org.apache.jena.query.Dataset; import org.apache.jena.tdb.TDB; import org.apache.jena.tdb.TDBFactory; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/store/store-core/src/main/java/org/eclipse/lyo/store/internals/SparqlStoreImpl.java b/store/store-core/src/main/java/org/eclipse/lyo/store/internals/SparqlStoreImpl.java index dbafb6418..3c3000360 100644 --- a/store/store-core/src/main/java/org/eclipse/lyo/store/internals/SparqlStoreImpl.java +++ b/store/store-core/src/main/java/org/eclipse/lyo/store/internals/SparqlStoreImpl.java @@ -1,5 +1,24 @@ package org.eclipse.lyo.store.internals; +import java.lang.reflect.Array; +import java.lang.reflect.InvocationTargetException; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.xml.datatype.DatatypeConfigurationException; + /* * Copyright (c) 2020 Contributors to the Eclipse Foundation * @@ -63,25 +82,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.datatype.DatatypeConfigurationException; -import java.lang.reflect.Array; -import java.lang.reflect.InvocationTargetException; -import java.net.URI; -import java.net.URISyntaxException; -import java.time.Duration; -import java.time.Instant; -import java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.NoSuchElementException; -import java.util.Set; -import java.util.stream.Collectors; - /** * {@link Store} interface implementation that interacts with any SPARQL-based triplestore * through a Query and Update endpoints. diff --git a/store/store-core/src/main/java/org/eclipse/lyo/store/internals/query/SparqlQueryExecutorBasicAuthImpl.java b/store/store-core/src/main/java/org/eclipse/lyo/store/internals/query/SparqlQueryExecutorBasicAuthImpl.java index 4681a8a62..65f3f668f 100644 --- a/store/store-core/src/main/java/org/eclipse/lyo/store/internals/query/SparqlQueryExecutorBasicAuthImpl.java +++ b/store/store-core/src/main/java/org/eclipse/lyo/store/internals/query/SparqlQueryExecutorBasicAuthImpl.java @@ -1,5 +1,7 @@ package org.eclipse.lyo.store.internals.query; +import static org.apache.jena.http.HttpLib.basicAuth; + /* * Copyright (c) 2022 Contributors to the Eclipse Foundation * @@ -24,8 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.apache.jena.http.HttpLib.basicAuth; - /** * SparqlQueryExecutorImpl is a SPARQL endpoint-based implementation of {@link JenaQueryExecutor}. * diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/DatasetBuilderTest.java b/store/store-core/src/test/java/org/eclipse/lyo/store/DatasetBuilderTest.java index a7266f6fc..13be0d1bd 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/DatasetBuilderTest.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/DatasetBuilderTest.java @@ -14,10 +14,7 @@ package org.eclipse.lyo.store; -import org.apache.jena.query.Dataset; -import org.eclipse.lyo.store.internals.DatasetBuilder; -import org.junit.Ignore; -import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; import java.nio.file.Files; @@ -25,7 +22,10 @@ import java.nio.file.Paths; import java.util.Iterator; -import static org.assertj.core.api.Assertions.*; +import org.apache.jena.query.Dataset; +import org.eclipse.lyo.store.internals.DatasetBuilder; +import org.junit.Ignore; +import org.junit.Test; public class DatasetBuilderTest { diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/SparqlStoreImplIT.java b/store/store-core/src/test/java/org/eclipse/lyo/store/SparqlStoreImplIT.java index c5b2533db..66b947d43 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/SparqlStoreImplIT.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/SparqlStoreImplIT.java @@ -16,6 +16,7 @@ import java.io.IOException; import java.util.Properties; + import org.assertj.core.util.Strings; import org.eclipse.lyo.store.internals.SparqlStoreImpl; import org.junit.jupiter.api.BeforeEach; diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/SparqlStoreImplTest.java b/store/store-core/src/test/java/org/eclipse/lyo/store/SparqlStoreImplTest.java index 5b820eef0..a5bad6957 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/SparqlStoreImplTest.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/SparqlStoreImplTest.java @@ -1,5 +1,25 @@ package org.eclipse.lyo.store; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import java.lang.reflect.InvocationTargetException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import javax.xml.datatype.DatatypeConfigurationException; + +import org.apache.jena.rdf.model.Model; +import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; +import org.eclipse.lyo.oslc4j.core.model.ServiceProvider; +import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; +import org.eclipse.lyo.store.internals.SparqlStoreImpl; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + /* * Copyright (c) 2022 Contributors to the Eclipse Foundation * @@ -15,23 +35,6 @@ */ import com.google.common.base.Stopwatch; -import org.apache.jena.rdf.model.Model; -import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; -import org.eclipse.lyo.oslc4j.core.model.ServiceProvider; -import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper; -import org.eclipse.lyo.store.internals.SparqlStoreImpl; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import javax.xml.datatype.DatatypeConfigurationException; -import java.lang.reflect.InvocationTargetException; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -import static org.assertj.core.api.Assertions.*; public class SparqlStoreImplTest extends StoreTestBase { diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/StorePoolTest.java b/store/store-core/src/test/java/org/eclipse/lyo/store/StorePoolTest.java index e032a9bd9..9f67b2978 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/StorePoolTest.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/StorePoolTest.java @@ -1,5 +1,11 @@ package org.eclipse.lyo.store; +import static org.assertj.core.api.Assertions.assertThat; + +import java.net.URI; +import java.util.List; +import java.util.UUID; + /* * Copyright (c) 2022 Contributors to the Eclipse Foundation * @@ -18,12 +24,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.net.URI; -import java.util.List; -import java.util.UUID; - -import static org.assertj.core.api.Assertions.*; - public class StorePoolTest { private final Logger log = LoggerFactory.getLogger(StorePoolTest.class); diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/StoreTestBase.java b/store/store-core/src/test/java/org/eclipse/lyo/store/StoreTestBase.java index 05ef84090..3af794175 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/StoreTestBase.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/StoreTestBase.java @@ -1,5 +1,29 @@ package org.eclipse.lyo.store; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Random; + +import org.apache.jena.rdf.model.Model; +import org.assertj.core.api.Assertions; +import org.eclipse.lyo.oslc4j.core.model.IResource; +import org.eclipse.lyo.oslc4j.core.model.ServiceProviderCatalog; +import org.eclipse.lyo.store.resources.BlankResource; +import org.eclipse.lyo.store.resources.Nsp1DomainConstants; +import org.eclipse.lyo.store.resources.Requirement; +import org.eclipse.lyo.store.resources.WithBlankResource; +import org.eclipse.lyo.store.resources.WithTwoDepthBlankResource; +import org.junit.jupiter.api.Test; + /* * Copyright (c) 2020 Contributors to the Eclipse Foundation * @@ -16,29 +40,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -import org.apache.jena.rdf.model.Model; -import org.assertj.core.api.Assertions; -import org.eclipse.lyo.oslc4j.core.model.IResource; -import org.eclipse.lyo.oslc4j.core.model.ServiceProviderCatalog; -import org.eclipse.lyo.store.resources.BlankResource; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.Requirement; -import org.eclipse.lyo.store.resources.WithBlankResource; -import org.eclipse.lyo.store.resources.WithTwoDepthBlankResource; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Random; - -import static org.assertj.core.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.*; /** diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/BlankResource.java b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/BlankResource.java index 447c00ba0..5516b612f 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/BlankResource.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/BlankResource.java @@ -18,48 +18,22 @@ import java.net.URI; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.text.SimpleDateFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.Iterator; -//import javax.servlet.http.HttpServletRequest; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import javax.ws.rs.core.UriBuilder; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; -import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; -import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValue; -import org.eclipse.lyo.oslc4j.core.annotation.OslcDescription; -import org.eclipse.lyo.oslc4j.core.annotation.OslcMemberProperty; import org.eclipse.lyo.oslc4j.core.annotation.OslcName; import org.eclipse.lyo.oslc4j.core.annotation.OslcNamespace; import org.eclipse.lyo.oslc4j.core.annotation.OslcOccurs; import org.eclipse.lyo.oslc4j.core.annotation.OslcPropertyDefinition; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRange; import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRepresentation; import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape; -import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle; import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType; +import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; import org.eclipse.lyo.oslc4j.core.model.AbstractResource; -import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.core.model.Occurs; import org.eclipse.lyo.oslc4j.core.model.OslcConstants; -import org.eclipse.lyo.oslc4j.core.model.Representation; -import org.eclipse.lyo.oslc4j.core.model.ValueType; import org.eclipse.lyo.oslc4j.core.model.ResourceShape; import org.eclipse.lyo.oslc4j.core.model.ResourceShapeFactory; - -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; +import org.eclipse.lyo.oslc4j.core.model.ValueType; // Start of user code imports // End of user code diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IBlankResource.java b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IBlankResource.java index 5e6d8b7c0..3acbe9e71 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IBlankResource.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IBlankResource.java @@ -16,47 +16,16 @@ package org.eclipse.lyo.store.resources; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.text.SimpleDateFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.Iterator; -//import javax.servlet.http.HttpServletRequest; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import javax.ws.rs.core.UriBuilder; - -import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValue; -import org.eclipse.lyo.oslc4j.core.annotation.OslcDescription; -import org.eclipse.lyo.oslc4j.core.annotation.OslcMemberProperty; import org.eclipse.lyo.oslc4j.core.annotation.OslcName; import org.eclipse.lyo.oslc4j.core.annotation.OslcNamespace; import org.eclipse.lyo.oslc4j.core.annotation.OslcOccurs; import org.eclipse.lyo.oslc4j.core.annotation.OslcPropertyDefinition; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRange; import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRepresentation; import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape; -import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle; import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType; -import org.eclipse.lyo.oslc4j.core.model.AbstractResource; -import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.core.model.Occurs; -import org.eclipse.lyo.oslc4j.core.model.OslcConstants; -import org.eclipse.lyo.oslc4j.core.model.Representation; import org.eclipse.lyo.oslc4j.core.model.ValueType; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; - // Start of user code imports // End of user code diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IWithBlankResource.java b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IWithBlankResource.java index 742f52960..73123d32f 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IWithBlankResource.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IWithBlankResource.java @@ -16,48 +16,17 @@ package org.eclipse.lyo.store.resources; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.text.SimpleDateFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.Iterator; -//import javax.servlet.http.HttpServletRequest; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import javax.ws.rs.core.UriBuilder; - -import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValue; -import org.eclipse.lyo.oslc4j.core.annotation.OslcDescription; -import org.eclipse.lyo.oslc4j.core.annotation.OslcMemberProperty; import org.eclipse.lyo.oslc4j.core.annotation.OslcName; import org.eclipse.lyo.oslc4j.core.annotation.OslcNamespace; import org.eclipse.lyo.oslc4j.core.annotation.OslcOccurs; import org.eclipse.lyo.oslc4j.core.annotation.OslcPropertyDefinition; import org.eclipse.lyo.oslc4j.core.annotation.OslcRange; import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRepresentation; import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape; -import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle; import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType; -import org.eclipse.lyo.oslc4j.core.model.AbstractResource; -import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.core.model.Occurs; -import org.eclipse.lyo.oslc4j.core.model.OslcConstants; -import org.eclipse.lyo.oslc4j.core.model.Representation; import org.eclipse.lyo.oslc4j.core.model.ValueType; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.IBlankResource; - // Start of user code imports // End of user code diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IWithTwoDepthBlankResource.java b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IWithTwoDepthBlankResource.java index d8a9296c1..6b0478e33 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IWithTwoDepthBlankResource.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/IWithTwoDepthBlankResource.java @@ -16,48 +16,17 @@ package org.eclipse.lyo.store.resources; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.text.SimpleDateFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.Iterator; -//import javax.servlet.http.HttpServletRequest; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import javax.ws.rs.core.UriBuilder; - -import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValue; -import org.eclipse.lyo.oslc4j.core.annotation.OslcDescription; -import org.eclipse.lyo.oslc4j.core.annotation.OslcMemberProperty; import org.eclipse.lyo.oslc4j.core.annotation.OslcName; import org.eclipse.lyo.oslc4j.core.annotation.OslcNamespace; import org.eclipse.lyo.oslc4j.core.annotation.OslcOccurs; import org.eclipse.lyo.oslc4j.core.annotation.OslcPropertyDefinition; import org.eclipse.lyo.oslc4j.core.annotation.OslcRange; import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRepresentation; import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape; -import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle; import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType; -import org.eclipse.lyo.oslc4j.core.model.AbstractResource; -import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.core.model.Occurs; -import org.eclipse.lyo.oslc4j.core.model.OslcConstants; -import org.eclipse.lyo.oslc4j.core.model.Representation; import org.eclipse.lyo.oslc4j.core.model.ValueType; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.IWithBlankResource; - // Start of user code imports // End of user code diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/Nsp1DomainConstants.java b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/Nsp1DomainConstants.java index 2be02a08e..341d25e80 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/Nsp1DomainConstants.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/Nsp1DomainConstants.java @@ -16,9 +16,6 @@ package org.eclipse.lyo.store.resources; -import org.eclipse.lyo.oslc4j.core.model.OslcConstants; - - // Start of user code imports // End of user code diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/Requirement.java b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/Requirement.java index 850071a49..f621b679f 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/Requirement.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/Requirement.java @@ -17,7 +17,6 @@ import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.core.model.Occurs; import org.eclipse.lyo.oslc4j.core.model.ValueType; -import org.eclipse.lyo.store.resources.Oslc_rmDomainConstants; @OslcNamespace(Oslc_rmDomainConstants.REQUIREMENT_NAMESPACE) @OslcName(Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME) diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/WithBlankResource.java b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/WithBlankResource.java index 1aee732d0..56f705771 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/WithBlankResource.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/WithBlankResource.java @@ -18,49 +18,23 @@ import java.net.URI; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.text.SimpleDateFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.Iterator; -//import javax.servlet.http.HttpServletRequest; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import javax.ws.rs.core.UriBuilder; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; -import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; -import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValue; -import org.eclipse.lyo.oslc4j.core.annotation.OslcDescription; -import org.eclipse.lyo.oslc4j.core.annotation.OslcMemberProperty; import org.eclipse.lyo.oslc4j.core.annotation.OslcName; import org.eclipse.lyo.oslc4j.core.annotation.OslcNamespace; import org.eclipse.lyo.oslc4j.core.annotation.OslcOccurs; import org.eclipse.lyo.oslc4j.core.annotation.OslcPropertyDefinition; import org.eclipse.lyo.oslc4j.core.annotation.OslcRange; import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRepresentation; import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape; -import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle; import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType; +import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; import org.eclipse.lyo.oslc4j.core.model.AbstractResource; -import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.core.model.Occurs; import org.eclipse.lyo.oslc4j.core.model.OslcConstants; -import org.eclipse.lyo.oslc4j.core.model.Representation; -import org.eclipse.lyo.oslc4j.core.model.ValueType; import org.eclipse.lyo.oslc4j.core.model.ResourceShape; import org.eclipse.lyo.oslc4j.core.model.ResourceShapeFactory; - -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.BlankResource; +import org.eclipse.lyo.oslc4j.core.model.ValueType; // Start of user code imports // End of user code diff --git a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/WithTwoDepthBlankResource.java b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/WithTwoDepthBlankResource.java index 1523dafb0..f29d2295d 100644 --- a/store/store-core/src/test/java/org/eclipse/lyo/store/resources/WithTwoDepthBlankResource.java +++ b/store/store-core/src/test/java/org/eclipse/lyo/store/resources/WithTwoDepthBlankResource.java @@ -18,49 +18,23 @@ import java.net.URI; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.text.SimpleDateFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.Iterator; -//import javax.servlet.http.HttpServletRequest; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import javax.ws.rs.core.UriBuilder; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; -import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; -import org.eclipse.lyo.oslc4j.core.annotation.OslcAllowedValue; -import org.eclipse.lyo.oslc4j.core.annotation.OslcDescription; -import org.eclipse.lyo.oslc4j.core.annotation.OslcMemberProperty; import org.eclipse.lyo.oslc4j.core.annotation.OslcName; import org.eclipse.lyo.oslc4j.core.annotation.OslcNamespace; import org.eclipse.lyo.oslc4j.core.annotation.OslcOccurs; import org.eclipse.lyo.oslc4j.core.annotation.OslcPropertyDefinition; import org.eclipse.lyo.oslc4j.core.annotation.OslcRange; import org.eclipse.lyo.oslc4j.core.annotation.OslcReadOnly; -import org.eclipse.lyo.oslc4j.core.annotation.OslcRepresentation; import org.eclipse.lyo.oslc4j.core.annotation.OslcResourceShape; -import org.eclipse.lyo.oslc4j.core.annotation.OslcTitle; import org.eclipse.lyo.oslc4j.core.annotation.OslcValueType; +import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException; import org.eclipse.lyo.oslc4j.core.model.AbstractResource; -import org.eclipse.lyo.oslc4j.core.model.Link; import org.eclipse.lyo.oslc4j.core.model.Occurs; import org.eclipse.lyo.oslc4j.core.model.OslcConstants; -import org.eclipse.lyo.oslc4j.core.model.Representation; -import org.eclipse.lyo.oslc4j.core.model.ValueType; import org.eclipse.lyo.oslc4j.core.model.ResourceShape; import org.eclipse.lyo.oslc4j.core.model.ResourceShapeFactory; - -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.Nsp1DomainConstants; -import org.eclipse.lyo.store.resources.WithBlankResource; +import org.eclipse.lyo.oslc4j.core.model.ValueType; // Start of user code imports // End of user code diff --git a/trs/client/client-source-mqtt/pom.xml b/trs/client/client-source-mqtt/pom.xml index 7bc1951f2..189997752 100644 --- a/trs/client/client-source-mqtt/pom.xml +++ b/trs/client/client-source-mqtt/pom.xml @@ -76,8 +76,8 @@ pom - javax.annotation - javax.annotation-api + jakarta.annotation + jakarta.annotation-api org.apache.httpcomponents diff --git a/trs/client/trs-client/pom.xml b/trs/client/trs-client/pom.xml index 45259883b..0514cb20e 100644 --- a/trs/client/trs-client/pom.xml +++ b/trs/client/trs-client/pom.xml @@ -58,10 +58,9 @@ - - javax.servlet - javax.servlet-api - + jakarta.servlet + jakarta.servlet-api + 6.0.0 org.eclipse.lyo @@ -79,8 +78,8 @@ pom - javax.annotation - javax.annotation-api + jakarta.annotation + jakarta.annotation-api org.apache.httpcomponents diff --git a/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/config/TrsConsumerConfiguration.java b/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/config/TrsConsumerConfiguration.java index dc95e5a39..2396b5c8e 100644 --- a/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/config/TrsConsumerConfiguration.java +++ b/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/config/TrsConsumerConfiguration.java @@ -14,12 +14,15 @@ package org.eclipse.lyo.trs.client.config; -import com.google.common.base.Strings; import java.util.concurrent.ScheduledExecutorService; -import javax.ws.rs.client.ClientBuilder; + import org.eclipse.lyo.client.OslcClient; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; +import com.google.common.base.Strings; + +import jakarta.ws.rs.client.ClientBuilder; + public class TrsConsumerConfiguration { private final String sparqlQueryUrl; private final String sparqlUpdateUrl; diff --git a/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/util/ClientUtil.java b/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/util/ClientUtil.java index cf689ed32..3c9ebfe9f 100644 --- a/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/util/ClientUtil.java +++ b/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/util/ClientUtil.java @@ -5,7 +5,7 @@ import java.io.InputStream; import java.net.URISyntaxException; import java.util.Arrays; -import javax.ws.rs.core.Response; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.eclipse.lyo.core.trs.Base; @@ -23,6 +23,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.core.Response; + /** * TODO * diff --git a/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/util/TrackedResourceClient.java b/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/util/TrackedResourceClient.java index d1004d072..b80bc56a1 100644 --- a/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/util/TrackedResourceClient.java +++ b/trs/client/trs-client/src/main/java/org/eclipse/lyo/trs/client/util/TrackedResourceClient.java @@ -17,7 +17,7 @@ import java.net.URI; import java.util.ArrayList; import java.util.List; -import javax.ws.rs.core.Response; + import org.apache.jena.rdf.model.Model; import org.eclipse.lyo.client.IOslcClient; import org.eclipse.lyo.core.trs.Base; @@ -31,6 +31,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.core.Response; + public class TrackedResourceClient implements ITrackedResourceClient { private static final Logger log = LoggerFactory.getLogger(TrackedResourceClient.class); private final IOslcClient oslcClient; diff --git a/trs/server/pom.xml b/trs/server/pom.xml index 467ce2f7f..33cb7f006 100644 --- a/trs/server/pom.xml +++ b/trs/server/pom.xml @@ -72,14 +72,14 @@ 3.6.0 - 11 + 17 - - + + The reactor is not valid @@ -116,19 +116,17 @@ ${v.slf4j} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api jakarta.ws.rs jakarta.ws.rs-api - provided - javax.inject - javax.inject - 1 - provided + jakarta.inject + jakarta.inject-api + 2.0.1 diff --git a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/HistoryData.java b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/HistoryData.java index 834fbba3a..11c7038ad 100644 --- a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/HistoryData.java +++ b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/HistoryData.java @@ -15,6 +15,7 @@ import java.net.URI; import java.util.Date; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/InmemPagedTrs.java b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/InmemPagedTrs.java index c968df87c..20bdb986a 100644 --- a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/InmemPagedTrs.java +++ b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/InmemPagedTrs.java @@ -21,7 +21,7 @@ import java.util.Objects; import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; -import javax.ws.rs.core.UriBuilder; + import org.eclipse.lyo.core.trs.Base; import org.eclipse.lyo.core.trs.ChangeEvent; import org.eclipse.lyo.core.trs.ChangeLog; @@ -34,6 +34,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.core.UriBuilder; + /** * This class is the backbone of the Tracked resource set service class. This class is extended by * oslc adapters wishing to implement an OSLC TRS interface. The implementing classes need to diff --git a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/PagedTrsFactory.java b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/PagedTrsFactory.java index 8f98ab6f1..c79770e5f 100644 --- a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/PagedTrsFactory.java +++ b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/PagedTrsFactory.java @@ -4,11 +4,11 @@ import java.util.ArrayList; import java.util.Collection; -import javax.ws.rs.core.UriBuilder; - import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; import org.eclipse.lyo.oslc4j.trs.server.service.TrackedResourceSetService; +import jakarta.ws.rs.core.UriBuilder; + public class PagedTrsFactory { public InmemPagedTrs getInmemPagedTrs(final int basePageLimit, final int changelogPageLimit, final URI uriBase, final String baseRelativePath, final String changeLogRelativePath, final Collection baseResourceUris) { diff --git a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/TRSUtil.java b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/TRSUtil.java index 92adc2212..7864b8ee6 100644 --- a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/TRSUtil.java +++ b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/TRSUtil.java @@ -27,6 +27,7 @@ import java.util.Date; import java.util.List; import java.util.TimeZone; + import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.namespace.QName; diff --git a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/TrsEventHandler.java b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/TrsEventHandler.java index f9f2e6e6e..e7da949f8 100644 --- a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/TrsEventHandler.java +++ b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/TrsEventHandler.java @@ -1,6 +1,7 @@ package org.eclipse.lyo.oslc4j.trs.server; import java.net.URI; + import org.eclipse.lyo.oslc4j.core.model.IResource; public interface TrsEventHandler { diff --git a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/service/TrackedResourceSetService.java b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/service/TrackedResourceSetService.java index d004698ab..dcc6aff6f 100644 --- a/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/service/TrackedResourceSetService.java +++ b/trs/server/src/main/java/org/eclipse/lyo/oslc4j/trs/server/service/TrackedResourceSetService.java @@ -16,15 +16,9 @@ import java.net.URI; import java.net.URISyntaxException; -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriBuilder; + +import jakarta.inject.Inject; + import org.apache.jena.ext.com.google.common.base.Strings; import org.eclipse.lyo.core.trs.Base; import org.eclipse.lyo.core.trs.ChangeLog; @@ -40,6 +34,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.core.UriBuilder; + /** * The service class for the TRS interface. This class needs to be implemented by an OSLC adapter * wishing to implement a TRS interface diff --git a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/DummyServiceResource.java b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/DummyServiceResource.java index 462de1610..f724b8fa1 100644 --- a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/DummyServiceResource.java +++ b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/DummyServiceResource.java @@ -1,9 +1,9 @@ package org.eclipse.lyo.oslc4j.trs.server.service; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; @Path("/test") public class DummyServiceResource { diff --git a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/DummyServiceTest.java b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/DummyServiceTest.java index 17e7cfc7d..e22b593e9 100644 --- a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/DummyServiceTest.java +++ b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/DummyServiceTest.java @@ -1,19 +1,20 @@ package org.eclipse.lyo.oslc4j.trs.server.service; -import javax.ws.rs.core.Application; -import javax.ws.rs.core.Response; +import static org.assertj.core.api.Assertions.assertThat; + import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.DeploymentContext; import org.glassfish.jersey.test.JerseyTest; import org.glassfish.jersey.test.ServletDeploymentContext; import org.glassfish.jersey.test.TestProperties; import org.glassfish.jersey.test.grizzly.GrizzlyTestContainerFactory; -import org.glassfish.jersey.test.jetty.JettyTestContainerFactory; import org.glassfish.jersey.test.spi.TestContainerException; import org.glassfish.jersey.test.spi.TestContainerFactory; import org.junit.Test; -import static org.assertj.core.api.Assertions.*; +import jakarta.ws.rs.core.Application; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; public class DummyServiceTest extends JerseyTest { diff --git a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceDITest.java b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceDITest.java index b993ff7a2..e2af969c3 100644 --- a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceDITest.java +++ b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceDITest.java @@ -1,18 +1,15 @@ package org.eclipse.lyo.oslc4j.trs.server.service; +import static org.assertj.core.api.Assertions.assertThat; + import java.net.MalformedURLException; import java.util.ArrayList; -import javax.inject.Singleton; -import javax.ws.rs.core.Application; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import org.apache.http.client.utils.URIBuilder; + import org.eclipse.lyo.core.trs.Base; import org.eclipse.lyo.core.trs.TrackedResourceSet; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; import org.eclipse.lyo.oslc4j.provider.jena.JenaProvidersRegistry; import org.eclipse.lyo.oslc4j.trs.server.InmemPagedTrs; -import org.eclipse.lyo.oslc4j.trs.server.InmemPagedTrsTest; import org.eclipse.lyo.oslc4j.trs.server.PagedTrs; import org.glassfish.hk2.utilities.binding.AbstractBinder; import org.glassfish.jersey.client.ClientConfig; @@ -24,10 +21,11 @@ import org.glassfish.jersey.test.grizzly.GrizzlyTestContainerFactory; import org.glassfish.jersey.test.spi.TestContainerException; import org.glassfish.jersey.test.spi.TestContainerFactory; -import org.junit.Before; import org.junit.Test; -import static org.assertj.core.api.Assertions.*; +import jakarta.ws.rs.core.Application; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriBuilder; public class TRSServiceDITest extends JerseyTest { diff --git a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceResource.java b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceResource.java index cb11a56d4..40758dfe2 100644 --- a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceResource.java +++ b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceResource.java @@ -1,16 +1,17 @@ package org.eclipse.lyo.oslc4j.trs.server.service; -import com.google.common.collect.ImmutableList; -import java.util.ArrayList; -import javax.ws.rs.Path; -import javax.ws.rs.core.UriBuilder; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; -import org.eclipse.lyo.oslc4j.trs.server.PagedTrs; import org.eclipse.lyo.oslc4j.trs.server.InmemPagedTrs; +import org.eclipse.lyo.oslc4j.trs.server.PagedTrs; import org.eclipse.lyo.oslc4j.trs.server.TRSTestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.collect.ImmutableList; + +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.UriBuilder; + @Path("/trs") public class TRSServiceResource extends TrackedResourceSetService { private final static Logger log = LoggerFactory.getLogger(TRSServiceResource.class); diff --git a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceTest.java b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceTest.java index 8e4c03b32..924d9a4bc 100644 --- a/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceTest.java +++ b/trs/server/src/test/java/org/eclipse/lyo/oslc4j/trs/server/service/TRSServiceTest.java @@ -1,7 +1,7 @@ package org.eclipse.lyo.oslc4j.trs.server.service; -import javax.ws.rs.core.Application; -import javax.ws.rs.core.Response; +import static org.assertj.core.api.Assertions.assertThat; + import org.eclipse.lyo.core.trs.Base; import org.eclipse.lyo.core.trs.TrackedResourceSet; import org.eclipse.lyo.oslc4j.core.OSLC4JUtils; @@ -18,7 +18,8 @@ import org.junit.Before; import org.junit.Test; -import static org.assertj.core.api.Assertions.*; +import jakarta.ws.rs.core.Application; +import jakarta.ws.rs.core.Response; public class TRSServiceTest extends JerseyTest {