cd-inject-weld module-info Signed-off-by: jansupol <jan.supol@oracle.com>
diff --git a/core-client/src/main/java/module-info.java b/core-client/src/main/java/module-info.java index 1174c16..ee94e3a 100644 --- a/core-client/src/main/java/module-info.java +++ b/core-client/src/main/java/module-info.java
@@ -30,6 +30,7 @@ exports org.glassfish.jersey.client.inject; exports org.glassfish.jersey.client.spi; exports org.glassfish.jersey.client.internal; + exports org.glassfish.jersey.client.internal.inject to org.glassfish.jersey.incubator.cdi.inject.weld; exports org.glassfish.jersey.client.innate to org.glassfish.jersey.apache5.connector,
diff --git a/core-common/src/main/java/module-info.java b/core-common/src/main/java/module-info.java index 96d99e1..5020acd 100644 --- a/core-common/src/main/java/module-info.java +++ b/core-common/src/main/java/module-info.java
@@ -61,7 +61,8 @@ org.glassfish.jersey.container.servlet, org.glassfish.jersey.container.jetty.http, org.glassfish.jersey.netty.connector, - org.glassfish.jersey.ext.mp.rest.client; + org.glassfish.jersey.ext.mp.rest.client, + org.glassfish.jersey.incubator.cdi.inject.weld; exports org.glassfish.jersey.innate.inject to org.glassfish.jersey.inject.hk2, org.glassfish.jersey.inject.cdi2.se, @@ -80,6 +81,7 @@ org.glassfish.jersey.ext.entity.filtering, org.glassfish.jersey.ext.metainf.services, org.glassfish.jersey.ext.mvc, + org.glassfish.jersey.incubator.cdi.inject.weld, org.glassfish.jersey.gf.ejb, org.glassfish.jersey.security.oauth1.signature; exports org.glassfish.jersey.innate.virtual to org.glassfish.jersey.container.grizzly2.http, @@ -104,6 +106,7 @@ opens org.glassfish.jersey.innate.spi to org.glassfish.jersey.media.multipart; opens org.glassfish.jersey.internal; + opens org.glassfish.jersey.internal.util.collection; opens org.glassfish.jersey.message.internal; opens org.glassfish.jersey.spi; @@ -111,7 +114,6 @@ uses jakarta.ws.rs.container.DynamicFeature; uses jakarta.ws.rs.ext.RuntimeDelegate; - uses org.glassfish.jersey.innate.BootstrapPreinitialization; uses org.glassfish.jersey.innate.spi.EntityPartBuilderProvider; uses org.glassfish.jersey.internal.ServiceFinder; uses org.glassfish.jersey.internal.inject.InjectionManagerFactory;
diff --git a/core-server/src/main/java/module-info.java b/core-server/src/main/java/module-info.java index 187c595..de75462 100644 --- a/core-server/src/main/java/module-info.java +++ b/core-server/src/main/java/module-info.java
@@ -47,7 +47,10 @@ exports org.glassfish.jersey.server.wadl.internal.generators.resourcedoc; exports org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model; exports org.glassfish.jersey.server.filter; - exports org.glassfish.jersey.server.filter.internal to org.glassfish.hk2.locator, org.glassfish.hk2.utilities; + exports org.glassfish.jersey.server.filter.internal to + org.glassfish.hk2.locator, + org.glassfish.hk2.utilities, + org.glassfish.jersey.incubator.cdi.inject.weld; exports org.glassfish.jersey.server.monitoring; exports org.glassfish.jersey.server.internal; @@ -76,11 +79,18 @@ opens org.glassfish.jersey.server; opens org.glassfish.jersey.server.filter; - opens org.glassfish.jersey.server.internal to org.glassfish.hk2.utilities; + opens org.glassfish.jersey.server.filter.internal to + org.glassfish.hk2.locator, + org.glassfish.hk2.utilities, + weld.core.impl; + opens org.glassfish.jersey.server.internal to org.glassfish.hk2.utilities, weld.core.impl; opens org.glassfish.jersey.server.internal.inject; opens org.glassfish.jersey.server.internal.monitoring to org.glassfish.hk2.utilities; opens org.glassfish.jersey.server.internal.monitoring.jmx to org.glassfish.hk2.utilities; - opens org.glassfish.jersey.server.internal.process to org.glassfish.hk2.locator, org.glassfish.hk2.utilities; + opens org.glassfish.jersey.server.internal.process to + org.glassfish.hk2.locator, + org.glassfish.hk2.utilities, + weld.core.impl; opens org.glassfish.jersey.server.internal.routing to org.glassfish.hk2.utilities; opens org.glassfish.jersey.server.model; opens org.glassfish.jersey.server.wadl.processor;
diff --git a/incubator/cdi-inject-weld/pom.xml b/incubator/cdi-inject-weld/pom.xml index 2a68ef1..e9123c8 100644 --- a/incubator/cdi-inject-weld/pom.xml +++ b/incubator/cdi-inject-weld/pom.xml
@@ -32,6 +32,16 @@ <description>CDI InjectionManager implementation</description> + <properties> + <!-- test packages --> + <surefire.security.argline> + --add-exports org.glassfish.jersey.incubator.cdi.inject.weld/org.glassfish.jersey.inject.weld.binder.client=org.glassfish.jersey.core.common + --add-exports org.glassfish.jersey.incubator.cdi.inject.weld/org.glassfish.jersey.inject.weld.binder.client=weld.core.impl + --add-exports org.glassfish.jersey.incubator.cdi.inject.weld/org.glassfish.jersey.inject.weld=weld.core.impl + --add-opens org.glassfish.jersey.incubator.cdi.inject.weld/org.glassfish.jersey.inject.weld.binder.client=weld.core.impl + </surefire.security.argline> + </properties> + <dependencies> <dependency> <groupId>org.glassfish.jersey.core</groupId> @@ -73,7 +83,7 @@ <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-grizzly2-http</artifactId> <version>${project.version}</version> - <scope>provided</scope> + <scope>test</scope> </dependency> <dependency> @@ -82,11 +92,27 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>org.jboss.weld.se</groupId> - <artifactId>weld-se-core</artifactId> + <groupId>org.jboss.weld</groupId> + <artifactId>weld-api</artifactId> <scope>provided</scope> </dependency> - + <dependency> + <groupId>org.jboss.weld</groupId> + <artifactId>weld-spi</artifactId> + <version>${weld.api.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.jboss.weld</groupId> + <artifactId>weld-core-impl</artifactId> + <version>${weld.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.jboss.weld.se</groupId> + <artifactId>weld-se-core</artifactId> + <scope>test</scope> + </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> @@ -140,7 +166,6 @@ org.glassfish.jersey.inject.weld.managed.*;version=${project.version} </Export-Package> <Import-Package> - jakarta.servlet.*;version="[6.0,7.0)", sun.misc.*;resolution:=optional, ${jakarta.annotation.osgi.version}, ${cdi.osgi.version},
diff --git a/incubator/cdi-inject-weld/src/main/java/module-info.java b/incubator/cdi-inject-weld/src/main/java/module-info.java new file mode 100644 index 0000000..3bbb797 --- /dev/null +++ b/incubator/cdi-inject-weld/src/main/java/module-info.java
@@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022, 2025 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 + */ + +module org.glassfish.jersey.incubator.cdi.inject.weld { + requires jakarta.annotation; + requires jakarta.cdi; + requires jakarta.inject; + requires jakarta.interceptor; + requires jakarta.ws.rs; + + requires java.logging; + + requires weld.api; + requires weld.core.impl; + requires weld.spi; + + requires org.glassfish.jersey.core.common; + requires org.glassfish.jersey.core.client; + requires org.glassfish.jersey.core.server; + + exports org.glassfish.jersey.inject.weld.internal.managed to + org.glassfish.jersey.core.common, + weld.core.impl; + exports org.glassfish.jersey.inject.weld.managed to org.glassfish.jersey.core.common; + + opens org.glassfish.jersey.inject.weld.internal.managed to weld.core.impl; + opens org.glassfish.jersey.inject.weld.internal.scope to weld.core.impl; + opens org.glassfish.jersey.inject.weld.managed to weld.core.impl; + opens org.glassfish.jersey.inject.weld.internal.injector to weld.core.impl; + + uses org.glassfish.jersey.innate.BootstrapPreinitialization; + + provides jakarta.enterprise.inject.spi.Extension with + org.glassfish.jersey.inject.weld.internal.managed.BinderRegisterExtension; + + provides org.glassfish.jersey.internal.inject.InjectionManagerFactory with + org.glassfish.jersey.inject.weld.managed.CdiInjectionManagerFactory; +} \ No newline at end of file
diff --git a/incubator/cdi-inject-weld/src/main/java/module-info.txt b/incubator/cdi-inject-weld/src/main/java/module-info.txt deleted file mode 100644 index 136324d..0000000 --- a/incubator/cdi-inject-weld/src/main/java/module-info.txt +++ /dev/null
@@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022, 2025 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 - */ - -module org.glassfish.jersey.incubator.cdi.inject.weld { - requires jakarta.annotation; - requires jakarta.cdi; - requires jakarta.inject; - requires jakarta.interceptor; - requires jakarta.servlet; -// requires jakarta.persistence; - requires jakarta.ws.rs; - - requires java.logging; - - requires weld.api; - requires weld.spi; - requires weld.core.impl; - requires weld.se.core; - requires weld.probe.core; - requires org.glassfish.grizzly.http.server; - - requires org.glassfish.jersey.core.common; - requires org.glassfish.jersey.core.client; - requires org.glassfish.jersey.core.server; - requires org.glassfish.jersey.container.servlet; - - opens org.glassfish.jersey.inject.weld.internal.data; - opens org.glassfish.jersey.inject.weld.internal.bean; - opens org.glassfish.jersey.inject.weld.internal.inject; - opens org.glassfish.jersey.inject.weld.internal.managed; - opens org.glassfish.jersey.inject.weld.internal.scope; - opens org.glassfish.jersey.inject.weld.internal.type; - opens org.glassfish.jersey.inject.weld.spi; - opens org.glassfish.jersey.inject.weld.managed; - - exports org.glassfish.jersey.inject.weld.internal.data; - exports org.glassfish.jersey.inject.weld.internal.bean; - exports org.glassfish.jersey.inject.weld.internal.inject; - exports org.glassfish.jersey.inject.weld.internal.managed; - exports org.glassfish.jersey.inject.weld.internal.scope; - exports org.glassfish.jersey.inject.weld.internal.type; - exports org.glassfish.jersey.inject.weld.spi; - exports org.glassfish.jersey.inject.weld.managed; -} \ No newline at end of file
diff --git a/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/bean/JerseyBean.java b/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/bean/JerseyBean.java index deaa049..1d9a9e3 100644 --- a/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/bean/JerseyBean.java +++ b/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/bean/JerseyBean.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 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 @@ -41,7 +41,7 @@ import org.glassfish.jersey.internal.inject.PerLookup; import org.glassfish.jersey.internal.inject.PerThread; -import org.jboss.weld.environment.se.contexts.ThreadScoped; +//import org.jboss.weld.environment.se.contexts.ThreadScoped; /** * Jersey-specific abstract class which implements {@link Bean} interface. Class particularly contains default implementations @@ -88,7 +88,7 @@ if (scope == PerLookup.class) { return Dependent.class; } else if (scope == PerThread.class) { - return ThreadScoped.class; + return RequestScoped.class; // ThreadScoped.class; } else if (scope == org.glassfish.jersey.process.internal.RequestScoped.class) { return RequestScoped.class; }
diff --git a/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/injector/JerseyInjectionTarget.java b/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/injector/JerseyInjectionTarget.java index be93ad6..94fd307 100644 --- a/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/injector/JerseyInjectionTarget.java +++ b/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/injector/JerseyInjectionTarget.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -19,8 +19,10 @@ import java.lang.reflect.Modifier; import java.util.Collection; import java.util.List; +import java.util.logging.Logger; import jakarta.enterprise.context.Dependent; +import jakarta.enterprise.inject.spi.DeploymentException; import jakarta.ws.rs.WebApplicationException; import jakarta.enterprise.context.spi.CreationalContext; @@ -32,9 +34,9 @@ import org.glassfish.jersey.inject.weld.internal.bean.BeanHelper; import org.glassfish.jersey.inject.weld.internal.bean.JerseyBean; +import org.glassfish.jersey.inject.weld.internal.l10n.LocalizationMessages; import org.glassfish.jersey.inject.weld.managed.CdiInjectionManagerFactory; import org.glassfish.jersey.internal.inject.InjectionManager; -import org.glassfish.jersey.internal.inject.InjectionManagerFactory; import org.glassfish.jersey.internal.inject.InjectionResolver; import org.glassfish.jersey.internal.util.collection.LazyValue; import org.glassfish.jersey.internal.util.collection.Value; @@ -56,7 +58,6 @@ import org.jboss.weld.injection.producer.SubclassDecoratorApplyingInstantiator; import org.jboss.weld.injection.producer.SubclassedComponentInstantiator; import org.jboss.weld.interceptor.spi.model.InterceptionModel; -import org.jboss.weld.logging.BeanLogger; import org.jboss.weld.resources.ClassTransformer; import org.jboss.weld.util.reflection.Formats; @@ -70,6 +71,8 @@ */ public class JerseyInjectionTarget<T> extends BasicInjectionTarget<T> { + private static final Logger LOGGER = Logger.getLogger(JerseyInjectionTarget.class.getName()); + private final Bean<T> bean; private final Class<T> clazz; private final LazyValue<JerseyInstanceInjector<T>> injector; @@ -78,6 +81,7 @@ private BasicInjectionTarget delegate; // for managed beans the initializeAfterBeanDiscovery is called for it private final Instantiator<T> instantiator; + /** * Creates a new injection target which is able to delegate an injection to {@code delegate injection target} and inject * the fields that are Jersey-specific. The resolvers must be set later on. CDI will select its own constructor. @@ -156,8 +160,7 @@ } catch (WebApplicationException wae) { throw wae; } catch (Throwable cause) { - throw new InjectionException( - "Exception occurred during Jersey/JAX-RS annotations processing in the class: " + clazz, cause); + throw injectionException(LocalizationMessages.IT_PROCESSING_ANNOTATION_EXCEPTION(clazz.getName()), cause); } /* @@ -194,7 +197,7 @@ if (hasNonConstructorInterceptors || hasDecorators) { if (!(getInstantiator() instanceof DefaultInstantiator<?>)) { - throw new IllegalStateException("Unexpected instantiator " + getInstantiator()); + throw illegalStateException(LocalizationMessages.IT_UNEXPECTED_INSTANTIATOR(getInstantiator())); } /* @@ -232,16 +235,16 @@ } EnhancedAnnotatedConstructor<T> constructor = type.getNoArgsEnhancedConstructor(); if (constructor == null) { - throw BeanLogger.LOG.decoratedHasNoNoargsConstructor(this); + throw deploymentException(LocalizationMessages.IT_DECORATED_HAS_NO_NOARGS_CONSTRUCTOR(type)); } else if (constructor.isPrivate()) { - throw BeanLogger.LOG - .decoratedNoargsConstructorIsPrivate(this, Formats.formatAsStackTraceElement(constructor.getJavaMember())); + String stackTraceElement = Formats.formatAsStackTraceElement(constructor.getJavaMember()); + throw deploymentException(LocalizationMessages.IT_DECORATED_NOARGS_CONSTRUCTOR_PRIVATE(type, stackTraceElement)); } } private void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) { if (type.isFinal()) { - throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this); + throw deploymentException(LocalizationMessages.IT_FINAL_BEAN_CLASS_WITH_DECORATORS_NOT_ALLOWED(type)); } checkNoArgsConstructor(type); for (Decorator<?> decorator : decorators) { @@ -253,13 +256,13 @@ } else if (decorator instanceof CustomDecoratorWrapper<?>) { decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated(); } else { - throw BeanLogger.LOG.nonContainerDecorator(decorator); + throw illegalStateException(LocalizationMessages.IT_NON_CONTAINER_DECORATOR(decorator)); } for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) { EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature()); if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) { - throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this); + throw deploymentException(LocalizationMessages.IT_FINAL_BEAN_CLASS_WITH_INTERCEPTORS_NOT_ALLOWED(type)); } } } @@ -292,6 +295,21 @@ return !isInterceptor() && !isDecorator() && !Modifier.isAbstract(getType().getJavaClass().getModifiers()); } + private static IllegalStateException illegalStateException(String message) { + LOGGER.warning(message); + return new IllegalStateException(message); + } + + private static DeploymentException deploymentException(String message) { + LOGGER.warning(message); + return new DeploymentException(message); + } + + private static InjectionException injectionException(String message, Throwable cause) { + LOGGER.warning(message); + return new InjectionException(message, cause); + } + @Override public T produce(CreationalContext<T> ctx) { T instance;
diff --git a/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/managed/BinderRegisterExtension.java b/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/managed/BinderRegisterExtension.java index a8692e4..505bd73 100644 --- a/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/managed/BinderRegisterExtension.java +++ b/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/managed/BinderRegisterExtension.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 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 @@ -33,6 +33,7 @@ import java.util.TreeMap; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; +import java.util.logging.Logger; import java.util.stream.Collectors; import jakarta.annotation.Priority; @@ -105,7 +106,9 @@ * CDI extension that handles CDI bootstrap events and registers Jersey's internally used components and components registered * using {@link Application}. */ -class BinderRegisterExtension implements Extension { +public class BinderRegisterExtension implements Extension { + + private static final Logger LOGGER = Logger.getLogger(BinderRegisterExtension.class.getName()); private final AtomicBoolean registrationDone = new AtomicBoolean(false); private Supplier<BeanManager> beanManagerSupplier; @@ -679,6 +682,7 @@ Constructor<T> constructor = createMe.getConstructor(); return constructor.newInstance(); } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { + LOGGER.warning(e.getMessage()); return null; } }
diff --git a/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/managed/CdiInjectionManager.java b/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/managed/CdiInjectionManager.java index c0a31f6..522533f 100644 --- a/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/managed/CdiInjectionManager.java +++ b/incubator/cdi-inject-weld/src/main/java/org/glassfish/jersey/inject/weld/internal/managed/CdiInjectionManager.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 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 @@ -44,6 +44,7 @@ import org.glassfish.jersey.inject.weld.internal.inject.InitializableSupplierInstanceBinding; import org.glassfish.jersey.inject.weld.internal.bean.JerseyBean; import org.glassfish.jersey.inject.weld.internal.inject.MatchableBinding; +import org.glassfish.jersey.inject.weld.internal.l10n.LocalizationMessages; import org.glassfish.jersey.inject.weld.managed.CdiInjectionManagerFactory; import org.glassfish.jersey.innate.inject.InternalBinding; import org.glassfish.jersey.innate.inject.Bindings;
diff --git a/incubator/cdi-inject-weld/src/main/resources/org/glassfish/jersey/inject/weld/internal/l10n/localization.properties b/incubator/cdi-inject-weld/src/main/resources/org/glassfish/jersey/inject/weld/internal/l10n/localization.properties new file mode 100644 index 0000000..47ea08c --- /dev/null +++ b/incubator/cdi-inject-weld/src/main/resources/org/glassfish/jersey/inject/weld/internal/l10n/localization.properties
@@ -0,0 +1,27 @@ +# +# Copyright (c) 2021, 2025 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 +# + +# {0} - full classname +cdi2.provider.not.registrable=Provider registered to CdiInjectionManager cannot be process because of incompatible type: {0}. +it.processing.annotation.exception=Exception occurred during Jersey/JAX-RS annotations processing in the class: {0}. +it.unexpected.instantiator=Unexpected instantiator {0}. +it.decorated.has.no.noargs.constructor=Bean class which has decorators must have a public constructor without parameters: {0} +it.decorated.noargs.constructor.private=Constructor without parameters cannot be private in bean class which has decorators: {0} at {1} StackTrace. +it.final.bean.class.with.decorators.not.allowed=Bean class which has decorators cannot be declared final: {0}. +it.non.container.decorator=Cannot operate on non container provided decorator {0}. +it.final.bean.class.with.interceptors.not.allowed=Bean class which has interceptors cannot be declared final: {0}. + +
diff --git a/incubator/cdi-inject-weld/src/main/resources/org/glassfish/jersey/inject/weld/internal/managed/localization.properties b/incubator/cdi-inject-weld/src/main/resources/org/glassfish/jersey/inject/weld/internal/managed/localization.properties deleted file mode 100644 index 8716ee6..0000000 --- a/incubator/cdi-inject-weld/src/main/resources/org/glassfish/jersey/inject/weld/internal/managed/localization.properties +++ /dev/null
@@ -1,18 +0,0 @@ -# -# Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0, which is available at -# http://www.eclipse.org/legal/epl-2.0. -# -# This Source Code may also be made available under the following Secondary -# Licenses when the conditions for such availability set forth in the -# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, -# version 2 with the GNU Classpath Exception, which is available at -# https://www.gnu.org/software/classpath/license.html. -# -# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 -# - -# {0} - full classname -cdi2.provider.not.registrable=Provider registered to CdiInjectionManager cannot be process because of incompatible type: {0}.
diff --git a/incubator/cdi-inject-weld/src/test/java/module-info.txt b/incubator/cdi-inject-weld/src/test/java/module-info.java.txt similarity index 69% rename from incubator/cdi-inject-weld/src/test/java/module-info.txt rename to incubator/cdi-inject-weld/src/test/java/module-info.java.txt index e9c2e19..b1b05eb 100644 --- a/incubator/cdi-inject-weld/src/test/java/module-info.txt +++ b/incubator/cdi-inject-weld/src/test/java/module-info.java.txt
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2025 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 @@ -14,18 +14,23 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -open module org.glassfish.jersey.incubator.cdi.inject.weld { +open module org.glassfish.jersey.incubator.cdi.inject.weld.test { requires jakarta.annotation; requires jakarta.cdi; + requires jakarta.cdi.el; + requires jakarta.el; requires jakarta.inject; requires jakarta.ws.rs; requires java.logging; - - requires junit; + requires org.jboss.logging; + requires org.junit.jupiter.api; requires org.glassfish.jersey.core.common; requires org.glassfish.jersey.core.client; requires org.glassfish.jersey.core.server; + requires org.glassfish.jersey.incubator.cdi.inject.weld; requires org.hamcrest; + + exports org.glassfish.jersey.inject.weld.binder.client to org.glassfish.jersey.core.common; } \ No newline at end of file
diff --git a/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/SingleArchiveDiscoveryStrategy.java b/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/SingleArchiveDiscoveryStrategy.java new file mode 100644 index 0000000..52e9d86 --- /dev/null +++ b/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/SingleArchiveDiscoveryStrategy.java
@@ -0,0 +1,53 @@ +/* + * Copyright (c) 2025 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.inject.weld; + +import org.jboss.weld.bootstrap.api.Bootstrap; +import org.jboss.weld.bootstrap.spi.BeanDiscoveryMode; +import org.jboss.weld.environment.deployment.WeldBeanDeploymentArchive; +import org.jboss.weld.environment.deployment.discovery.DiscoveryStrategy; +import org.jboss.weld.environment.deployment.discovery.ReflectionDiscoveryStrategy; +import org.jboss.weld.resources.spi.ResourceLoader; + +import java.lang.annotation.Annotation; +import java.util.Set; + +/** + * Prevent loading the archives multiple times, once from the classpath, once from the module path. + * Done by Thread.currentThread().getContextClassLoader().getResource("META-INF/beans.xml") + */ +public class SingleArchiveDiscoveryStrategy extends ReflectionDiscoveryStrategy implements DiscoveryStrategy { + + public SingleArchiveDiscoveryStrategy(){ + super(null, null, null, null); + } + + public SingleArchiveDiscoveryStrategy(ResourceLoader resourceLoader, + Bootstrap bootstrap, + Set<Class<? extends Annotation>> initialBeanDefiningAnnotations, + BeanDiscoveryMode emptyBeansXmlDiscoveryMode) { + super(resourceLoader, bootstrap, initialBeanDefiningAnnotations, emptyBeansXmlDiscoveryMode); + } + + @Override + public Set<WeldBeanDeploymentArchive> performDiscovery() { + if (scanner == null) { + scanner = new SingleArchiveScanner(resourceLoader, bootstrap, BeanDiscoveryMode.ANNOTATED); + } + return super.performDiscovery(); + } +}
diff --git a/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/SingleArchiveScanner.java b/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/SingleArchiveScanner.java new file mode 100644 index 0000000..29816a2 --- /dev/null +++ b/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/SingleArchiveScanner.java
@@ -0,0 +1,49 @@ +/* + * Copyright (c) 2025 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.inject.weld; + +import org.jboss.weld.bootstrap.api.Bootstrap; +import org.jboss.weld.bootstrap.spi.BeanDiscoveryMode; +import org.jboss.weld.environment.deployment.discovery.DefaultBeanArchiveScanner; +import org.jboss.weld.resources.spi.ResourceLoader; + +import java.util.HashSet; +import java.util.List; +import java.util.Locale; + +class SingleArchiveScanner extends DefaultBeanArchiveScanner { + /** + * + * @param resourceLoader + * @param bootstrap + * @param emptyBeansXmlDiscoveryMode + */ + public SingleArchiveScanner(ResourceLoader resourceLoader, + Bootstrap bootstrap, + BeanDiscoveryMode emptyBeansXmlDiscoveryMode) { + super(resourceLoader, bootstrap, emptyBeansXmlDiscoveryMode); + } + + @Override + public List<ScanResult> scan() { + HashSet<String> beanArchives = new HashSet<>(); + return super.scan().stream() + .filter(scanResult -> !beanArchives.contains(scanResult.getBeanArchiveRef().toLowerCase(Locale.ROOT))) + .peek(scanResult -> beanArchives.add(scanResult.getBeanArchiveRef().toLowerCase(Locale.ROOT))) + .toList(); + } +}
diff --git a/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/internal/managed/TestParent.java b/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/internal/managed/TestParent.java deleted file mode 100644 index e69de29..0000000 --- a/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/internal/managed/TestParent.java +++ /dev/null
diff --git a/incubator/cdi-inject-weld/src/test/resources/META-INF/beans.xml b/incubator/cdi-inject-weld/src/test/resources/META-INF/beans.xml index 678e3dc..89484ca 100644 --- a/incubator/cdi-inject-weld/src/test/resources/META-INF/beans.xml +++ b/incubator/cdi-inject-weld/src/test/resources/META-INF/beans.xml
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2021, 2025 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at @@ -16,5 +16,9 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> - -<beans bean-discovery-mode="annotated" /> +<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd" + version="4.0" + bean-discovery-mode="annotated"> +</beans> \ No newline at end of file
diff --git a/incubator/cdi-inject-weld/src/test/resources/META-INF/services/org.jboss.weld.environment.deployment.discovery.DiscoveryStrategy b/incubator/cdi-inject-weld/src/test/resources/META-INF/services/org.jboss.weld.environment.deployment.discovery.DiscoveryStrategy new file mode 100644 index 0000000..1d2ac45 --- /dev/null +++ b/incubator/cdi-inject-weld/src/test/resources/META-INF/services/org.jboss.weld.environment.deployment.discovery.DiscoveryStrategy
@@ -0,0 +1 @@ +org.glassfish.jersey.inject.weld.SingleArchiveDiscoveryStrategy \ No newline at end of file
diff --git a/tests/e2e-inject/cdi-inject-weld/pom.xml b/tests/e2e-inject/cdi-inject-weld/pom.xml index a53512c..2c9c334 100644 --- a/tests/e2e-inject/cdi-inject-weld/pom.xml +++ b/tests/e2e-inject/cdi-inject-weld/pom.xml
@@ -32,12 +32,25 @@ <description>Jersey E2E Inject CDI SE tests</description> + <properties> + <surefire.security.argline> + --add-reads org.jboss.logging=weld.core.impl + --add-reads org.jboss.logging=weld.se.core + --add-reads org.jboss.logging=weld.environment.common + </surefire.security.argline> + </properties> + <dependencies> <dependency> <groupId>jakarta.enterprise</groupId> <artifactId>jakarta.enterprise.cdi-api</artifactId> </dependency> <dependency> + <groupId>org.jboss.weld</groupId> + <artifactId>weld-api</artifactId> + <scope>provided</scope> + </dependency> + <dependency> <groupId>org.jboss.weld.se</groupId> <artifactId>weld-se-core</artifactId> <scope>test</scope>
diff --git a/tests/e2e-inject/cdi-inject-weld/src/main/java/module-info.java b/tests/e2e-inject/cdi-inject-weld/src/main/java/module-info.java new file mode 100644 index 0000000..71baa3b --- /dev/null +++ b/tests/e2e-inject/cdi-inject-weld/src/main/java/module-info.java
@@ -0,0 +1,38 @@ +/* + * Copyright (c) 2025 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 + */ + +module org.glassfish.jersey.tests.e2e.inject.cdi.inject.weld.main { + requires jakarta.annotation; + requires jakarta.cdi; + requires jakarta.inject; + requires jakarta.interceptor; + requires jakarta.ws.rs; + requires org.glassfish.jersey.core.common; + requires org.glassfish.jersey.core.server; + requires weld.api; + + exports org.glassfish.jersey.tests.e2e.inject.cdi.weld; + exports org.glassfish.jersey.tests.e2e.inject.cdi.weld.scopes; + exports org.glassfish.jersey.tests.e2e.inject.cdi.weld.subresources; + + opens org.glassfish.jersey.tests.e2e.inject.cdi.weld to + org.glassfish.jersey.incubator.cdi.inject.weld, + weld.core.impl; + opens org.glassfish.jersey.tests.e2e.inject.cdi.weld.scopes to + org.glassfish.jersey.incubator.cdi.inject.weld, + weld.core.impl; + opens org.glassfish.jersey.tests.e2e.inject.cdi.weld.subresources to weld.core.impl; +} \ No newline at end of file
diff --git a/incubator/cdi-inject-weld/src/test/java/module-info.txt b/tests/e2e-inject/cdi-inject-weld/src/test/java/module-info.java similarity index 67% copy from incubator/cdi-inject-weld/src/test/java/module-info.txt copy to tests/e2e-inject/cdi-inject-weld/src/test/java/module-info.java index e9c2e19..684bbe0 100644 --- a/incubator/cdi-inject-weld/src/test/java/module-info.txt +++ b/tests/e2e-inject/cdi-inject-weld/src/test/java/module-info.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025 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 @@ -14,18 +14,15 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -open module org.glassfish.jersey.incubator.cdi.inject.weld { - requires jakarta.annotation; +open module org.glassfish.jersey.tests.e2e.inject.cdi.inject.weld.test { requires jakarta.cdi; - requires jakarta.inject; requires jakarta.ws.rs; - requires java.logging; - - requires junit; - requires org.glassfish.jersey.core.common; - requires org.glassfish.jersey.core.client; requires org.glassfish.jersey.core.server; - requires org.hamcrest; + requires org.glassfish.jersey.inject.hk2; + requires org.glassfish.jersey.tests.e2e.inject.cdi.inject.weld.main; + requires org.glassfish.jersey.tests.framework.core; + requires org.junit.jupiter.api; + requires weld.core.impl; } \ No newline at end of file
diff --git a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/EventsTest.java b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/EventsTest.java similarity index 92% rename from tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/EventsTest.java rename to tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/EventsTest.java index c93a71d..e423f7c 100644 --- a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/EventsTest.java +++ b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/EventsTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 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 @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.tests.e2e.inject.cdi.weld; +package org.glassfish.jersey.tests.e2e.inject.cdi.weld.test; import jakarta.ws.rs.client.Entity; import jakarta.ws.rs.core.Application; @@ -24,6 +24,7 @@ import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.AccountResource; import org.jboss.weld.environment.se.Weld; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assumptions;
diff --git a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/InterceptorDecoratorTest.java b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/InterceptorDecoratorTest.java similarity index 90% rename from tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/InterceptorDecoratorTest.java rename to tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/InterceptorDecoratorTest.java index f789edc..0d91f4c 100644 --- a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/InterceptorDecoratorTest.java +++ b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/InterceptorDecoratorTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 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 @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.tests.e2e.inject.cdi.weld; +package org.glassfish.jersey.tests.e2e.inject.cdi.weld.test; import jakarta.ws.rs.core.Application; import jakarta.ws.rs.core.Response; @@ -23,6 +23,8 @@ import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.HelloResource; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.NameService; import org.jboss.weld.environment.se.Weld; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assumptions;
diff --git a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/RequestContextBuilder.java b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/RequestContextBuilder.java similarity index 98% rename from tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/RequestContextBuilder.java rename to tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/RequestContextBuilder.java index 5eb8dd2..d48cf0f 100644 --- a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/RequestContextBuilder.java +++ b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/RequestContextBuilder.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 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 @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.tests.e2e.inject.cdi.weld; +package org.glassfish.jersey.tests.e2e.inject.cdi.weld.test; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream;
diff --git a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/scopes/ScopesTest.java b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/scopes/ScopesTest.java similarity index 90% rename from tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/scopes/ScopesTest.java rename to tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/scopes/ScopesTest.java index f88b1e2..6c6a7c8 100644 --- a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/scopes/ScopesTest.java +++ b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/scopes/ScopesTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 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 @@ -14,11 +14,13 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.tests.e2e.inject.cdi.weld.scopes; +package org.glassfish.jersey.tests.e2e.inject.cdi.weld.test.scopes; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.scopes.RequestScopedResource; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.scopes.SingletonScopedResource; import org.jboss.weld.environment.se.Weld; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach;
diff --git a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/subresources/ModelProcessorScopeTest.java b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/subresources/ModelProcessorScopeTest.java similarity index 92% rename from tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/subresources/ModelProcessorScopeTest.java rename to tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/subresources/ModelProcessorScopeTest.java index 58d2e5b..f4b4872 100644 --- a/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/subresources/ModelProcessorScopeTest.java +++ b/tests/e2e-inject/cdi-inject-weld/src/test/java/org/glassfish/jersey/tests/e2e/inject/cdi/weld/test/subresources/ModelProcessorScopeTest.java
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025 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 @@ -14,14 +14,17 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.glassfish.jersey.tests.e2e.inject.cdi.weld.subresources; +package org.glassfish.jersey.tests.e2e.inject.cdi.weld.test.subresources; import java.util.concurrent.ExecutionException; import org.glassfish.jersey.server.ApplicationHandler; import org.glassfish.jersey.server.ContainerResponse; import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.tests.e2e.inject.cdi.weld.RequestContextBuilder; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.subresources.ModelProcessorFeature; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.subresources.RootResource; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.subresources.RootSingletonResource; +import org.glassfish.jersey.tests.e2e.inject.cdi.weld.test.RequestContextBuilder; import org.jboss.weld.environment.se.Weld; import org.junit.jupiter.api.AfterEach;