Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x

This commit is contained in:
Joakim Erdfelt 2020-09-29 03:50:55 -05:00
commit 02d6ce1b5d
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
10 changed files with 51 additions and 53 deletions

View File

@ -21,8 +21,6 @@ package org.eclipse.jetty.cdi;
import org.eclipse.jetty.annotations.AnnotationConfiguration;
import org.eclipse.jetty.plus.webapp.PlusConfiguration;
import org.eclipse.jetty.webapp.AbstractConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* <p>CDI Configuration</p>
@ -32,8 +30,6 @@ import org.slf4j.LoggerFactory;
*/
public class CdiConfiguration extends AbstractConfiguration
{
private static final Logger LOG = LoggerFactory.getLogger(CdiConfiguration.class);
public CdiConfiguration()
{
protectAndExpose("org.eclipse.jetty.cdi.CdiServletContainerInitializer");

11
pom.xml
View File

@ -32,7 +32,7 @@
<annotation-api.version>2.0.0-RC1</annotation-api.version>
<transaction-api.version>2.0.0-RC1</transaction-api.version>
<mail-api.version>2.0.0-RC4</mail-api.version>
<inject-api.version>2.0.0-RC2</inject-api.version>
<inject-api.version>2.0.0-RC4</inject-api.version>
<infinispan.version>9.4.8.Final</infinispan.version>
<hazelcast.version>4.0.1</hazelcast.version>
<conscrypt.version>2.4.0</conscrypt.version>
@ -43,7 +43,8 @@
<junit.version>5.7.0</junit.version>
<maven.version>3.6.0</maven.version>
<maven.resolver.version>1.3.1</maven.resolver.version>
<weld.version>3.1.3.Final</weld.version>
<weld.version>4.0.0.Beta1</weld.version>
<jboss.logging.version>3.4.1.Final</jboss.logging.version>
<jetty.perf-helper.version>1.0.5</jetty.perf-helper.version>
<ant.version>1.10.8</ant.version>
<unix.socket.tmp></unix.socket.tmp>
@ -65,6 +66,7 @@
<!-- testing -->
<it.debug>false</it.debug>
<jetty.test.version>5.5</jetty.test.version>
<hamcrest.version>2.2</hamcrest.version>
<!-- springboot is only used for jetty-maven-plugin it test
otherwise depending on Spring Boot might be chicken and egg issue :) -->
@ -1107,6 +1109,11 @@
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>

View File

@ -19,7 +19,6 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
</project>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>tests-parent</artifactId>
<version>10.0.0-SNAPSHOT</version>
<version>11.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -43,6 +43,12 @@
<version>${weld.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss.logging.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
@ -52,6 +58,11 @@
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-jakarta-servlet-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -20,24 +20,8 @@ package org.eclipse.jetty.cdi.tests;
import java.io.File;
import java.util.EnumSet;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.jetty.annotations.AnnotationConfiguration;
import org.eclipse.jetty.cdi.CdiConfiguration;
import org.eclipse.jetty.cdi.CdiDecoratingListener;
@ -48,7 +32,6 @@ import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ListenerHolder;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@ -98,8 +81,6 @@ public class EmbeddedWeldTest
context.getServletHandler().addListener(new ListenerHolder(MyContextListener.class));
// Setup Jetty weld integration
/*
TODO: uncomment when Weld 4 is used.
switch (mode)
{
case "none": // Do nothing, let weld work it out.
@ -153,8 +134,6 @@ public class EmbeddedWeldTest
break;
}
*/
return server;
}
@ -217,8 +196,7 @@ public class EmbeddedWeldTest
webapp.setInitParameter(org.eclipse.jetty.cdi.CdiServletContainerInitializer.CDI_INTEGRATION_ATTRIBUTE, org.eclipse.jetty.cdi.CdiDecoratingListener.MODE);
webapp.addBean(new ServletContextHandler.Initializer(webapp, new org.eclipse.jetty.cdi.CdiServletContainerInitializer()));
// TODO: uncomment with Weld 4.
// webapp.addBean(new ServletContextHandler.Initializer(webapp, new org.jboss.weld.environment.servlet.EnhancedListener()));
webapp.addBean(new ServletContextHandler.Initializer(webapp, new org.jboss.weld.environment.servlet.EnhancedListener()));
String pkg = EmbeddedWeldTest.class.getPackage().getName();
webapp.getServerClassMatcher().add("-" + pkg + ".");

View File

@ -18,9 +18,9 @@
package org.eclipse.jetty.cdi.tests;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.Named;
import jakarta.enterprise.inject.Produces;
import jakarta.enterprise.inject.spi.InjectionPoint;
import jakarta.inject.Named;
public class FriendlyGreetings
{

View File

@ -19,13 +19,14 @@
package org.eclipse.jetty.cdi.tests;
import java.io.IOException;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.enterprise.inject.spi.BeanManager;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
public class GreetingsServlet extends HttpServlet
{

View File

@ -18,10 +18,10 @@
package org.eclipse.jetty.cdi.tests;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import jakarta.enterprise.inject.spi.BeanManager;
import jakarta.inject.Inject;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
public class MyContextListener implements ServletContextListener
{

View File

@ -19,14 +19,15 @@
package org.eclipse.jetty.cdi.tests;
import java.io.IOException;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import jakarta.enterprise.inject.spi.BeanManager;
import jakarta.inject.Inject;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
public class MyFilter implements Filter
{

View File

@ -35,5 +35,10 @@
<artifactId>weld-servlet-core</artifactId>
<version>${weld.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss.logging.version}</version>
</dependency>
</dependencies>
</project>