Spring 6 module introduction Signed-off-by: jansupol <jan.supol@oracle.com>
diff --git a/bom/pom.xml b/bom/pom.xml index 2746bf6..345928f 100644 --- a/bom/pom.xml +++ b/bom/pom.xml
@@ -188,16 +188,11 @@ <artifactId>jersey-proxy-client</artifactId> <version>${project.version}</version> </dependency> -<!-- <dependency>--> -<!-- <groupId>org.glassfish.jersey.ext</groupId>--> -<!-- <artifactId>jersey-spring4</artifactId>--> -<!-- <version>${project.version}</version>--> -<!-- </dependency>--> -<!-- <dependency>--> -<!-- <groupId>org.glassfish.jersey.ext</groupId>--> -<!-- <artifactId>jersey-spring5</artifactId>--> -<!-- <version>${project.version}</version>--> -<!-- </dependency>--> + <dependency> + <groupId>org.glassfish.jersey.ext</groupId> + <artifactId>jersey-spring6</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>org.glassfish.jersey.ext</groupId> <artifactId>jersey-declarative-linking</artifactId>
diff --git a/ext/pom.xml b/ext/pom.xml index 2c6e150..fa7003a 100644 --- a/ext/pom.xml +++ b/ext/pom.xml
@@ -51,10 +51,7 @@ <module>mvc-mustache</module> <module>proxy-client</module> <module>rx</module> - <!-- do not release spring 4 and spring 5 modules with Jersey 3.x - <module>spring4</module> - <module>spring5</module> - --> + <module>spring6</module> <module>wadl-doclet</module> <module>microprofile</module> </modules>
diff --git a/ext/spring4/pom.xml b/ext/spring4/pom.xml deleted file mode 100644 index e436f3d..0000000 --- a/ext/spring4/pom.xml +++ /dev/null
@@ -1,225 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v. 2.0, which is available at - http://www.eclipse.org/legal/epl-2.0. - - This Source Code may also be made available under the following Secondary - Licenses when the conditions for such availability set forth in the - Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - version 2 with the GNU Classpath Exception, which is available at - https://www.gnu.org/software/classpath/license.html. - - SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" 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"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.glassfish.jersey.ext</groupId> - <artifactId>project</artifactId> - <version>3.0.0-SNAPSHOT</version> - </parent> - - <artifactId>jersey-spring4</artifactId> - <name>jersey-spring4</name> - - <packaging>jar</packaging> - - <description> - Jersey extension module providing support for Spring 4 integration. - </description> - - <dependencies> - <dependency> - <groupId>org.glassfish.jersey.core</groupId> - <artifactId>jersey-server</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.inject</groupId> - <artifactId>jersey-hk2</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.containers</groupId> - <artifactId>jersey-container-servlet-core</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.test-framework.providers</groupId> - <artifactId>jersey-test-framework-provider-grizzly2</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.glassfish.hk2</groupId> - <artifactId>hk2</artifactId> - <version>${hk2.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.hk2</groupId> - <artifactId>spring-bridge</artifactId> - <version>${hk2.version}</version> - <exclusions> - <exclusion> <!-- already pulled in by jersey-server --> - <groupId>jakarta.inject</groupId> - <artifactId>jakarta.inject-api</artifactId> - </exclusion> - <exclusion> - <groupId>org.glassfish.hk2</groupId> - <artifactId>hk2-api</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring4.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring4.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>${spring4.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-aop</artifactId> - <version>${spring4.version}</version> - </dependency> - - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>${servlet4.version}</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.test-framework</groupId> - <artifactId>jersey-test-framework-core</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.aspectj</groupId> - <artifactId>aspectjrt</artifactId> - <version>1.6.11</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.aspectj</groupId> - <artifactId>aspectjweaver</artifactId> - <version>1.6.11</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>com.sun.istack</groupId> - <artifactId>istack-commons-maven-plugin</artifactId> - <inherited>true</inherited> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <inherited>true</inherited> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>jakartification_exclude_tests</id> <!-- TODO remove after jakartification --> - <activation> - <jdk>[1.8,)</jdk> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>delayed-strategy-skip-test</id> - <activation> - <property> - <name>org.glassfish.jersey.injection.manager.strategy</name> - <value>delayed</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>ignore.on.jdk16</id> - <!-- Spring 4 does not support JDK 16 at the moment, and it is superseded by Spring 5.2-5.3 --> - <activation> - <jdk>[16,)</jdk> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - </plugins> - </build> - </profile> - </profiles> -</project>
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java deleted file mode 100644 index 1158fc6..0000000 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java +++ /dev/null
@@ -1,119 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -import java.lang.reflect.AnnotatedElement; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.HashSet; -import java.util.Set; -import java.util.logging.Logger; - -import jakarta.inject.Singleton; - -import org.glassfish.jersey.internal.inject.Injectee; -import org.glassfish.jersey.internal.inject.InjectionResolver; - -import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.beans.factory.config.DependencyDescriptor; -import org.springframework.context.ApplicationContext; -import org.springframework.core.MethodParameter; - -/** - * HK2 injection resolver for Spring framework {@link Autowired} annotation injection. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - * @author Vetle Leinonen-Roeim (vetle at roeim.net) - */ -@Singleton -public class AutowiredInjectResolver implements InjectionResolver<Autowired> { - - private static final Logger LOGGER = Logger.getLogger(AutowiredInjectResolver.class.getName()); - - private volatile ApplicationContext ctx; - - /** - * Create a new instance. - * - * @param ctx Spring application context. - */ - public AutowiredInjectResolver(ApplicationContext ctx) { - this.ctx = ctx; - } - - @Override - public Object resolve(Injectee injectee) { - AnnotatedElement parent = injectee.getParent(); - String beanName = null; - if (parent != null) { - Qualifier an = parent.getAnnotation(Qualifier.class); - if (an != null) { - beanName = an.value(); - } - } - boolean required = parent != null ? parent.getAnnotation(Autowired.class).required() : false; - return getBeanFromSpringContext(beanName, injectee, required); - } - - private Object getBeanFromSpringContext(String beanName, Injectee injectee, final boolean required) { - try { - DependencyDescriptor dependencyDescriptor = createSpringDependencyDescriptor(injectee); - Set<String> autowiredBeanNames = new HashSet<>(1); - autowiredBeanNames.add(beanName); - return ctx.getAutowireCapableBeanFactory().resolveDependency(dependencyDescriptor, null, - autowiredBeanNames, null); - } catch (NoSuchBeanDefinitionException e) { - if (required) { - LOGGER.warning(e.getMessage()); - throw e; - } - return null; - } - } - - private DependencyDescriptor createSpringDependencyDescriptor(final Injectee injectee) { - AnnotatedElement annotatedElement = injectee.getParent(); - - if (annotatedElement.getClass().isAssignableFrom(Field.class)) { - return new DependencyDescriptor((Field) annotatedElement, !injectee.isOptional()); - } else if (annotatedElement.getClass().isAssignableFrom(Method.class)) { - return new DependencyDescriptor( - new MethodParameter((Method) annotatedElement, injectee.getPosition()), !injectee.isOptional()); - } else { - return new DependencyDescriptor( - new MethodParameter((Constructor) annotatedElement, injectee.getPosition()), !injectee.isOptional()); - } - } - - @Override - public boolean isConstructorParameterIndicator() { - return false; - } - - @Override - public boolean isMethodParameterIndicator() { - return false; - } - - @Override - public Class<Autowired> getAnnotation() { - return Autowired.class; - } -}
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java b/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java deleted file mode 100644 index b33a69d..0000000 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java +++ /dev/null
@@ -1,49 +0,0 @@ -/* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -import java.util.logging.Logger; - -import jakarta.servlet.ServletContext; -import jakarta.servlet.ServletException; - -import org.springframework.web.WebApplicationInitializer; - -/** - * Spring WebApplicationInitializer implementation initializes Spring context by - * adding a Spring ContextLoaderListener to the ServletContext. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class SpringWebApplicationInitializer implements WebApplicationInitializer { - - private static final Logger LOGGER = Logger.getLogger(SpringWebApplicationInitializer.class.getName()); - - private static final String PAR_NAME_CTX_CONFIG_LOCATION = "contextConfigLocation"; - - @Override - public void onStartup(ServletContext sc) throws ServletException { - if (sc.getInitParameter(PAR_NAME_CTX_CONFIG_LOCATION) == null) { - LOGGER.config(LocalizationMessages.REGISTERING_CTX_LOADER_LISTENER()); - sc.setInitParameter(PAR_NAME_CTX_CONFIG_LOCATION, "classpath:applicationContext.xml"); - sc.addListener("org.springframework.web.context.ContextLoaderListener"); - sc.addListener("org.springframework.web.context.request.RequestContextListener"); - } else { - LOGGER.config(LocalizationMessages.SKIPPING_CTX_LODAER_LISTENER_REGISTRATION()); - } - } -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java deleted file mode 100644 index 111361c..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java +++ /dev/null
@@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -public class NoComponent { - -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java deleted file mode 100644 index 792d9b8..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java +++ /dev/null
@@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -public interface TestComponent2 { - String result(); -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java deleted file mode 100644 index c8c61d0..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java +++ /dev/null
@@ -1,27 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -import org.springframework.stereotype.Component; - -@Component -public class TestComponent2Impl1 implements TestComponent2 { - @Override - public String result() { - return "test ok"; - } -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java deleted file mode 100644 index 4506c7e..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java +++ /dev/null
@@ -1,29 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.aspect4j; - -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.spring.scope.RequestContextFilter; - -public class Aspect4jJerseyConfig extends ResourceConfig { - - public Aspect4jJerseyConfig() { - register(RequestContextFilter.class); - register(NoComponentResource.class); - register(ComponentResource.class); - } -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java deleted file mode 100644 index df30805..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java +++ /dev/null
@@ -1,27 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.fieldinjection; - -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.spring.scope.RequestContextFilter; - -public class SpringFieldInjectionJerseyTestConfig extends ResourceConfig { - public SpringFieldInjectionJerseyTestConfig() { - register(RequestContextFilter.class); - register(SpringFieldInjectionTestResource.class); - } -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java deleted file mode 100644 index 28de237..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java +++ /dev/null
@@ -1,34 +0,0 @@ -/* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.filter; - -import org.springframework.stereotype.Component; - -@Component -public class Counter { - - private int count = 0; - - public void inc() { - count++; - } - - public int getCount() { - return count; - } - -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java deleted file mode 100644 index 5a9d3b7..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java +++ /dev/null
@@ -1,27 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.methodinjection; - -import org.glassfish.jersey.server.spring.scope.RequestContextFilter; -import org.glassfish.jersey.server.ResourceConfig; - -public class SpringMethodInjectionJerseyTestConfig extends ResourceConfig { - public SpringMethodInjectionJerseyTestConfig() { - register(RequestContextFilter.class); - register(SpringMethodInjectionTestResource.class); - } -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java deleted file mode 100644 index dc3c995..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java +++ /dev/null
@@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.profiles; - -import org.springframework.context.annotation.Primary; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; - -@Component -@Primary -@Profile("dev") -public class DevTestService implements TestService { - - @Override - public String test() { - return "dev"; - } -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java deleted file mode 100644 index 8bccbe3..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java +++ /dev/null
@@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.profiles; - -import org.junit.Test; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import static org.junit.Assert.assertEquals; - -public class SpringProfilesTest { - - @Test - public void shouldGetDefaultBean() { - System.setProperty("spring.profiles.active", ""); - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( - "org.glassfish.jersey.server.spring.profiles"); - assertEquals("default", context.getBean(TestService.class).test()); - } - - @Test - public void shouldGetDevProfileBean() { - System.setProperty("spring.profiles.active", "dev"); - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( - "org.glassfish.jersey.server.spring.profiles"); - assertEquals("dev", context.getBean(TestService.class).test()); - } -}
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java b/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java deleted file mode 100644 index 045d3e2..0000000 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java +++ /dev/null
@@ -1,22 +0,0 @@ -/* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.profiles; - -public interface TestService { - - String test(); -}
diff --git a/ext/spring5/pom.xml b/ext/spring5/pom.xml deleted file mode 100644 index 4647434..0000000 --- a/ext/spring5/pom.xml +++ /dev/null
@@ -1,206 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v. 2.0, which is available at - http://www.eclipse.org/legal/epl-2.0. - - This Source Code may also be made available under the following Secondary - Licenses when the conditions for such availability set forth in the - Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - version 2 with the GNU Classpath Exception, which is available at - https://www.gnu.org/software/classpath/license.html. - - SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" 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"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.glassfish.jersey.ext</groupId> - <artifactId>project</artifactId> - <version>3.0.0-SNAPSHOT</version> - </parent> - - <artifactId>jersey-spring5</artifactId> - <name>jersey-spring5</name> - - <packaging>jar</packaging> - - <description> - Jersey extension module providing support for Spring 5 integration. - </description> - - <dependencies> - <dependency> - <groupId>org.glassfish.jersey.core</groupId> - <artifactId>jersey-server</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.inject</groupId> - <artifactId>jersey-hk2</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.containers</groupId> - <artifactId>jersey-container-servlet-core</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.test-framework.providers</groupId> - <artifactId>jersey-test-framework-provider-grizzly2</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.glassfish.hk2</groupId> - <artifactId>hk2</artifactId> - <version>${hk2.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.hk2</groupId> - <artifactId>spring-bridge</artifactId> - <version>${hk2.version}</version> - <exclusions> - <exclusion> <!-- already pulled in by jersey-server --> - <groupId>jakarta.inject</groupId> - <artifactId>jakarta.inject</artifactId> - </exclusion> - <exclusion> - <groupId>org.glassfish.hk2</groupId> - <artifactId>hk2-api</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring5.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring5.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring5.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>${spring5.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-aop</artifactId> - <version>${spring5.version}</version> - </dependency> - - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>${servlet4.version}</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.test-framework</groupId> - <artifactId>jersey-test-framework-core</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.aspectj</groupId> - <artifactId>aspectjrt</artifactId> - <version>1.6.11</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.aspectj</groupId> - <artifactId>aspectjweaver</artifactId> - <version>1.6.11</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>com.sun.istack</groupId> - <artifactId>istack-commons-maven-plugin</artifactId> - <inherited>true</inherited> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <inherited>true</inherited> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>delayed-strategy-skip-test</id> - <activation> - <property> - <name>org.glassfish.jersey.injection.manager.strategy</name> - <value>delayed</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - </plugins> - </build> - </profile> - </profiles> -</project>
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java deleted file mode 100644 index e8df940..0000000 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java +++ /dev/null
@@ -1,177 +0,0 @@ -/* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -import java.util.Set; -import java.util.function.Supplier; -import java.util.logging.Level; -import java.util.logging.Logger; - -import jakarta.servlet.ServletContext; - -import org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager; -import org.glassfish.jersey.internal.inject.Binding; -import org.glassfish.jersey.internal.inject.Bindings; -import org.glassfish.jersey.internal.inject.InjectionManager; -import org.glassfish.jersey.server.ApplicationHandler; -import org.glassfish.jersey.server.spi.ComponentProvider; - -import org.jvnet.hk2.spring.bridge.api.SpringBridge; -import org.jvnet.hk2.spring.bridge.api.SpringIntoHK2Bridge; - -import org.springframework.aop.framework.Advised; -import org.springframework.beans.factory.BeanFactoryUtils; -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.stereotype.Component; -import org.springframework.web.context.support.WebApplicationContextUtils; - -/** - * Custom ComponentProvider class. - * Responsible for 1) bootstrapping Jersey 2 Spring integration and - * 2) making Jersey skip JAX-RS Spring component life-cycle management and leave it to us. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class SpringComponentProvider implements ComponentProvider { - - private static final Logger LOGGER = Logger.getLogger(SpringComponentProvider.class.getName()); - private static final String DEFAULT_CONTEXT_CONFIG_LOCATION = "applicationContext.xml"; - private static final String PARAM_CONTEXT_CONFIG_LOCATION = "contextConfigLocation"; - private static final String PARAM_SPRING_CONTEXT = "contextConfig"; - - private volatile InjectionManager injectionManager; - private volatile ApplicationContext ctx; - - @Override - public void initialize(InjectionManager injectionManager) { - this.injectionManager = injectionManager; - - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.fine(LocalizationMessages.CTX_LOOKUP_STARTED()); - } - - ServletContext sc = injectionManager.getInstance(ServletContext.class); - - if (sc != null) { - // servlet container - ctx = WebApplicationContextUtils.getWebApplicationContext(sc); - } else { - // non-servlet container - ctx = createSpringContext(); - } - if (ctx == null) { - LOGGER.severe(LocalizationMessages.CTX_LOOKUP_FAILED()); - return; - } - LOGGER.config(LocalizationMessages.CTX_LOOKUP_SUCESSFUL()); - - // initialize HK2 spring-bridge - - ImmediateHk2InjectionManager hk2InjectionManager = (ImmediateHk2InjectionManager) injectionManager; - SpringBridge.getSpringBridge().initializeSpringBridge(hk2InjectionManager.getServiceLocator()); - SpringIntoHK2Bridge springBridge = injectionManager.getInstance(SpringIntoHK2Bridge.class); - springBridge.bridgeSpringBeanFactory(ctx); - - injectionManager.register(Bindings.injectionResolver(new AutowiredInjectResolver(ctx))); - injectionManager.register(Bindings.service(ctx).to(ApplicationContext.class).named("SpringContext")); - LOGGER.config(LocalizationMessages.SPRING_COMPONENT_PROVIDER_INITIALIZED()); - } - - // detect JAX-RS classes that are also Spring @Components. - // register these with HK2 ServiceLocator to manage their lifecycle using Spring. - @Override - public boolean bind(Class<?> component, Set<Class<?>> providerContracts) { - - if (ctx == null) { - return false; - } - - if (AnnotationUtils.findAnnotation(component, Component.class) != null) { - String[] beanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ctx, component); - if (beanNames == null || beanNames.length != 1) { - LOGGER.severe(LocalizationMessages.NONE_OR_MULTIPLE_BEANS_AVAILABLE(component)); - return false; - } - String beanName = beanNames[0]; - - Binding binding = Bindings.supplier(new SpringManagedBeanFactory(ctx, injectionManager, beanName)) - .to(component) - .to(providerContracts); - injectionManager.register(binding); - - LOGGER.config(LocalizationMessages.BEAN_REGISTERED(beanNames[0])); - return true; - } - return false; - } - - @Override - public void done() { - } - - private ApplicationContext createSpringContext() { - ApplicationHandler applicationHandler = injectionManager.getInstance(ApplicationHandler.class); - ApplicationContext springContext = (ApplicationContext) applicationHandler.getConfiguration() - .getProperty(PARAM_SPRING_CONTEXT); - if (springContext == null) { - String contextConfigLocation = (String) applicationHandler.getConfiguration() - .getProperty(PARAM_CONTEXT_CONFIG_LOCATION); - springContext = createXmlSpringConfiguration(contextConfigLocation); - } - return springContext; - } - - private ApplicationContext createXmlSpringConfiguration(String contextConfigLocation) { - if (contextConfigLocation == null) { - contextConfigLocation = DEFAULT_CONTEXT_CONFIG_LOCATION; - } - return ctx = new ClassPathXmlApplicationContext(contextConfigLocation, "jersey-spring-applicationContext.xml"); - } - - private static class SpringManagedBeanFactory implements Supplier { - - private final ApplicationContext ctx; - private final InjectionManager injectionManager; - private final String beanName; - - private SpringManagedBeanFactory(ApplicationContext ctx, InjectionManager injectionManager, String beanName) { - this.ctx = ctx; - this.injectionManager = injectionManager; - this.beanName = beanName; - } - - @Override - public Object get() { - Object bean = ctx.getBean(beanName); - if (bean instanceof Advised) { - try { - // Unwrap the bean and inject the values inside of it - Object localBean = ((Advised) bean).getTargetSource().getTarget(); - injectionManager.inject(localBean); - } catch (Exception e) { - // Ignore and let the injection happen as it normally would. - injectionManager.inject(bean); - } - } else { - injectionManager.inject(bean); - } - return bean; - } - } -}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java deleted file mode 100644 index 5a06926..0000000 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java +++ /dev/null
@@ -1,57 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -import jakarta.ws.rs.ext.Provider; - -import jakarta.inject.Inject; - -import org.glassfish.jersey.server.spi.Container; -import org.glassfish.jersey.server.spi.ContainerLifecycleListener; - -import org.springframework.context.ApplicationContext; -import org.springframework.context.ConfigurableApplicationContext; - -/** - * JAX-RS Provider class for processing Jersey 2 Spring integration container life-cycle events. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -@Provider -public class SpringLifecycleListener implements ContainerLifecycleListener { - - @Inject - private ApplicationContext ctx; - - @Override - public void onStartup(Container container) { - } - - @Override - public void onReload(Container container) { - if (ctx instanceof ConfigurableApplicationContext) { - ((ConfigurableApplicationContext) ctx).refresh(); - } - } - - @Override - public void onShutdown(Container container) { - if (ctx instanceof ConfigurableApplicationContext) { - ((ConfigurableApplicationContext) ctx).close(); - } - } -}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/package-info.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/package-info.java deleted file mode 100644 index 6e7b71a..0000000 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/package-info.java +++ /dev/null
@@ -1,21 +0,0 @@ -/* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -/** - * Jersey server-side Spring 5 integration classes. - * @since 2.29 - */ -package org.glassfish.jersey.server.spring;
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java deleted file mode 100644 index ec22efa..0000000 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java +++ /dev/null
@@ -1,94 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.scope; - -import jakarta.ws.rs.container.ContainerRequestContext; - -import org.glassfish.jersey.server.spring.LocalizationMessages; -import org.springframework.util.StringUtils; -import org.springframework.web.context.request.AbstractRequestAttributes; - -/** - * JAX-RS based Spring RequestAttributes implementation. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - * @author Marek Potociar - */ -class JaxrsRequestAttributes extends AbstractRequestAttributes { - - private final ContainerRequestContext requestContext; - - /** - * Create a new instance. - * - * @param requestContext JAX-RS container request context - */ - public JaxrsRequestAttributes(ContainerRequestContext requestContext) { - this.requestContext = requestContext; - } - - @Override - protected void updateAccessedSessionAttributes() { - // sessions not supported - } - - @Override - public Object getAttribute(String name, int scope) { - return requestContext.getProperty(name); - } - - @Override - public void setAttribute(String name, Object value, int scope) { - requestContext.setProperty(name, value); - } - - @Override - public void removeAttribute(String name, int scope) { - requestContext.removeProperty(name); - } - - @Override - public String[] getAttributeNames(int scope) { - if (!isRequestActive()) { - throw new IllegalStateException(LocalizationMessages.NOT_IN_REQUEST_SCOPE()); - } - return StringUtils.toStringArray(requestContext.getPropertyNames()); - } - - @Override - public void registerDestructionCallback(String name, Runnable callback, int scope) { - registerRequestDestructionCallback(name, callback); - } - - @Override - public Object resolveReference(String key) { - if (REFERENCE_REQUEST.equals(key)) { - return requestContext; - } - return null; - } - - @Override - public String getSessionId() { - return null; - } - - @Override - public Object getSessionMutex() { - return null; - } -}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java deleted file mode 100644 index c32ddbc..0000000 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java +++ /dev/null
@@ -1,54 +0,0 @@ -/* - * Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ -package org.glassfish.jersey.server.spring.scope; - -import jakarta.ws.rs.container.ContainerRequestContext; - -import jakarta.servlet.http.HttpServletRequest; - -import org.springframework.web.context.request.ServletRequestAttributes; - -/** - * JAX-RS based Spring RequestAttributes implementation for Servlet-based applications. - * - * @author Marek Potociar - */ -class JaxrsServletRequestAttributes extends ServletRequestAttributes { - - private final ContainerRequestContext requestContext; - - /** - * Create a new JAX-RS ServletRequestAttributes instance for the given request. - * - * @param request current HTTP request - * @param requestContext JAX-RS request context - */ - public JaxrsServletRequestAttributes(final HttpServletRequest request, final ContainerRequestContext requestContext) { - super(request); - this.requestContext = requestContext; - } - - @Override - public Object resolveReference(String key) { - if (REFERENCE_REQUEST.equals(key)) { - return this.requestContext; - } else if (REFERENCE_SESSION.equals(key)) { - return super.getSession(true); - } else { - return null; - } - } -}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java deleted file mode 100644 index de87d7e..0000000 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java +++ /dev/null
@@ -1,116 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.scope; - -import java.io.IOException; - -import jakarta.ws.rs.container.ContainerRequestContext; -import jakarta.ws.rs.container.ContainerRequestFilter; -import jakarta.ws.rs.container.ContainerResponseContext; -import jakarta.ws.rs.container.ContainerResponseFilter; -import jakarta.ws.rs.container.PreMatching; -import jakarta.ws.rs.ext.Provider; - -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; - -import org.glassfish.jersey.internal.inject.InjectionManager; - -import org.springframework.context.ApplicationContext; -import org.springframework.web.context.WebApplicationContext; -import org.springframework.web.context.request.AbstractRequestAttributes; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; - -/** - * Spring filter to provide a bridge between JAX-RS and Spring request attributes. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - * @author Jakub Podlesak - * @author Marek Potociar - */ -@Provider -@PreMatching -public final class RequestContextFilter implements ContainerRequestFilter, ContainerResponseFilter { - - private static final String REQUEST_ATTRIBUTES_PROPERTY = RequestContextFilter.class.getName() + ".REQUEST_ATTRIBUTES"; - - private final SpringAttributeController attributeController; - - private static final SpringAttributeController EMPTY_ATTRIBUTE_CONTROLLER = new SpringAttributeController() { - @Override - public void setAttributes(final ContainerRequestContext requestContext) { - } - - @Override - public void resetAttributes(final ContainerRequestContext requestContext) { - } - }; - - private interface SpringAttributeController { - - void setAttributes(final ContainerRequestContext requestContext); - - void resetAttributes(final ContainerRequestContext requestContext); - } - - /** - * Create a new request context filter instance. - * - * @param injectionManager injection manager. - */ - @Inject - public RequestContextFilter(final InjectionManager injectionManager) { - final ApplicationContext appCtx = injectionManager.getInstance(ApplicationContext.class); - final boolean isWebApp = appCtx instanceof WebApplicationContext; - - attributeController = appCtx != null ? new SpringAttributeController() { - - @Override - public void setAttributes(final ContainerRequestContext requestContext) { - final RequestAttributes attributes; - if (isWebApp) { - final HttpServletRequest httpRequest = injectionManager.getInstance(HttpServletRequest.class); - attributes = new JaxrsServletRequestAttributes(httpRequest, requestContext); - } else { - attributes = new JaxrsRequestAttributes(requestContext); - } - requestContext.setProperty(REQUEST_ATTRIBUTES_PROPERTY, attributes); - RequestContextHolder.setRequestAttributes(attributes); - } - - @Override - public void resetAttributes(final ContainerRequestContext requestContext) { - final AbstractRequestAttributes attributes = - (AbstractRequestAttributes) requestContext.getProperty(REQUEST_ATTRIBUTES_PROPERTY); - RequestContextHolder.resetRequestAttributes(); - attributes.requestCompleted(); - } - } : EMPTY_ATTRIBUTE_CONTROLLER; - } - - @Override - public void filter(final ContainerRequestContext requestContext) throws IOException { - attributeController.setAttributes(requestContext); - } - - @Override - public void filter(final ContainerRequestContext requestContext, final ContainerResponseContext responseContext) - throws IOException { - attributeController.resetAttributes(requestContext); - } -}
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java b/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java deleted file mode 100644 index 49985aa..0000000 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java +++ /dev/null
@@ -1,21 +0,0 @@ -/* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -/** - * Jersey server-side Spring 5 integration injection scopes related classes. - * @since 2.29 - */ -package org.glassfish.jersey.server.spring.scope;
diff --git a/ext/spring5/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider b/ext/spring5/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider deleted file mode 100644 index 5aec207..0000000 --- a/ext/spring5/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider +++ /dev/null
@@ -1 +0,0 @@ -org.glassfish.jersey.server.spring.SpringComponentProvider
diff --git a/ext/spring5/src/main/resources/jersey-spring-applicationContext.xml b/ext/spring5/src/main/resources/jersey-spring-applicationContext.xml deleted file mode 100644 index fd6f528..0000000 --- a/ext/spring5/src/main/resources/jersey-spring-applicationContext.xml +++ /dev/null
@@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v. 2.0, which is available at - http://www.eclipse.org/legal/epl-2.0. - - This Source Code may also be made available under the following Secondary - Licenses when the conditions for such availability set forth in the - Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - version 2 with the GNU Classpath Exception, which is available at - https://www.gnu.org/software/classpath/license.html. - - SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> - - <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"> - <property name="scopes"> - <map> - <entry key="request"> - <bean class="org.springframework.web.context.request.RequestScope"/> - </entry> - </map> - </property> - </bean> -</beans>
diff --git a/ext/spring5/src/main/resources/org/glassfish/jersey/server/spring/localization.properties b/ext/spring5/src/main/resources/org/glassfish/jersey/server/spring/localization.properties deleted file mode 100644 index 83f9220..0000000 --- a/ext/spring5/src/main/resources/org/glassfish/jersey/server/spring/localization.properties +++ /dev/null
@@ -1,26 +0,0 @@ -# -# Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0, which is available at -# http://www.eclipse.org/legal/epl-2.0. -# -# This Source Code may also be made available under the following Secondary -# Licenses when the conditions for such availability set forth in the -# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, -# version 2 with the GNU Classpath Exception, which is available at -# https://www.gnu.org/software/classpath/license.html. -# -# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 -# - -no.beans.found.for.type=No beans found. Resolution failed for type {0}. -ctx.lookup.started=Spring context lookup started. -ctx.lookup.failed=Spring context lookup failed, skipping spring component provider initialization. -ctx.lookup.sucessful=Spring context lookup done. -spring.component.provider.initialized=Spring component provider initialized. -none.or.multiple.beans.available=None or multiple beans found in Spring context for type {0}, skipping the type. -bean.registered=Spring managed bean, {0}, registered with HK2. -registering.ctx.loader.listener=Registering Spring ContextLoaderListener -skipping.ctx.lodaer.listener.registration=Presuming Spring ContextLoaderListener was manually registered. Skipping context loader registration. -not.in.request.scope=Cannot ask for request attributes - request is not active anymore!
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java deleted file mode 100644 index ec32676..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java +++ /dev/null
@@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; - -@Configuration -@ComponentScan(basePackages = "org.glassfish.jersey.server.spring") -public class SpringTestConfiguration { -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java deleted file mode 100644 index d8d29a3..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java +++ /dev/null
@@ -1,27 +0,0 @@ -/* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -import org.springframework.stereotype.Component; - -@Component -public class TestComponent1 { - - public String result() { - return "test ok"; - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java deleted file mode 100644 index a4f33f6..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java +++ /dev/null
@@ -1,27 +0,0 @@ -/* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring; - -import org.springframework.stereotype.Component; - -@Component -public class TestComponent2Impl2 implements TestComponent2 { - @Override - public String result() { - return "test ok"; - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java deleted file mode 100644 index 52fd0e3..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java +++ /dev/null
@@ -1,64 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.aspect4j; - -import jakarta.ws.rs.core.Application; - -import org.glassfish.jersey.test.JerseyTest; -import org.junit.Before; -import org.junit.Test; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import static org.junit.Assert.assertEquals; - -public class Aspect4JTest extends JerseyTest { - - private ClassPathXmlApplicationContext applicationContext; - - private TestAspect testAspect; - - @Before - public void before() { - testAspect.reset(); - } - - @Override - protected Application configure() { - applicationContext = new ClassPathXmlApplicationContext("jersey-spring-aspect4j-applicationContext.xml"); - testAspect = applicationContext.getBean(TestAspect.class); - return new Aspect4jJerseyConfig() - .property("contextConfig", applicationContext); - } - - @Test - public void methodCallShouldNotBeIntercepted() { - target("test1").request().get(String.class); - assertEquals(0, testAspect.getInterceptions()); - } - - @Test - public void methodCallShouldBeIntercepted() { - target("test2").request().get(String.class); - assertEquals(1, applicationContext.getBean(TestAspect.class).getInterceptions()); - } - - @Test - public void JERSEY_3126() { - final String result = target("JERSEY-3126").request().get(String.class); - assertEquals("test ok", result); - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java deleted file mode 100644 index 9b96e32..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java +++ /dev/null
@@ -1,49 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.aspect4j; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.core.Context; -import jakarta.ws.rs.core.UriInfo; - -import org.glassfish.jersey.server.spring.TestComponent1; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Path("/") -@Component -public class ComponentResource { - - @Autowired - private TestComponent1 testComponent1; - @Context - private UriInfo uriInfo; - - @Path("test2") - @GET - public String test2() { - return testComponent1.result(); - } - - @Path("JERSEY-3126") - @GET - public String JERSEY_3126() { - return uriInfo == null ? "test failed" : "test ok"; - } - -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java deleted file mode 100644 index bb5bf8a..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java +++ /dev/null
@@ -1,38 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.aspect4j; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; - -import org.glassfish.jersey.server.spring.TestComponent1; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Path("/") -public class NoComponentResource { - - @Autowired - private TestComponent1 testComponent1; - - @Path("test1") - @GET - public String test1() { - return testComponent1.result(); - } - -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java deleted file mode 100644 index 4580199..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java +++ /dev/null
@@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.aspect4j; - -import jakarta.inject.Singleton; - -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; - -@Aspect -@Singleton -public class TestAspect { - - private int interceptions = 0; - - @Before("execution(* org.glassfish.jersey.server.spring.aspect4j.*.*())") - public void intercept(JoinPoint joinPoint) { - interceptions++; - } - - public int getInterceptions() { - return interceptions; - } - - public void reset() { - interceptions = 0; - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java deleted file mode 100644 index 141d16e..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java +++ /dev/null
@@ -1,61 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.fieldinjection; - -import jakarta.ws.rs.core.Application; - -import org.glassfish.jersey.server.spring.SpringTestConfiguration; -import org.glassfish.jersey.test.JerseyTest; -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -import static org.junit.Assert.assertEquals; - -public class SpringFieldInjectionTest extends JerseyTest { - - @Override - protected Application configure() { - ApplicationContext context = new AnnotationConfigApplicationContext(SpringTestConfiguration.class); - return new SpringFieldInjectionJerseyTestConfig() - .property("contextConfig", context); - } - - @Test - public void testInjectionOfSingleBean() { - String result = target("test1").request().get(String.class); - assertEquals("test ok", result); - } - - @Test - public void testInjectionOfListOfBeans() { - String result = target("test2").request().get(String.class); - assertEquals("test ok", result); - } - - @Test - public void testInjectionOfSetOfBeans() { - String result = target("test3").request().get(String.class); - assertEquals("test ok", result); - } - - @Test - public void JERSEY_2643() { - String result = target("JERSEY-2643").request().get(String.class); - assertEquals("test ok", result); - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java deleted file mode 100644 index 941e311..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java +++ /dev/null
@@ -1,72 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.fieldinjection; - -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; - -import org.glassfish.jersey.server.spring.NoComponent; -import org.glassfish.jersey.server.spring.TestComponent1; -import org.glassfish.jersey.server.spring.TestComponent2; -import org.springframework.beans.factory.annotation.Autowired; - -@Path("/") -public class SpringFieldInjectionTestResource { - - @Autowired - private TestComponent1 testComponent1; - - @Autowired - private List<TestComponent2> testComponent2List; - - @Autowired - Set<TestComponent2> testComponent2Set; - - @Autowired(required = false) - private NoComponent noComponent; - - @Path("test1") - @GET - public String test1() { - return testComponent1.result(); - } - - @Path("test2") - @GET - public String test2() { - return (testComponent2List.size() == 2 && "test ok".equals(testComponent2List.get(0).result()) - && "test ok".equals(testComponent2List.get(1).result())) ? "test ok" : "test failed"; - } - - @Path("test3") - @GET - public String test3() { - Iterator<TestComponent2> iterator = testComponent2Set.iterator(); - return (testComponent2Set.size() == 2 && "test ok".equals(iterator.next().result()) - && "test ok".equals(iterator.next().result())) ? "test ok" : "test failed"; - } - - @Path("JERSEY-2643") - @GET - public String JERSEY_2643() { - return noComponent == null ? "test ok" : "test failed"; - } - -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java deleted file mode 100644 index 3c33392..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java +++ /dev/null
@@ -1,46 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.filter; - -import jakarta.ws.rs.core.Application; - -import org.glassfish.jersey.server.spring.SpringTestConfiguration; -import org.glassfish.jersey.test.JerseyTest; -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -import static org.junit.Assert.assertEquals; - -public class FilterTest extends JerseyTest { - - private ApplicationContext context; - - @Override - protected Application configure() { - context = new AnnotationConfigApplicationContext(SpringTestConfiguration.class); - return new JerseyTestConfig() - .property("contextConfig", context); - } - - @Test - public void testInjectionOfSingleBean() { - target("test1").request().get(String.class); - assertEquals(1, context.getBean(Counter.class).getCount()); - } - -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java deleted file mode 100644 index c8df018..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java +++ /dev/null
@@ -1,29 +0,0 @@ -/* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.filter; - -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.spring.scope.RequestContextFilter; - -public class JerseyTestConfig extends ResourceConfig { - - public JerseyTestConfig() { - register(RequestContextFilter.class); - register(TestResource.class); - register(TestFilter.class); - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java deleted file mode 100644 index 16cfd51..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java +++ /dev/null
@@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.filter; - -import java.io.IOException; -import jakarta.inject.Inject; -import jakarta.inject.Singleton; -import jakarta.ws.rs.container.ContainerRequestContext; -import jakarta.ws.rs.container.ContainerRequestFilter; - -import org.springframework.stereotype.Component; - -@Component -@Singleton -public class TestFilter implements ContainerRequestFilter { - - @Inject - private Counter counter; - - @Override - public void filter(final ContainerRequestContext requestContext) throws IOException { - counter.inc(); - } - -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java deleted file mode 100644 index 7e624ef..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java +++ /dev/null
@@ -1,30 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.filter; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; - -@Path("/") -public class TestResource { - - @Path("test1") - @GET - public String test1() { - return "Hello, Test!"; - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java deleted file mode 100644 index 3f66478..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java +++ /dev/null
@@ -1,55 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.methodinjection; - -import static org.junit.Assert.assertEquals; - -import org.glassfish.jersey.test.JerseyTest; -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.glassfish.jersey.server.spring.SpringTestConfiguration; - -import jakarta.ws.rs.core.Application; - -public class SpringMethodInjectionTest extends JerseyTest { - - @Override - protected Application configure() { - ApplicationContext context = new AnnotationConfigApplicationContext(SpringTestConfiguration.class); - return new SpringMethodInjectionJerseyTestConfig() - .property("contextConfig", context); - } - - @Test - public void testInjectionOfSingleBean() { - String result = target("test1").request().get(String.class); - assertEquals("test ok", result); - } - - @Test - public void testInjectionOfListOfBeans() { - String result = target("test2").request().get(String.class); - assertEquals("test ok", result); - } - - @Test - public void testInjectionOfSetOfBeans() { - String result = target("test3").request().get(String.class); - assertEquals("test ok", result); - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java deleted file mode 100644 index 8a16bbe..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java +++ /dev/null
@@ -1,83 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.methodinjection; - -import org.glassfish.jersey.server.spring.NoComponent; -import org.glassfish.jersey.server.spring.TestComponent1; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.List; -import java.util.Set; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; - -@Path("/") -public class SpringMethodInjectionTestResource { - - private TestComponent1 testComponent1; - private List<org.glassfish.jersey.server.spring.TestComponent2> testComponent2List; - private Set<org.glassfish.jersey.server.spring.TestComponent2> testComponent2Set; - private NoComponent noComponent; - - @Autowired - public void setTestComponent1(TestComponent1 testComponent1) { - this.testComponent1 = testComponent1; - } - - @Autowired - public void setTestComponent2List(List<org.glassfish.jersey.server.spring.TestComponent2> testComponent2List) { - this.testComponent2List = testComponent2List; - } - - @Autowired - public void setTestComponent2Set(Set<org.glassfish.jersey.server.spring.TestComponent2> testComponent2Set) { - this.testComponent2Set = testComponent2Set; - } - - @Autowired(required = false) - public void setNoComponent(NoComponent noComponent) { - this.noComponent = noComponent; - } - - @Path("test1") - @GET - public String test1() { - return testComponent1.result(); - } - - @Path("test2") - @GET - public String test2() { - return (testComponent2List.size() == 2 && "test ok".equals(testComponent2List.get(0).result()) - && "test ok".equals(testComponent2List.get(1).result())) ? "test ok" : "test failed"; - } - - @Path("test3") - @GET - public String test3() { - java.util.Iterator<org.glassfish.jersey.server.spring.TestComponent2> iterator = testComponent2Set.iterator(); - return (testComponent2Set.size() == 2 && "test ok".equals(iterator.next().result()) - && "test ok".equals(iterator.next().result())) ? "test ok" : "test failed"; - } - - @Path("JERSEY-2643") - @GET - public String JERSEY_2643() { - return noComponent == null ? "test ok" : "test failed"; - } - -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java deleted file mode 100644 index 598618f..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java +++ /dev/null
@@ -1,27 +0,0 @@ -/* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.parameterinjection; - -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.spring.scope.RequestContextFilter; - -public class SpringParameterInjectionJerseyTestConfig extends ResourceConfig { - public SpringParameterInjectionJerseyTestConfig() { - register(RequestContextFilter.class); - register(SpringParameterInjectionTestResource.class); - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java deleted file mode 100644 index e6b720e..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java +++ /dev/null
@@ -1,55 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.parameterinjection; - -import org.glassfish.jersey.server.spring.SpringTestConfiguration; -import org.glassfish.jersey.server.spring.fieldinjection.SpringFieldInjectionJerseyTestConfig; -import org.glassfish.jersey.test.JerseyTest; -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -import jakarta.ws.rs.core.Application; - -import static org.junit.Assert.assertEquals; - -public class SpringParameterInjectionTest extends JerseyTest { - @Override - protected Application configure() { - ApplicationContext context = new AnnotationConfigApplicationContext(SpringTestConfiguration.class); - return new SpringParameterInjectionJerseyTestConfig() - .property("contextConfig", context); - } - - @Test - public void testInjectionOfSingleBean() { - String result = target("test1").request().get(String.class); - assertEquals("test ok", result); - } - - @Test - public void testInjectionOfListOfBeans() { - String result = target("test2").request().get(String.class); - assertEquals("test ok", result); - } - - @Test - public void testInjectionOfSetOfBeans() { - String result = target("test3").request().get(String.class); - assertEquals("test ok", result); - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java deleted file mode 100644 index b7c56c9..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java +++ /dev/null
@@ -1,65 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.parameterinjection; - -import org.glassfish.jersey.server.spring.TestComponent1; -import org.glassfish.jersey.server.spring.TestComponent2; -import org.springframework.beans.factory.annotation.Autowired; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -@Path("/") -public class SpringParameterInjectionTestResource { - - private final TestComponent1 testComponent1; - private final List<TestComponent2> testComponent2List; - private final Set<TestComponent2> testComponent2Set; - - @Autowired - public SpringParameterInjectionTestResource(final TestComponent1 testComponent1, - final List<TestComponent2> testComponent2List, - final Set<TestComponent2> testComponent2Set) { - this.testComponent1 = testComponent1; - this.testComponent2List = testComponent2List; - this.testComponent2Set = testComponent2Set; - } - - @Path("test1") - @GET - public String test1() { - return testComponent1.result(); - } - - @Path("test2") - @GET - public String test2() { - return (testComponent2List.size() == 2 && "test ok".equals(testComponent2List.get(0).result()) - && "test ok".equals(testComponent2List.get(1).result())) ? "test ok" : "test failed"; - } - - @Path("test3") - @GET - public String test3() { - Iterator<TestComponent2> iterator = testComponent2Set.iterator(); - return (testComponent2Set.size() == 2 && "test ok".equals(iterator.next().result()) - && "test ok".equals(iterator.next().result())) ? "test ok" : "test failed"; - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java deleted file mode 100644 index 77b497c..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java +++ /dev/null
@@ -1,28 +0,0 @@ -/* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.profiles; - -import org.springframework.stereotype.Component; - -@Component -public class DefaultTestService implements TestService { - - @Override - public String test() { - return "default"; - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java deleted file mode 100644 index 3b1f6a8..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java +++ /dev/null
@@ -1,49 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.profiles; - -import jakarta.ws.rs.core.Application; - -import org.glassfish.jersey.logging.LoggingFeature; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.spring.scope.RequestContextFilter; -import org.glassfish.jersey.test.JerseyTest; - -import org.junit.Assert; -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -public class SpringDefaultProfileResourceTest extends JerseyTest { - - @Override - protected Application configure() { - System.setProperty("spring.profiles.active", ""); - ApplicationContext context = new AnnotationConfigApplicationContext("org.glassfish.jersey.server.spring.profiles"); - return new ResourceConfig() - .register(RequestContextFilter.class) - .register(LoggingFeature.class) - .packages("org.glassfish.jersey.server.spring.profiles") - .property("contextConfig", context); - } - - @Test - public void shouldUseDefaultComponent() { - final String result = target("spring-resource").request().get(String.class); - Assert.assertEquals("default", result); - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java deleted file mode 100644 index 2d7c5a1..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java +++ /dev/null
@@ -1,49 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.profiles; - -import jakarta.ws.rs.core.Application; - -import org.glassfish.jersey.logging.LoggingFeature; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.spring.scope.RequestContextFilter; -import org.glassfish.jersey.test.JerseyTest; - -import org.junit.Assert; -import org.junit.Test; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -public class SpringDevProfileResourceTest extends JerseyTest { - - @Override - protected Application configure() { - System.setProperty("spring.profiles.active", "dev"); - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( - "org.glassfish.jersey.server.spring.profiles"); - return new ResourceConfig() - .register(RequestContextFilter.class) - .register(LoggingFeature.class) - .packages("org.glassfish.jersey.server.spring.profiles") - .property("contextConfig", context); - } - - @Test - public void shouldUseDevProfileBean() { - final String result = target("spring-resource").request().get(String.class); - Assert.assertEquals("dev", result); - } -}
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java b/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java deleted file mode 100644 index e05de3d..0000000 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java +++ /dev/null
@@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.profiles; - -import jakarta.inject.Singleton; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - - -@Singleton -@Path("spring-resource") -@Service -public class SpringRequestResource { - - @Autowired - private TestService testService; - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String getGoodbye() { - return testService.test(); - } - -}
diff --git a/ext/spring5/src/test/resources/jersey-spring-aspect4j-applicationContext.xml b/ext/spring5/src/test/resources/jersey-spring-aspect4j-applicationContext.xml deleted file mode 100644 index 7abafe3..0000000 --- a/ext/spring5/src/test/resources/jersey-spring-aspect4j-applicationContext.xml +++ /dev/null
@@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v. 2.0, which is available at - http://www.eclipse.org/legal/epl-2.0. - - This Source Code may also be made available under the following Secondary - Licenses when the conditions for such availability set forth in the - Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - version 2 with the GNU Classpath Exception, which is available at - https://www.gnu.org/software/classpath/license.html. - - SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/aop - http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> - - <aop:aspectj-autoproxy/> - - <context:component-scan base-package="org.glassfish.jersey.server.spring"/> - - <bean id="someAspect" class="org.glassfish.jersey.server.spring.aspect4j.TestAspect"/> -</beans>
diff --git a/ext/spring6/pom.xml b/ext/spring6/pom.xml new file mode 100644 index 0000000..c7817c6 --- /dev/null +++ b/ext/spring6/pom.xml
@@ -0,0 +1,361 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" 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"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.glassfish.jersey.ext</groupId> + <artifactId>project</artifactId> + <version>3.1.0-SNAPSHOT</version> + </parent> + + <artifactId>jersey-spring6</artifactId> + <name>jersey-spring6</name> + + <packaging>jar</packaging> + + <description> + Jersey extension module providing support for Spring 6 integration. + </description> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <java.build.outputDirectory>${project.basedir}/target</java.build.outputDirectory> + <javaPre17.sourceDirectory>${project.basedir}/src/main/javaPre17</javaPre17.sourceDirectory> + <java17.build.outputDirectory>${project.basedir}/target17</java17.build.outputDirectory> + <java17.sourceDirectory>${project.basedir}/src/main/java17</java17.sourceDirectory> + </properties> + + <repositories> + <repository> + <name>Spring Repository</name> + <id>spring-repository</id> + <url>https://repo.spring.io/milestone</url> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>org.glassfish.jersey.core</groupId> + <artifactId>jersey-server</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.glassfish.jersey.inject</groupId> + <artifactId>jersey-hk2</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.glassfish.jersey.containers</groupId> + <artifactId>jersey-container-servlet-core</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.glassfish.jersey.test-framework.providers</groupId> + <artifactId>jersey-test-framework-provider-grizzly2</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.2</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.glassfish.hk2</groupId> + <artifactId>hk2</artifactId> + <version>${hk2.version}</version> + </dependency> + + <dependency> + <groupId>org.glassfish.hk2</groupId> + <artifactId>spring-bridge</artifactId> + <version>${hk2.version}</version> + <exclusions> + <exclusion> <!-- already pulled in by jersey-server --> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject</artifactId> + </exclusion> + <exclusion> + <groupId>org.glassfish.hk2</groupId> + <artifactId>hk2-api</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring6.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring6.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring6.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + <version>${spring6.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring6.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> + <version>${servlet5.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.glassfish.jersey.test-framework</groupId> + <artifactId>jersey-test-framework-core</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjrt</artifactId> + <version>1.6.11</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>1.6.11</version> + <scope>test</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>com.sun.istack</groupId> + <artifactId>istack-commons-maven-plugin</artifactId> + <inherited>true</inherited> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <inherited>true</inherited> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>SpringExclude</id> + <activation> + <jdk>[1.8,17)</jdk> + </activation> + <build> + <directory>${java.build.outputDirectory}</directory> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>${javaPre17.sourceDirectory}</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <testExcludes> + <testExclude>org/glassfish/jersey/server/spring/**/*.java</testExclude> + </testExcludes> + </configuration> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>SpringInclude</id> + <activation> + <jdk>[17,)</jdk> + </activation> + <build> + <directory>${java17.build.outputDirectory}</directory> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>${java17.sourceDirectory}</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>copyJDK17FilesToMultiReleaseJar</id> + <activation> + <file> + <!-- ${java17.build.outputDirectory} does not work here --> + <exists>target17/classes/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.class</exists> + </file> + <jdk>[1.8,17)</jdk> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <inherited>true</inherited> + <extensions>true</extensions> + <configuration> + <instructions> + <Multi-Release>true</Multi-Release> + </instructions> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <inherited>true</inherited> + <executions> + <execution> + <id>copy-jdk17-classes</id> + <phase>prepare-package</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <outputDirectory>${java.build.outputDirectory}/classes/META-INF/versions/17</outputDirectory> + <resources> + <resource> + <directory>${java17.build.outputDirectory}/classes</directory> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>copy-jdk17-sources</id> + <phase>package</phase> + <configuration> + <target> + <property name="sources-jar" value="${java.build.outputDirectory}/${project.artifactId}-${project.version}-sources.jar"/> + <echo>sources-jar: ${sources-jar}</echo> + <zip destfile="${sources-jar}" update="true"> + <zipfileset dir="${java17.sourceDirectory}" prefix="META-INF/versions/17"/> + </zip> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>delayed-strategy-skip-test</id> + <activation> + <property> + <name>org.glassfish.jersey.injection.manager.strategy</name> + <value>delayed</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skipTests>true</skipTests> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project>
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/package-info.java b/ext/spring6/src/main/java/org/glassfish/jersey/server/spring/package-info.java similarity index 83% rename from ext/spring4/src/main/java/org/glassfish/jersey/server/spring/package-info.java rename to ext/spring6/src/main/java/org/glassfish/jersey/server/spring/package-info.java index 0176470..229c054 100644 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/package-info.java +++ b/ext/spring6/src/main/java/org/glassfish/jersey/server/spring/package-info.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -15,7 +15,7 @@ */ /** - * Jersey server-side Spring 4 integration classes. - * + * Jersey server-side Spring 6 integration classes. + * @since 3.0.5 */ package org.glassfish.jersey.server.spring;
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java b/ext/spring6/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java similarity index 83% rename from ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java rename to ext/spring6/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java index e15b2c5..d4e3c8e 100644 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java +++ b/ext/spring6/src/main/java/org/glassfish/jersey/server/spring/scope/package-info.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -15,7 +15,7 @@ */ /** - * Jersey server-side Spring 4 integration injection scopes related classes. - * + * Jersey server-side Spring 6 integration injection scopes related classes. + * @since 3.0.5 */ package org.glassfish.jersey.server.spring.scope;
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java similarity index 98% rename from ext/spring5/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java rename to ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java index 61fc9b1..aca66c9 100644 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java +++ b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringComponentProvider.java similarity index 97% rename from ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java rename to ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringComponentProvider.java index 07208f5..358f488 100644 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringComponentProvider.java +++ b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringComponentProvider.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -43,7 +43,7 @@ /** * Custom ComponentProvider class. - * Responsible for 1) bootstrapping Jersey 2 Spring integration and + * Responsible for 1) bootstrapping Jersey 3 Spring integration and * 2) making Jersey skip JAX-RS Spring component life-cycle management and leave it to us. * * @author Marko Asplund (marko.asplund at yahoo.com)
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringLifecycleListener.java similarity index 92% rename from ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java rename to ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringLifecycleListener.java index 5a06926..b47ba09 100644 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java +++ b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringLifecycleListener.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -27,7 +27,7 @@ import org.springframework.context.ConfigurableApplicationContext; /** - * JAX-RS Provider class for processing Jersey 2 Spring integration container life-cycle events. + * JAX-RS Provider class for processing Jersey 3 Spring integration container life-cycle events. * * @author Marko Asplund (marko.asplund at yahoo.com) */
diff --git a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java similarity index 96% rename from ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java rename to ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java index c3bac70..8e21bda 100644 --- a/ext/spring5/src/main/java/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java +++ b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringWebApplicationInitializer.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java similarity index 97% rename from ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java rename to ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java index ec22efa..35a9e26 100644 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java +++ b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/JaxrsRequestAttributes.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java similarity index 96% rename from ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java rename to ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java index a3ac9d1..4c2d0c2 100644 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java +++ b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/JaxrsServletRequestAttributes.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -13,7 +13,6 @@ * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ - package org.glassfish.jersey.server.spring.scope; import jakarta.ws.rs.container.ContainerRequestContext;
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java similarity index 98% rename from ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java rename to ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java index de87d7e..a489695 100644 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java +++ b/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java b/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java new file mode 100644 index 0000000..747c607 --- /dev/null +++ b/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/AutowiredInjectResolver.java
@@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ +package org.glassfish.jersey.server.spring; + +import jakarta.inject.Singleton; +import org.glassfish.jersey.internal.inject.Injectee; +import org.glassfish.jersey.internal.inject.InjectionResolver; + +@Singleton +public class AutowiredInjectResolver implements InjectionResolver { + + @Override + public Object resolve(Injectee injectee) { + return null; + } + + @Override + public boolean isConstructorParameterIndicator() { + return false; + } + + @Override + public boolean isMethodParameterIndicator() { + return false; + } + + @Override + public Class getAnnotation() { + return null; + } +}
diff --git a/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/SpringComponentProvider.java b/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/SpringComponentProvider.java new file mode 100644 index 0000000..5f85ffb --- /dev/null +++ b/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/SpringComponentProvider.java
@@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.jersey.server.spring; + +import org.glassfish.jersey.internal.inject.InjectionManager; +import org.glassfish.jersey.internal.util.JdkVersion; +import org.glassfish.jersey.server.spi.ComponentProvider; + +import java.util.Set; + +/** + * Custom ComponentProvider class. + * Responsible for 1) bootstrapping Jersey 3 Spring integration and + * 2) making Jersey skip JAX-RS Spring component life-cycle management and leave it to us. + * + * @author Marko Asplund (marko.asplund at yahoo.com) + */ +public class SpringComponentProvider implements ComponentProvider { + + @Override + public void initialize(InjectionManager injectionManager) { + if (JdkVersion.getJdkVersion().getMajor() < 17) { + throw new IllegalStateException(LocalizationMessages.NOT_SUPPORTED()); + } + } + + @Override + public boolean bind(Class<?> component, Set<Class<?>> providerContracts) { + return false; + } + + @Override + public void done() { + + } +}
diff --git a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java b/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/SpringLifecycleListener.java similarity index 62% copy from ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java copy to ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/SpringLifecycleListener.java index 5a06926..15dd493 100644 --- a/ext/spring4/src/main/java/org/glassfish/jersey/server/spring/SpringLifecycleListener.java +++ b/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/SpringLifecycleListener.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -17,41 +17,25 @@ package org.glassfish.jersey.server.spring; import jakarta.ws.rs.ext.Provider; - -import jakarta.inject.Inject; - +import org.glassfish.jersey.internal.util.JdkVersion; import org.glassfish.jersey.server.spi.Container; import org.glassfish.jersey.server.spi.ContainerLifecycleListener; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ConfigurableApplicationContext; - -/** - * JAX-RS Provider class for processing Jersey 2 Spring integration container life-cycle events. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ @Provider public class SpringLifecycleListener implements ContainerLifecycleListener { - @Inject - private ApplicationContext ctx; - @Override public void onStartup(Container container) { + if (JdkVersion.getJdkVersion().getMajor() < 17) { + throw new IllegalStateException(LocalizationMessages.NOT_SUPPORTED()); + } } @Override public void onReload(Container container) { - if (ctx instanceof ConfigurableApplicationContext) { - ((ConfigurableApplicationContext) ctx).refresh(); - } } @Override public void onShutdown(Container container) { - if (ctx instanceof ConfigurableApplicationContext) { - ((ConfigurableApplicationContext) ctx).close(); - } } }
diff --git a/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java b/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java new file mode 100644 index 0000000..9a41f80 --- /dev/null +++ b/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/scope/RequestContextFilter.java
@@ -0,0 +1,54 @@ +/* + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.jersey.server.spring.scope; + +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; +import jakarta.ws.rs.container.PreMatching; +import jakarta.ws.rs.ext.Provider; +import org.glassfish.jersey.internal.util.JdkVersion; +import org.glassfish.jersey.server.spring.LocalizationMessages; + +import java.io.IOException; + +/** + * Spring filter to provide a bridge between JAX-RS and Spring request attributes. + * + * @author Marko Asplund (marko.asplund at yahoo.com) + * @author Jakub Podlesak + * @author Marek Potociar + */ +@Provider +@PreMatching +public final class RequestContextFilter implements ContainerRequestFilter, ContainerResponseFilter { + + @Override + public void filter(ContainerRequestContext requestContext) throws IOException { + if (JdkVersion.getJdkVersion().getMajor() < 17) { + throw new IllegalStateException(LocalizationMessages.NOT_SUPPORTED()); + } + } + + @Override + public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { + if (JdkVersion.getJdkVersion().getMajor() < 17) { + throw new IllegalStateException(LocalizationMessages.NOT_SUPPORTED()); + } + } +}
diff --git a/ext/spring4/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider b/ext/spring6/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider similarity index 100% rename from ext/spring4/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider rename to ext/spring6/src/main/resources/META-INF/services/org.glassfish.jersey.server.spi.ComponentProvider
diff --git a/ext/spring4/src/main/resources/jersey-spring-applicationContext.xml b/ext/spring6/src/main/resources/jersey-spring-applicationContext.xml similarity index 95% rename from ext/spring4/src/main/resources/jersey-spring-applicationContext.xml rename to ext/spring6/src/main/resources/jersey-spring-applicationContext.xml index 00e4dda..b563fd3 100644 --- a/ext/spring4/src/main/resources/jersey-spring-applicationContext.xml +++ b/ext/spring6/src/main/resources/jersey-spring-applicationContext.xml
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/main/resources/org/glassfish/jersey/server/spring/localization.properties b/ext/spring6/src/main/resources/org/glassfish/jersey/server/spring/localization.properties similarity index 90% rename from ext/spring4/src/main/resources/org/glassfish/jersey/server/spring/localization.properties rename to ext/spring6/src/main/resources/org/glassfish/jersey/server/spring/localization.properties index 6fd0a06..333129d 100644 --- a/ext/spring4/src/main/resources/org/glassfish/jersey/server/spring/localization.properties +++ b/ext/spring6/src/main/resources/org/glassfish/jersey/server/spring/localization.properties
@@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0, which is available at @@ -20,6 +20,7 @@ ctx.lookup.sucessful=Spring context lookup done. spring.component.provider.initialized=Spring component provider initialized. none.or.multiple.beans.available=None or multiple beans found in Spring context for type {0}, skipping the type. +not.supported=Spring component is not supported on JDK version less than 17. bean.registered=Spring managed bean, {0}, registered with HK2. registering.ctx.loader.listener=Registering Spring ContextLoaderListener skipping.ctx.lodaer.listener.registration=Presuming Spring ContextLoaderListener was manually registered. Skipping context loader registration.
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java similarity index 91% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java index 0afc246..d1d6e7f 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/NoComponent.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java similarity index 93% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java index 5a8123c..cd15638 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/SpringTestConfiguration.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java similarity index 92% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java index 7a065c1..927f33f 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent1.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java similarity index 91% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java index 742f421..d12d682 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java similarity index 93% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java index 25078b6..3672d0c 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl1.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java similarity index 93% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java index 9900cd4..f6c19ce 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/TestComponent2Impl2.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java similarity index 96% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java index 52fd0e3..d360115 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4JTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java similarity index 94% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java index 0f60e3b..f7ef7fc 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/Aspect4jJerseyConfig.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java similarity index 95% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java index 9b96e32..2b1cf67 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/ComponentResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java similarity index 94% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java index bb5bf8a..629ffc1 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/NoComponentResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java similarity index 94% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java index 4580199..fcbe989 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/aspect4j/TestAspect.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java similarity index 94% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java index 0eb367b..3e0ba86 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionJerseyTestConfig.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java similarity index 96% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java index 141d16e..c06d2db 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java similarity index 96% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java index 941e311..30bc7a8 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/fieldinjection/SpringFieldInjectionTestResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java similarity index 93% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java index 5c831bf..9c157ce 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/Counter.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java similarity index 95% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java index 3c33392..925ae46 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/FilterTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java similarity index 93% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java index 9fb32a8..c3a5cdd 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/JerseyTestConfig.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java similarity index 94% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java index 8205333..a672a10 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/TestFilter.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java similarity index 93% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java index 7e624ef..3fccdaf 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/filter/TestResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java similarity index 94% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java index 7f26bce..02e612e 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionJerseyTestConfig.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java similarity index 96% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java index 3f66478..0b087ce 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java similarity index 97% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java index 8a16bbe..ebbc49c 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/methodinjection/SpringMethodInjectionTestResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java similarity index 94% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java index d67ebd4..254ca2d 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionJerseyTestConfig.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java similarity index 96% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java index e6b720e..8a1bfb5 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java similarity index 97% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java index b7c56c9..8987d72 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/parameterinjection/SpringParameterInjectionTestResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java similarity index 93% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java index 040d053..8c91747 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/DefaultTestService.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java similarity index 93% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java index 34dcadf..e3dcad9 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/DevTestService.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java similarity index 96% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java index 3b1f6a8..559d3dd 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDefaultProfileResourceTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java similarity index 96% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java index 2d7c5a1..0fe73d3 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringDevProfileResourceTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java similarity index 95% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java index be0ac47..72fe2b1 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringProfilesTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java similarity index 94% rename from ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java index e05de3d..067111a 100644 --- a/ext/spring4/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/SpringRequestResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java similarity index 91% rename from ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java rename to ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java index d5635b5..aa134de 100644 --- a/ext/spring5/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java +++ b/ext/spring6/src/test/java/org/glassfish/jersey/server/spring/profiles/TestService.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/ext/spring4/src/test/resources/jersey-spring-aspect4j-applicationContext.xml b/ext/spring6/src/test/resources/jersey-spring-aspect4j-applicationContext.xml similarity index 95% rename from ext/spring4/src/test/resources/jersey-spring-aspect4j-applicationContext.xml rename to ext/spring6/src/test/resources/jersey-spring-aspect4j-applicationContext.xml index c80c155..a755498 100644 --- a/ext/spring4/src/test/resources/jersey-spring-aspect4j-applicationContext.xml +++ b/ext/spring6/src/test/resources/jersey-spring-aspect4j-applicationContext.xml
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/pom.xml b/pom.xml index 7754fe8..e428b5b 100644 --- a/pom.xml +++ b/pom.xml
@@ -2141,9 +2141,8 @@ <simple.version>6.0.1</simple.version> <skip.e2e>false</skip.e2e> <slf4j.version>1.7.21</slf4j.version> - <spring4.version>4.3.20.RELEASE</spring4.version> - <spring5.version>5.1.5.RELEASE</spring5.version> - <surefire.version>3.0.0-M5</surefire.version> + <spring6.version>6.0.0-M3</spring6.version> + <surefire.version>3.0.0-M3</surefire.version> <!-- Jakartified, eligible for CQ --> <weld.version>4.0.2.Final</weld.version>
diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index 19aa781..6406f8d 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml
@@ -58,8 +58,6 @@ <module>jersey-4697</module> <module>jersey-4722</module> <module>microprofile</module> -<!-- <module>spring4</module>--> -<!-- <module>spring5</module>--> <module>reactive-streams</module> </modules> @@ -206,6 +204,15 @@ <module>tracing-support</module> </modules> </profile> + <profile> + <id>spring6-jdk17</id> + <activation> + <jdk>[17,)</jdk> + </activation> + <modules> + <module>spring6</module> + </modules> + </profile> </profiles> <build>
diff --git a/tests/integration/spring4/pom.xml b/tests/integration/spring4/pom.xml deleted file mode 100644 index 66764b8..0000000 --- a/tests/integration/spring4/pom.xml +++ /dev/null
@@ -1,166 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v. 2.0, which is available at - http://www.eclipse.org/legal/epl-2.0. - - This Source Code may also be made available under the following Secondary - Licenses when the conditions for such availability set forth in the - Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - version 2 with the GNU Classpath Exception, which is available at - https://www.gnu.org/software/classpath/license.html. - - SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" 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"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.glassfish.jersey.tests.integration</groupId> - <artifactId>project</artifactId> - <version>3.0.0-SNAPSHOT</version> - </parent> - - <artifactId>spring4</artifactId> - - <packaging>war</packaging> - <name>jersey-tests-integration-spring4</name> - - <description> - Jersey tests for Spring 4 integration - </description> - - <dependencies> - - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>${servlet4.version}</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>jakarta.ws.rs</groupId> - <artifactId>jakarta.ws.rs-api</artifactId> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.ext</groupId> - <artifactId>jersey-spring4</artifactId> - <version>${project.version}</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.test-framework</groupId> - <artifactId>jersey-test-framework-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.containers</groupId> - <artifactId>jersey-container-servlet</artifactId> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.test-framework.providers</groupId> - <artifactId>jersey-test-framework-provider-external</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <scope>runtime</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-maven-plugin</artifactId> - <configuration> - <webApp> - <contextPath>/</contextPath> - <webInfIncludeJarPattern>.*$</webInfIncludeJarPattern> - </webApp> - </configuration> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>delayed-strategy-skip-test</id> - <activation> - <property> - <name>org.glassfish.jersey.injection.manager.strategy</name> - <value>delayed</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>jakartification_exclude_tests</id> <!-- TODO remove after jakartification --> - <activation> - <jdk>[1.8,)</jdk> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>ignore.on.jdk16</id> - <!-- Spring 4 does not support JDK 16 at the moment, and it is superseded by Spring 5.2-5.3 --> - <activation> - <jdk>[16,)</jdk> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - </plugins> - </build> - </profile> - </profiles> -</project>
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java b/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java deleted file mode 100644 index da9f170..0000000 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java +++ /dev/null
@@ -1,34 +0,0 @@ -/* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.stereotype.Component; - -/** - * @author Konrad Garus (konrad.garus at gmail.com) - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Component -public @interface Endpoint { - -}
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java b/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java deleted file mode 100644 index da45aea..0000000 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java +++ /dev/null
@@ -1,25 +0,0 @@ -/* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -/** - * Type to be handled as HK2 request scoped bean. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class HK2ServiceRequestScoped { -}
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java b/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java deleted file mode 100644 index a7b8fa8..0000000 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java +++ /dev/null
@@ -1,25 +0,0 @@ -/* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -/** - * Type to be handled as HK2 singleton. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class HK2ServiceSingleton { -}
diff --git a/tests/integration/spring5/README.txt b/tests/integration/spring5/README.txt deleted file mode 100644 index 9a105f7..0000000 --- a/tests/integration/spring5/README.txt +++ /dev/null
@@ -1,30 +0,0 @@ - -tests -===== - -Tests are located in jersey-spring-test module. -The module contains a test webapp and test code. -The tests can be run in Jersey test container or an external container. - -- Running tests in Jersey test container - mvn clean test - -- Running tests in an external container - build the test app - deploy to an external container - configure container connection info in jersey-spring-test/pom.xml, if needed - run tests in integration test mode: - mvn -Pit verify - -- Running tests in embedded Jetty instance - build the test app - deploy to Jetty: - mvn -Pjetty jetty:run - run tests in integration test mode in another console session: - mvn -Pit verify - -test class naming conventions -- *ITTest.java: run in unit and IT test mode -- *Test.java: run as unit tests -- *IT.java: run as IT tests -
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java deleted file mode 100644 index bd10b50..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java +++ /dev/null
@@ -1,164 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import java.math.BigDecimal; - -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.core.MediaType; - -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; - -/** - * Jersey managed JAX-RS resource for testing jersey-spring. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -@Path("/jersey/account") -public class AccountJerseyResource { - - @Inject - @Named("AccountService-singleton") - private AccountService accountServiceInject; - - @Autowired - @Qualifier("AccountService-singleton") - private AccountService accountServiceAutowired; - - @Inject - @Named("AccountService-request-1") - private AccountService accountServiceRequest1; - - @Autowired - @Qualifier("AccountService-request-1") - private AccountService accountServiceRequest2; - - @Autowired - @Qualifier("AccountService-prototype-1") - private AccountService accountServicePrototype1; - - @Autowired - @Qualifier("AccountService-prototype-1") - private AccountService accountServicePrototype2; - - @Autowired - private HttpServletRequest httpServletRequest; - - @Inject - private HK2ServiceSingleton hk2Singleton; - - @Inject - private HK2ServiceRequestScoped hk2RequestScoped; - - @Inject - private HK2ServicePerLookup hk2PerLookup; - - private String message = "n/a"; - - // resource methods for testing resource class scope - @GET - @Path("message") - public String getMessage() { - return message; - } - - @PUT - @Path("message") - @Consumes(MediaType.TEXT_PLAIN) - public String setMessage(final String message) { - this.message = message; - return message; - } - - // JERSEY-2506 FIX VERIFICATION - @GET - @Path("server") - public String verifyServletRequestInjection() { - return "PASSED: " + httpServletRequest.getServerName(); - } - - @GET - @Path("singleton/server") - public String verifyServletRequestInjectionIntoSingleton() { - return accountServiceInject.verifyServletRequestInjection(); - } - - @GET - @Path("singleton/autowired/server") - public String verifyServletRequestInjectionIntoAutowiredSingleton() { - return accountServiceAutowired.verifyServletRequestInjection(); - } - - @GET - @Path("request/server") - public String verifyServletRequestInjectionIntoRequestScopedBean() { - return accountServiceRequest1.verifyServletRequestInjection(); - } - - @GET - @Path("prototype/server") - public String verifyServletRequestInjectionIntoPrototypeScopedBean() { - return accountServicePrototype1.verifyServletRequestInjection(); - } - - // resource methods for testing singleton scoped beans - @GET - @Path("singleton/inject/{accountId}") - public BigDecimal getAccountBalanceSingletonInject(@PathParam("accountId") final String accountId) { - return accountServiceInject.getAccountBalance(accountId); - } - - @GET - @Path("singleton/autowired/{accountId}") - public BigDecimal getAccountBalanceSingletonAutowired(@PathParam("accountId") final String accountId) { - return accountServiceAutowired.getAccountBalance(accountId); - } - - @PUT - @Path("singleton/{accountId}") - @Consumes(MediaType.TEXT_PLAIN) - public void setAccountBalanceSingleton(@PathParam("accountId") final String accountId, final String balance) { - accountServiceInject.setAccountBalance(accountId, new BigDecimal(balance)); - } - - // resource methods for testing request scoped beans - @PUT - @Path("request/{accountId}") - @Consumes(MediaType.TEXT_PLAIN) - public BigDecimal setAccountBalanceRequest(@PathParam("accountId") final String accountId, final String balance) { - accountServiceRequest1.setAccountBalance(accountId, new BigDecimal(balance)); - return accountServiceRequest2.getAccountBalance(accountId); - } - - // resource methods for testing prototype scoped beans - @PUT - @Path("prototype/{accountId}") - @Consumes(MediaType.TEXT_PLAIN) - public BigDecimal setAccountBalancePrototype(@PathParam("accountId") final String accountId, final String balance) { - accountServicePrototype1.setAccountBalance(accountId, new BigDecimal(balance)); - return accountServicePrototype2.getAccountBalance(accountId); - } -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java deleted file mode 100644 index 70d90b0..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java +++ /dev/null
@@ -1,33 +0,0 @@ -/* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import java.math.BigDecimal; - -/** - * Simple account service to testify injection into different scopes. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public interface AccountService { - - void setAccountBalance(String accountId, BigDecimal balance); - - BigDecimal getAccountBalance(String accountId); - - String verifyServletRequestInjection(); -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java deleted file mode 100644 index b7fb876..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java +++ /dev/null
@@ -1,63 +0,0 @@ -/* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; - -import jakarta.servlet.http.HttpServletRequest; - -import org.springframework.beans.factory.annotation.Autowired; - -/** - * AccountService implementation. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class AccountServiceImpl implements AccountService { - - private Map<String, BigDecimal> accounts = new HashMap<>(); - private BigDecimal defaultAccountBalance; - - // JERSEY-2506 FIX VERIFICATION - @Autowired - private HttpServletRequest httpServletRequest; - - @Override - public void setAccountBalance(String accountId, BigDecimal balance) { - accounts.put(accountId, balance); - } - - @Override - public BigDecimal getAccountBalance(String accountId) { - BigDecimal balance = accounts.get(accountId); - if (balance == null) { - return defaultAccountBalance; - } - return balance; - } - - public void setDefaultAccountBalance(String defaultAccountBalance) { - this.defaultAccountBalance = new BigDecimal(defaultAccountBalance); - } - - public String verifyServletRequestInjection() { - return "PASSED: " + httpServletRequest.getServerName(); - } - -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java deleted file mode 100644 index 0e5d2cf..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java +++ /dev/null
@@ -1,167 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import java.math.BigDecimal; - -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.core.MediaType; - -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Component; - -/** - * Spring managed JAX-RS resource for testing jersey-spring. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -@Path("/spring/account") -@Component -public class AccountSpringResource { - - @Inject - @Named("AccountService-singleton") - private AccountService accountServiceInject; - - @Autowired - @Qualifier("AccountService-singleton") - private AccountService accountServiceAutowired; - - @Inject - @Named("AccountService-request-1") - private AccountService accountServiceRequest1; - - @Autowired - @Qualifier("AccountService-request-1") - private AccountService accountServiceRequest2; - - @Autowired - @Qualifier("AccountService-prototype-1") - private AccountService accountServicePrototype1; - - @Autowired - @Qualifier("AccountService-prototype-1") - private AccountService accountServicePrototype2; - - @Autowired - private HttpServletRequest httpServletRequest; - - @Inject - private HK2ServiceSingleton hk2Singleton; - - @Inject - private HK2ServiceRequestScoped hk2RequestScoped; - - @Inject - private HK2ServicePerLookup hk2PerLookup; - - private String message = "n/a"; - - // resource methods for testing resource class scope - @GET - @Path("message") - public String getMessage() { - return message; - } - - @PUT - @Path("message") - @Consumes(MediaType.TEXT_PLAIN) - public String setMessage(String message) { - this.message = message; - return message; - } - - // JERSEY-2506 FIX VERIFICATION - @GET - @Path("server") - public String verifyServletRequestInjection() { - return "PASSED: " + httpServletRequest.getServerName(); - } - - @GET - @Path("singleton/server") - public String verifyServletRequestInjectionIntoSingleton() { - return accountServiceInject.verifyServletRequestInjection(); - } - - @GET - @Path("singleton/autowired/server") - public String verifyServletRequestInjectionIntoAutowiredSingleton() { - return accountServiceAutowired.verifyServletRequestInjection(); - } - - @GET - @Path("request/server") - public String verifyServletRequestInjectionIntoRequestScopedBean() { - return accountServiceRequest1.verifyServletRequestInjection(); - } - - @GET - @Path("prototype/server") - public String verifyServletRequestInjectionIntoPrototypeScopedBean() { - return accountServicePrototype1.verifyServletRequestInjection(); - } - - // resource methods for testing singleton scoped beans - @GET - @Path("singleton/inject/{accountId}") - public BigDecimal getAccountBalanceSingletonInject(@PathParam("accountId") String accountId) { - return accountServiceInject.getAccountBalance(accountId); - } - - @GET - @Path("singleton/autowired/{accountId}") - public BigDecimal getAccountBalanceSingletonAutowired(@PathParam("accountId") String accountId) { - return accountServiceAutowired.getAccountBalance(accountId); - } - - @PUT - @Path("singleton/{accountId}") - @Consumes(MediaType.TEXT_PLAIN) - public void setAccountBalanceSingleton(@PathParam("accountId") String accountId, String balance) { - accountServiceInject.setAccountBalance(accountId, new BigDecimal(balance)); - } - - // resource methods for testing request scoped beans - @PUT - @Path("request/{accountId}") - @Consumes(MediaType.TEXT_PLAIN) - public BigDecimal setAccountBalanceRequest(@PathParam("accountId") String accountId, String balance) { - accountServiceRequest1.setAccountBalance(accountId, new BigDecimal(balance)); - return accountServiceRequest2.getAccountBalance(accountId); - } - - // resource methods for testing prototype scoped beans - @PUT - @Path("prototype/{accountId}") - @Consumes(MediaType.TEXT_PLAIN) - public BigDecimal setAccountBalancePrototype(@PathParam("accountId") String accountId, String balance) { - accountServicePrototype1.setAccountBalance(accountId, new BigDecimal(balance)); - return accountServicePrototype2.getAccountBalance(accountId); - } - -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java deleted file mode 100644 index 39dd5aa..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java +++ /dev/null
@@ -1,49 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.core.MediaType; - -import org.springframework.stereotype.Controller; - -/** - * @author Konrad Garus (konrad.garus at gmail.com) - */ -@Controller -@Path("/spring/controller") -public class ControllerResource { - - private String message; - - @PUT - @Path("message") - @Consumes(MediaType.TEXT_PLAIN) - public String setMessage(final String message) { - this.message = message; - return message; - } - - @GET - @Path("message") - public String getMessage() { - return message; - } -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java deleted file mode 100644 index d61ef3b..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java +++ /dev/null
@@ -1,47 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.core.MediaType; - -/** - * @author Konrad Garus (konrad.garus at gmail.com) - */ -@Endpoint -@Path("/spring/endpoint") -public class EndpointResource { - - private String message; - - @PUT - @Path("message") - @Consumes(MediaType.TEXT_PLAIN) - public String setMessage(final String message) { - this.message = message; - return message; - } - - @GET - @Path("message") - public String getMessage() { - return message; - } -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java deleted file mode 100644 index 4b6bbf5..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java +++ /dev/null
@@ -1,25 +0,0 @@ -/* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -/** - * Type to be handled as HK2 per-lookup bean. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class HK2ServicePerLookup { -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java deleted file mode 100644 index b0f82c7..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java +++ /dev/null
@@ -1,50 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.core.Application; - -import jakarta.inject.Inject; -import jakarta.inject.Singleton; - -import org.glassfish.jersey.internal.inject.AbstractBinder; -import org.glassfish.jersey.internal.inject.Binder; -import org.glassfish.jersey.internal.inject.InjectionManager; -import org.glassfish.jersey.internal.inject.PerLookup; -import org.glassfish.jersey.process.internal.RequestScoped; - -/** - * JAX-RS application class for configuring injectable services in HK2 registry for testing purposes. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class MyApplication extends Application { - - @Inject - public MyApplication(final InjectionManager injectionManager) { - Binder binder = new AbstractBinder() { - @Override - protected void configure() { - bindAsContract(HK2ServiceSingleton.class).in(Singleton.class); - bindAsContract(HK2ServiceRequestScoped.class).in(RequestScoped.class); - bindAsContract(HK2ServicePerLookup.class).in(PerLookup.class); - } - }; - - injectionManager.register(binder); - } -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java deleted file mode 100644 index b815fe0..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java +++ /dev/null
@@ -1,49 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.core.MediaType; - -import org.springframework.stereotype.Repository; - -/** - * @author Konrad Garus (konrad.garus at gmail.com) - */ -@Repository -@Path("/spring/repository") -public class RepositoryResource { - - private String message; - - @PUT - @Path("message") - @Consumes(MediaType.TEXT_PLAIN) - public String setMessage(final String message) { - this.message = message; - return message; - } - - @GET - @Path("message") - public String getMessage() { - return message; - } -}
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java b/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java deleted file mode 100644 index d50e5a6..0000000 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java +++ /dev/null
@@ -1,49 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.core.MediaType; - -import org.springframework.stereotype.Service; - -/** - * @author Konrad Garus (konrad.garus at gmail.com) - */ -@Service -@Path("/spring/service") -public class ServiceResource { - - private String message; - - @PUT - @Path("message") - @Consumes(MediaType.TEXT_PLAIN) - public String setMessage(final String message) { - this.message = message; - return message; - } - - @GET - @Path("message") - public String getMessage() { - return message; - } -}
diff --git a/tests/integration/spring5/src/main/resources/applicationContext.xml b/tests/integration/spring5/src/main/resources/applicationContext.xml deleted file mode 100644 index c7e421e..0000000 --- a/tests/integration/spring5/src/main/resources/applicationContext.xml +++ /dev/null
@@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v. 2.0, which is available at - http://www.eclipse.org/legal/epl-2.0. - - This Source Code may also be made available under the following Secondary - Licenses when the conditions for such availability set forth in the - Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - version 2 with the GNU Classpath Exception, which is available at - https://www.gnu.org/software/classpath/license.html. - - SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - ---> - -<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop - http://www.springframework.org/schema/aop/spring-aop.xsd"> - - <!--<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>--> - <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"> - <property name="autowiredAnnotationTypes"> - <set> - <value>org.springframework.beans.factory.annotation.Autowired</value> - <value>org.springframework.beans.factory.annotation.Value</value> - </set> - </property> - </bean> - - <!-- Needed since Spring Context 4, was default in Spring Context 3 --> - <bean id="customAutowireConfigurer" class="org.springframework.beans.factory.annotation.CustomAutowireConfigurer"> - <property name="customQualifierTypes"> - <set> - <value>org.springframework.beans.factory.annotation.Qualifier</value> - </set> - </property> - </bean> - - <bean name="AccountService-singleton" class="org.glassfish.jersey.server.spring.test.AccountServiceImpl" /> - - <bean name="AccountService-request-1" class="org.glassfish.jersey.server.spring.test.AccountServiceImpl" scope="request"> - <aop:scoped-proxy/> - </bean> - - <bean name="AccountService-request-2" class="org.glassfish.jersey.server.spring.test.AccountServiceImpl" scope="request"/> - - <bean name="AccountService-prototype-1" class="org.glassfish.jersey.server.spring.test.AccountServiceImpl" scope="prototype"> - <property name="defaultAccountBalance" value="987.65"/> - </bean> - - <bean name="AccountService-prototype-2" class="org.glassfish.jersey.server.spring.test.AccountServiceImpl" scope="prototype"/> - - <!-- Spring managed JAX-RS resources --> - <bean class="org.glassfish.jersey.server.spring.test.AccountSpringResource"/> - - <bean class="org.glassfish.jersey.server.spring.test.ServiceResource"/> - - <bean class="org.glassfish.jersey.server.spring.test.ControllerResource"/> - - <bean class="org.glassfish.jersey.server.spring.test.RepositoryResource"/> - - <bean class="org.glassfish.jersey.server.spring.test.EndpointResource"/> - -</beans>
diff --git a/tests/integration/spring5/src/main/webapp/WEB-INF/web.xml b/tests/integration/spring5/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 4004dd3..0000000 --- a/tests/integration/spring5/src/main/webapp/WEB-INF/web.xml +++ /dev/null
@@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v. 2.0, which is available at - http://www.eclipse.org/legal/epl-2.0. - - This Source Code may also be made available under the following Secondary - Licenses when the conditions for such availability set forth in the - Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - version 2 with the GNU Classpath Exception, which is available at - https://www.gnu.org/software/classpath/license.html. - - SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - ---> - -<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> - - <module-name>jersey-spring-test</module-name> - - <!-- use this to explicitly configure Spring --> - <!-- - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - <listener> - <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> - </listener> - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>classpath:/applicationContext.xml</param-value> - </context-param> - --> - - <servlet> - <servlet-name>org.glassfish.jersey.server.spring.test.MyApplication</servlet-name> - </servlet> - <servlet-mapping> - <servlet-name>org.glassfish.jersey.server.spring.test.MyApplication</servlet-name> - <url-pattern>/*</url-pattern> - </servlet-mapping> - - -</web-app> -
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java deleted file mode 100644 index 77f2984..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java +++ /dev/null
@@ -1,47 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.core.Application; - -import org.glassfish.jersey.test.external.ExternalTestContainerFactory; -import org.glassfish.jersey.test.spi.TestContainerException; -import org.glassfish.jersey.test.spi.TestContainerFactory; -import org.glassfish.jersey.test.JerseyTest; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class AccountResourceITCase extends JerseyTest { - - @Override - protected Application configure() { - return new Application(); - } - - @Override - protected TestContainerFactory getTestContainerFactory() throws TestContainerException { - return new ExternalTestContainerFactory(); - } - - @Test - public void testGet() throws Exception { - final String r = target().path("/jersey/account/message").request().get(String.class); - assertEquals(r, "n/a"); - } -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java deleted file mode 100644 index 5cc9fc7..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java +++ /dev/null
@@ -1,83 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import java.math.BigDecimal; - -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.WebTarget; -import jakarta.ws.rs.core.MediaType; - -import org.junit.Test; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; - -/** - * Base class for JAX-RS resource tests. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public abstract class AccountResourceTestBase extends ResourceTestBase { - - // test singleton scoped Spring bean injection using @Inject + @Autowired - @Test - public void testSingletonScopedSpringService() { - final BigDecimal newBalance = new BigDecimal(Math.random()); - final WebTarget t = target(getResourceFullPath()); - - t.path("/singleton/xyz123").request().put(Entity.entity(newBalance.toString(), MediaType.TEXT_PLAIN_TYPE)); - final BigDecimal balance = t.path("/singleton/autowired/xyz123").request().get(BigDecimal.class); - assertEquals(newBalance, balance); - } - - @Test - public void testRequestScopedSpringService() { - final BigDecimal newBalance = new BigDecimal(Math.random()); - final WebTarget t = target(getResourceFullPath()); - final BigDecimal balance = t.path("request/abc456").request().put(Entity.text(newBalance), BigDecimal.class); - assertEquals(newBalance, balance); - } - - @Test - public void testPrototypeScopedSpringService() { - final BigDecimal newBalance = new BigDecimal(Math.random()); - final WebTarget t = target(getResourceFullPath()); - final BigDecimal balance = t.path("prototype/abc456").request().put(Entity.text(newBalance), BigDecimal.class); - assertEquals(new BigDecimal("987.65"), balance); - } - - @Test - public void testServletInjection() { - final WebTarget t = target(getResourceFullPath()); - - String server = t.path("server").request().get(String.class); - assertThat(server, startsWith("PASSED: ")); - - server = t.path("singleton/server").request().get(String.class); - assertThat(server, startsWith("PASSED: ")); - - server = t.path("singleton/autowired/server").request().get(String.class); - assertThat(server, startsWith("PASSED: ")); - - server = t.path("request/server").request().get(String.class); - assertThat(server, startsWith("PASSED: ")); - - server = t.path("prototype/server").request().get(String.class); - assertThat(server, startsWith("PASSED: ")); - } -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java deleted file mode 100644 index fa3d1a2..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java +++ /dev/null
@@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.WebTarget; - -import org.glassfish.jersey.server.ResourceConfig; - -import org.junit.Test; -import static org.junit.Assert.assertEquals; - -/** - * Tests for Jersey managed JAX-RS resources. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class JerseyManagedITCase extends AccountResourceTestBase { - - @Override - protected ResourceConfig configure(final ResourceConfig rc) { - return rc.register(AccountJerseyResource.class); - } - - @Override - protected String getResourcePath() { - return "/jersey/account"; - } - - @Test - public void testResourceScope() { - final WebTarget t = target(getResourceFullPath()); - final String message = "hello, world"; - final String echo = t.path("message").request().put(Entity.text(message), String.class); - assertEquals(message, echo); - final String msg = t.path("message").request().get(String.class); - assertEquals("n/a", msg); - } - -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java deleted file mode 100644 index 08c4902..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java +++ /dev/null
@@ -1,67 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.core.Application; - -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.spring.SpringLifecycleListener; -import org.glassfish.jersey.server.spring.scope.RequestContextFilter; -import org.glassfish.jersey.test.JerseyTest; -import org.glassfish.jersey.test.TestProperties; -import org.glassfish.jersey.test.external.ExternalTestContainerFactory; -import org.glassfish.jersey.test.spi.TestContainerException; -import org.glassfish.jersey.test.spi.TestContainerFactory; - -/** - * Base class for JAX-RS resource tests. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public abstract class ResourceTestBase extends JerseyTest { - - private static final String TEST_WEBAPP_CONTEXT_PATH = "jersey.spring.test.contextPath"; - private static final String TEST_CONTAINER_FACTORY_EXTERNAL = "org.glassfish.jersey.test.external" - + ".ExternalTestContainerFactory"; - - @Override - protected TestContainerFactory getTestContainerFactory() throws TestContainerException { - return new ExternalTestContainerFactory(); - } - - @Override - protected Application configure() { - final ResourceConfig rc = new ResourceConfig() - .register(SpringLifecycleListener.class) - .register(RequestContextFilter.class); - TestUtil.registerHK2Services(rc); - rc.property("contextConfigLocation", "classpath:applicationContext.xml"); - return configure(rc); - } - - protected abstract ResourceConfig configure(ResourceConfig rc); - - protected abstract String getResourcePath(); - - protected String getResourceFullPath() { - final String containerFactory = System.getProperty(TestProperties.CONTAINER_FACTORY); - if (TEST_CONTAINER_FACTORY_EXTERNAL.equals(containerFactory)) { - return System.getProperty(TEST_WEBAPP_CONTEXT_PATH) + getResourcePath(); - } - return getResourcePath(); - } -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java deleted file mode 100644 index 9b24994..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java +++ /dev/null
@@ -1,53 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.WebTarget; - -import org.glassfish.jersey.server.ResourceConfig; - -import org.junit.Test; -import static org.junit.Assert.assertEquals; - -/** - * Tests for Spring managed JAX-RS resources with @Controller archetype. - * - * @author Konrad Garus (konrad.garus at gmail.com) - */ -public class SpringManagedControllerITCase extends ResourceTestBase { - - @Override - protected ResourceConfig configure(final ResourceConfig rc) { - return rc.register(ControllerResource.class); - } - - @Override - protected String getResourcePath() { - return "/spring/controller"; - } - - @Test - public void testResourceScope() { - final WebTarget t = target(getResourceFullPath()); - final String message = "hello, world"; - final String echo = t.path("message").request().put(Entity.text(message), String.class); - assertEquals(message, echo); - final String msg = t.path("message").request().get(String.class); - assertEquals(message, msg); - } -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java deleted file mode 100644 index 79ade92..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java +++ /dev/null
@@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.WebTarget; - -import org.glassfish.jersey.server.ResourceConfig; - -import org.junit.Test; -import static org.junit.Assert.assertEquals; - -/** - * Tests for Spring managed JAX-RS resources with custom composite - * annotation that derives from @Component. - * - * @author Konrad Garus (konrad.garus at gmail.com) - */ -public class SpringManagedEndpointITCase extends ResourceTestBase { - - @Override - protected ResourceConfig configure(final ResourceConfig rc) { - return rc.register(EndpointResource.class); - } - - @Override - protected String getResourcePath() { - return "/spring/endpoint"; - } - - @Test - public void testResourceScope() { - final WebTarget t = target(getResourceFullPath()); - final String message = "hello, world"; - final String echo = t.path("message").request().put(Entity.text(message), String.class); - assertEquals(message, echo); - final String msg = t.path("message").request().get(String.class); - assertEquals(message, msg); - } -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java deleted file mode 100644 index 2b351f0..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java +++ /dev/null
@@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.WebTarget; - -import org.glassfish.jersey.server.ResourceConfig; - -import org.junit.Test; -import static org.junit.Assert.assertEquals; - -/** - * Tests for Spring managed JAX-RS resources. - * - * @author Marko Asplund (marko.asplund at yahoo.com) - */ -public class SpringManagedITCase extends AccountResourceTestBase { - - @Override - protected ResourceConfig configure(final ResourceConfig rc) { - return rc.register(AccountSpringResource.class); - } - - @Override - protected String getResourcePath() { - return "/spring/account"; - } - - @Test - public void testResourceScope() { - final WebTarget t = target(getResourceFullPath()); - final String message = "hello, world"; - final String echo = t.path("message").request().put(Entity.text(message), String.class); - assertEquals(message, echo); - final String msg = t.path("message").request().get(String.class); - assertEquals(message, msg); - } - -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java deleted file mode 100644 index 0bfcd04..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java +++ /dev/null
@@ -1,53 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.WebTarget; - -import org.glassfish.jersey.server.ResourceConfig; - -import org.junit.Test; -import static org.junit.Assert.assertEquals; - -/** - * Tests for Spring managed JAX-RS resources with @Repository archetype. - * - * @author Konrad Garus (konrad.garus at gmail.com) - */ -public class SpringManagedRepositoryITCase extends ResourceTestBase { - - @Override - protected ResourceConfig configure(final ResourceConfig rc) { - return rc.register(RepositoryResource.class); - } - - @Override - protected String getResourcePath() { - return "/spring/repository"; - } - - @Test - public void testResourceScope() { - final WebTarget t = target(getResourceFullPath()); - final String message = "hello, world"; - final String echo = t.path("message").request().put(Entity.text(message), String.class); - assertEquals(message, echo); - final String msg = t.path("message").request().get(String.class); - assertEquals(message, msg); - } -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java deleted file mode 100644 index fd31b99..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java +++ /dev/null
@@ -1,53 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.WebTarget; - -import org.glassfish.jersey.server.ResourceConfig; - -import org.junit.Test; -import static org.junit.Assert.assertEquals; - -/** - * Tests for Spring managed JAX-RS resources with @Service archetype. - * - * @author Konrad Garus (konrad.garus at gmail.com) - */ -public class SpringManagedServiceITCase extends ResourceTestBase { - - @Override - protected ResourceConfig configure(final ResourceConfig rc) { - return rc.register(ServiceResource.class); - } - - @Override - protected String getResourcePath() { - return "/spring/service"; - } - - @Test - public void testResourceScope() { - final WebTarget t = target(getResourceFullPath()); - final String message = "hello, world"; - final String echo = t.path("message").request().put(Entity.text(message), String.class); - assertEquals(message, echo); - final String msg = t.path("message").request().get(String.class); - assertEquals(message, msg); - } -}
diff --git a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java b/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java deleted file mode 100644 index 8c837c8..0000000 --- a/tests/integration/spring5/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java +++ /dev/null
@@ -1,52 +0,0 @@ -/* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0, which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * This Source Code may also be made available under the following Secondary - * Licenses when the conditions for such availability set forth in the - * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, - * version 2 with the GNU Classpath Exception, which is available at - * https://www.gnu.org/software/classpath/license.html. - * - * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - */ - -package org.glassfish.jersey.server.spring.test; - -import jakarta.inject.Singleton; - -import org.glassfish.jersey.internal.inject.PerLookup; -import org.glassfish.jersey.process.internal.RequestScoped; -import org.glassfish.jersey.server.ResourceConfig; - -import org.glassfish.hk2.utilities.BuilderHelper; -import org.glassfish.hk2.utilities.binding.AbstractBinder; - -class TestUtil { - - public static ResourceConfig registerHK2Services(final ResourceConfig rc) { - rc - .register(new AbstractBinder() { - @Override - protected void configure() { - bind(BuilderHelper.link(HK2ServiceSingleton.class).in(Singleton.class).build()); - } - }) - .register(new AbstractBinder() { - @Override - protected void configure() { - bind(BuilderHelper.link(HK2ServiceRequestScoped.class).in(RequestScoped.class).build()); - } - }) - .register(new AbstractBinder() { - @Override - protected void configure() { - bind(BuilderHelper.link(HK2ServicePerLookup.class).in(PerLookup.class).build()); - } - }); - return rc; - } -}
diff --git a/tests/integration/spring4/README.txt b/tests/integration/spring6/README.txt similarity index 100% rename from tests/integration/spring4/README.txt rename to tests/integration/spring6/README.txt
diff --git a/tests/integration/spring5/pom.xml b/tests/integration/spring6/pom.xml similarity index 73% rename from tests/integration/spring5/pom.xml rename to tests/integration/spring6/pom.xml index 7a07120..e7df36c 100644 --- a/tests/integration/spring5/pom.xml +++ b/tests/integration/spring6/pom.xml
@@ -25,24 +25,32 @@ <parent> <groupId>org.glassfish.jersey.tests.integration</groupId> <artifactId>project</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.1.0-SNAPSHOT</version> </parent> - <artifactId>spring5</artifactId> + <artifactId>spring6</artifactId> <packaging>war</packaging> - <name>jersey-tests-integration-spring5</name> + <name>jersey-tests-integration-spring6</name> <description> - Jersey tests for Spring 5 integration + Jersey tests for Spring 6 integration </description> + <repositories> + <repository> + <name>Spring Repository</name> + <id>spring-repository</id> + <url>https://repo.spring.io/milestone</url> + </repository> + </repositories> + <dependencies> <dependency> <groupId>jakarta.servlet</groupId> <artifactId>jakarta.servlet-api</artifactId> - <version>${servlet4.version}</version> + <version>${servlet5.version}</version> <scope>provided</scope> </dependency> @@ -54,12 +62,42 @@ <dependency> <groupId>org.glassfish.jersey.ext</groupId> - <artifactId>jersey-spring5</artifactId> + <artifactId>jersey-spring6</artifactId> <version>${project.version}</version> <scope>compile</scope> </dependency> <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring6.version}</version> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring6.version}</version> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring6.version}</version> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + <version>${spring6.version}</version> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring6.version}</version> + </dependency> + + <dependency> <groupId>org.glassfish.jersey.test-framework</groupId> <artifactId>jersey-test-framework-core</artifactId> <scope>test</scope> @@ -93,16 +131,11 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> - <!-- TODO remove after jakartification --> - <configuration> - <excludes> <!--JDK 11 --> - <exclude>**/**/*.java</exclude> - </excludes> - </configuration> </plugin> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> + <version>11.0.7</version> <configuration> <webApp> <contextPath>/</contextPath>
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java similarity index 98% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java index bd10b50..ab54e71 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountJerseyResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java similarity index 94% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java index 851e215..2a764dc 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountService.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java similarity index 96% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java index e79d9bd..58919af 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountServiceImpl.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java similarity index 98% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java index 0e5d2cf..e6e8e43 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/AccountSpringResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java similarity index 95% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java index 39dd5aa..8cf0a7e 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/ControllerResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java similarity index 94% rename from tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java index 80f5d8c..53a9ef1 100644 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/Endpoint.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java similarity index 95% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java index d61ef3b..a1d8682 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/EndpointResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java similarity index 92% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java index ff689c6..0fb4f76 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServicePerLookup.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java similarity index 92% rename from tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java index 3bde89d..f55662a 100644 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceRequestScoped.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java similarity index 92% rename from tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java index 424f186..64ea0ba 100644 --- a/tests/integration/spring5/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/HK2ServiceSingleton.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java similarity index 96% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java index b0f82c7..e0f0c99 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/MyApplication.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java similarity index 95% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java index b815fe0..52a8b64 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/RepositoryResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java similarity index 95% rename from tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java rename to tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java index d50e5a6..75cf5af 100644 --- a/tests/integration/spring4/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java +++ b/tests/integration/spring6/src/main/java/org/glassfish/jersey/server/spring/test/ServiceResource.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/resources/applicationContext.xml b/tests/integration/spring6/src/main/resources/applicationContext.xml similarity index 97% rename from tests/integration/spring4/src/main/resources/applicationContext.xml rename to tests/integration/spring6/src/main/resources/applicationContext.xml index c7e421e..c36223c 100644 --- a/tests/integration/spring4/src/main/resources/applicationContext.xml +++ b/tests/integration/spring6/src/main/resources/applicationContext.xml
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/main/webapp/WEB-INF/web.xml b/tests/integration/spring6/src/main/webapp/WEB-INF/web.xml similarity index 96% rename from tests/integration/spring4/src/main/webapp/WEB-INF/web.xml rename to tests/integration/spring6/src/main/webapp/WEB-INF/web.xml index c3cff9d..1710d82 100644 --- a/tests/integration/spring4/src/main/webapp/WEB-INF/web.xml +++ b/tests/integration/spring6/src/main/webapp/WEB-INF/web.xml
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java similarity index 95% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java index 77f2984..a17f3ee 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceITCase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java similarity index 97% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java index 5cc9fc7..301e155 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/AccountResourceTestBase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java similarity index 96% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java index fa3d1a2..241f450 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/JerseyManagedITCase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java similarity index 97% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java index 08c4902..bab4d70 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/ResourceTestBase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java similarity index 96% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java index 9b24994..f2847ff 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedControllerITCase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java similarity index 96% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java index 79ade92..5a316ec 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedEndpointITCase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java similarity index 96% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java index 2b351f0..8046675 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedITCase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java similarity index 96% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java index 0bfcd04..0fa4a22 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedRepositoryITCase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java similarity index 96% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java index fd31b99..36a602c 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/SpringManagedServiceITCase.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java similarity index 96% rename from tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java rename to tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java index 8c837c8..1961242 100644 --- a/tests/integration/spring4/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java +++ b/tests/integration/spring6/src/test/java/org/glassfish/jersey/server/spring/test/TestUtil.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at