Author: rmannibucau
Date: Wed Jun 19 18:00:56 2019
New Revision: 1861658
URL: http://svn.apache.org/viewvc?rev=1861658&view=rev
Log:
[github pr #20][stephenc] applying patch from Stephen to add tests for built-in
producers proxies classloader selection (tomcat7 IT) + dropping httpclient
dependency since it is not really needed here (fatwar tomcat and jetty IT)
Added:
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/pom.xml
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/META-INF/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/META-INF/context.xml
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/web/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/web/tomcat7/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/web/tomcat7/test/
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/web/tomcat7/test/OwbTomcatPluginIT.java
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
openwebbeans/trunk/webbeans-jetty9/src/it/module/pom.xml
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
openwebbeans/trunk/webbeans-tomcat7/pom.xml
openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java
openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java
openwebbeans/trunk/webbeans-tomcat7/src/it/settings.xml
Modified: openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml (original)
+++ openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/pom.xml Wed Jun 19
18:00:56 2019
@@ -41,14 +41,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.11</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpclient.version}</version>
<scope>test</scope>
</dependency>
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
Wed Jun 19 18:00:56 2019
@@ -19,6 +19,8 @@
package org.apache.webbeans.web.jetty9.test;
import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
/**
* Test bean which gets used in the TestServlet.
@@ -26,6 +28,10 @@ import javax.enterprise.context.Applicat
@ApplicationScoped
public class TestBean
{
+
+ @Inject
+ HttpServletRequest request;
+
int i = 4711;
public int getI()
@@ -37,4 +43,9 @@ public class TestBean
{
this.i = i;
}
+
+ public HttpServletRequest getRequest()
+ {
+ return request;
+ }
}
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
Wed Jun 19 18:00:56 2019
@@ -21,6 +21,7 @@ package org.apache.webbeans.web.jetty9.t
import javax.inject.Inject;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@@ -35,6 +36,9 @@ public class TestServlet implements Serv
@Inject
private TestBean tb;
+ @Inject
+ private ServletContext context;
+
public void destroy()
{
// nothing to do
@@ -54,8 +58,17 @@ public class TestServlet implements Serv
{
if (tb == null || tb.getI() != 4711)
{
- throw new RuntimeException("CDI Injction doesn not work!");
+ throw new RuntimeException("CDI Injection does not work!");
+ }
+ if (context == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
context!");
+ }
+ if (tb.getRequest() == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
request!");
}
+ res.getWriter().write(":thumb_up:");
}
public String getServletInfo()
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/fatwar/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
Wed Jun 19 18:00:56 2019
@@ -18,17 +18,13 @@
*/
package org.apache.webbeans.web.jetty9.test;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.DefaultHttpClient;
-
import org.junit.Assert;
import org.junit.Test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.StringBuilder;
+import java.net.URL;
/**
* Simple requests to the jetty installation
@@ -38,23 +34,19 @@ public class OwbJettyPluginIT
@Test
public void testJettyRequest() throws Exception
{
- DefaultHttpClient httpclient = new DefaultHttpClient();
- HttpGet httpGet = new
HttpGet("http://localhost:9081/owbjetty9it/test.test");
-
- HttpResponse response = httpclient.execute(httpGet);
-
- // Get the response
- BufferedReader rd = new BufferedReader
- (new InputStreamReader(response.getEntity().getContent()));
-
StringBuilder builder = new StringBuilder();
- String line = "";
- while ((line = rd.readLine()) != null) {
- builder.append(line);
+ try (BufferedReader rd = new BufferedReader(
+ new InputStreamReader(new
URL("http://localhost:9081/owbjetty9it/test.test").openStream())))
+ {
+
+ String line = "";
+ while ((line = rd.readLine()) != null)
+ {
+ builder.append(line);
+ }
}
- Assert.assertNotNull(response);
- Assert.assertEquals("Got " + builder.toString(), 200,
response.getStatusLine().getStatusCode());
+ Assert.assertEquals(":thumb_up:", builder.toString());
}
}
Modified: openwebbeans/trunk/webbeans-jetty9/src/it/module/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/module/pom.xml?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/src/it/module/pom.xml (original)
+++ openwebbeans/trunk/webbeans-jetty9/src/it/module/pom.xml Wed Jun 19
18:00:56 2019
@@ -31,7 +31,7 @@
<name>Jetty 9 plugin IT</name>
<properties>
- <jetty.port.it>9081</jetty.port.it>
+ <jetty.port.it>9082</jetty.port.it>
<jstl.version>1.2</jstl.version>
<projectStage>Development</projectStage>
</properties>
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
Wed Jun 19 18:00:56 2019
@@ -19,6 +19,8 @@
package org.apache.webbeans.web.jetty9.test;
import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
/**
* Test bean which gets used in the TestServlet.
@@ -26,6 +28,10 @@ import javax.enterprise.context.Applicat
@ApplicationScoped
public class TestBean
{
+
+ @Inject
+ HttpServletRequest request;
+
int i = 4711;
public int getI()
@@ -37,4 +43,9 @@ public class TestBean
{
this.i = i;
}
+
+ public HttpServletRequest getRequest()
+ {
+ return request;
+ }
}
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
Wed Jun 19 18:00:56 2019
@@ -21,6 +21,7 @@ package org.apache.webbeans.web.jetty9.t
import javax.inject.Inject;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@@ -35,6 +36,9 @@ public class TestServlet implements Serv
@Inject
private TestBean tb;
+ @Inject
+ private ServletContext context;
+
public void destroy()
{
// nothing to do
@@ -54,7 +58,15 @@ public class TestServlet implements Serv
{
if (tb == null || tb.getI() != 4711)
{
- throw new RuntimeException("CDI Injction doesn not work!");
+ throw new RuntimeException("CDI Injection does not work!");
+ }
+ if (context == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
context!");
+ }
+ if (tb.getRequest() == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
request!");
}
}
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/module/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/module/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
Wed Jun 19 18:00:56 2019
@@ -39,22 +39,25 @@ public class OwbJettyPluginIT
public void testJettyRequest() throws Exception
{
DefaultHttpClient httpclient = new DefaultHttpClient();
- HttpGet httpGet = new
HttpGet("http://localhost:9081/owbjetty9it/test.test");
+ HttpGet httpGet = new
HttpGet("http://localhost:9082/owbjetty9it/test.test");
HttpResponse response = httpclient.execute(httpGet);
// Get the response
- BufferedReader rd = new BufferedReader
- (new InputStreamReader(response.getEntity().getContent()));
+ try (BufferedReader rd = new BufferedReader
+ (new InputStreamReader(response.getEntity().getContent())))
+ {
- StringBuilder builder = new StringBuilder();
- String line = "";
- while ((line = rd.readLine()) != null) {
- builder.append(line);
- }
+ StringBuilder builder = new StringBuilder();
+ String line = "";
+ while ((line = rd.readLine()) != null)
+ {
+ builder.append(line);
+ }
- Assert.assertNotNull(response);
- Assert.assertEquals("Got " + builder.toString(), 200,
response.getStatusLine().getStatusCode());
+ Assert.assertNotNull(response);
+ Assert.assertEquals("Got " + builder.toString(), 200,
response.getStatusLine().getStatusCode());
+ }
}
}
Modified: openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml
(original)
+++ openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/pom.xml Wed Jun
19 18:00:56 2019
@@ -31,7 +31,7 @@
<name>Jetty 9 plugin IT</name>
<properties>
- <jetty.port.it>9081</jetty.port.it>
+ <jetty.port.it>9083</jetty.port.it>
<jstl.version>1.2</jstl.version>
<projectStage>Development</projectStage>
</properties>
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestBean.java
Wed Jun 19 18:00:56 2019
@@ -19,6 +19,8 @@
package org.apache.webbeans.web.jetty9.test;
import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
/**
* Test bean which gets used in the TestServlet.
@@ -26,6 +28,10 @@ import javax.enterprise.context.Applicat
@ApplicationScoped
public class TestBean
{
+
+ @Inject
+ HttpServletRequest request;
+
int i = 4711;
public int getI()
@@ -37,4 +43,9 @@ public class TestBean
{
this.i = i;
}
+
+ public HttpServletRequest getRequest()
+ {
+ return request;
+ }
}
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/main/java/org/apache/webbeans/web/jetty9/test/TestServlet.java
Wed Jun 19 18:00:56 2019
@@ -21,6 +21,7 @@ package org.apache.webbeans.web.jetty9.t
import javax.inject.Inject;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@@ -35,6 +36,9 @@ public class TestServlet implements Serv
@Inject
private TestBean tb;
+ @Inject
+ private ServletContext context;
+
public void destroy()
{
// nothing to do
@@ -54,7 +58,15 @@ public class TestServlet implements Serv
{
if (tb == null || tb.getI() != 4711)
{
- throw new RuntimeException("CDI Injction doesn not work!");
+ throw new RuntimeException("CDI Injection does not work!");
+ }
+ if (context == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
context!");
+ }
+ if (tb.getRequest() == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
request!");
}
}
Modified:
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
(original)
+++
openwebbeans/trunk/webbeans-jetty9/src/it/servletinjection/src/test/java/org/apache/webbeans/web/jetty9/test/OwbJettyPluginIT.java
Wed Jun 19 18:00:56 2019
@@ -39,7 +39,7 @@ public class OwbJettyPluginIT
public void testJettyRequest() throws Exception
{
DefaultHttpClient httpclient = new DefaultHttpClient();
- HttpGet httpGet = new
HttpGet("http://localhost:9081/owbjetty9it/test.test");
+ HttpGet httpGet = new
HttpGet("http://localhost:9083/owbjetty9it/test.test");
HttpResponse response = httpclient.execute(httpGet);
Modified: openwebbeans/trunk/webbeans-tomcat7/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/pom.xml?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tomcat7/pom.xml (original)
+++ openwebbeans/trunk/webbeans-tomcat7/pom.xml Wed Jun 19 18:00:56 2019
@@ -105,6 +105,50 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>mrm-maven-plugin</artifactId>
+ <version>1.2.0</version>
+ <configuration>
+ <propertyName>repository.proxy.url</propertyName>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>start</goal>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <configuration>
+ <debug>false</debug><!-- unless we want to debug the
tomcat7-maven-plugin-->
+ <projectsDirectory>src/it</projectsDirectory>
+
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ <filterProperties>
+ <tomcatVersion>${tomcat7.version}</tomcatVersion>
+
<repository.proxy.url>${repository.proxy.url}</repository.proxy.url>
+
<local.repository.path>${project.build.directory}/local-repo</local.repository.path>
+ </filterProperties>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ <!-- when run from the command line, we are likely
debugging just one, so stream -->
+ <streamLogs>true</streamLogs>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<profiles>
<profile>
@@ -116,17 +160,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
- <debug>true</debug>
- <projectsDirectory>src/it</projectsDirectory>
-
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
-
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
- <settingsFile>src/it/settings.xml</settingsFile>
- <pomIncludes>
- <pomInclude>*/pom.xml</pomInclude>
- </pomIncludes>
- <goals>
- <goal>install</goal>
- </goals>
+ <!-- we are the profile running all tests, send
the logs to file only -->
+ <streamLogs>false</streamLogs>
</configuration>
<executions>
<execution>
Added: openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/pom.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/pom.xml?rev=1861658&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/pom.xml (added)
+++ openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/pom.xml Wed Jun 19
18:00:56 2019
@@ -0,0 +1,290 @@
+<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/maven-v4_0_0.xsd">
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version
+ 2.0 (the "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+ applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the
+ License.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans</artifactId>
+ <version>@project.version@</version>
+ </parent>
+
+ <groupId>org.apache.openwebbeans.it</groupId>
+ <artifactId>openwebbeans-tomcat7-it-fatwar</artifactId>
+ <version>@project.version@</version>
+ <packaging>war</packaging>
+ <name>Tomcat 7 plugin IT</name>
+
+ <properties>
+ <tomcat.port.it>9082</tomcat.port.it>
+ <jstl.version>1.2</jstl.version>
+ <projectStage>Development</projectStage>
+ </properties>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_3.0_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.2_spec</artifactId>
+ <version>1.0</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <version>@project.version@</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-web</artifactId>
+ <version>@project.version@</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-tomcat7</artifactId>
+ <version>@project.version@</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>owbtomcat7it</finalName>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <!-- needed for the tomcat7 integration tests -->
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat7-maven-plugin</artifactId>
+ <version>2.2</version>
+ <dependencies>
+ <dependency>
+ <groupId>jstl</groupId>
+ <artifactId>jstl</artifactId>
+ <version>${jstl.version}</version>
+ </dependency>
+
+ <!--
+ tomcat7-maven-plugin dependencies
+ We need to add those for specifying the version
+ -->
+ <dependency>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-core</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-util</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-coyote</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-api</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jdbc</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-dbcp</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-servlet-api</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jsp-api</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jasper</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jasper-el</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-el-api</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-catalina</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-tribes</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-catalina-ha</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-annotations-api</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <!-- tomcat i18n too ?? -->
+
+ <!-- not sure we need that -->
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-juli</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-logging-juli</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-logging-log4j</artifactId>
+ <version>${tomcat7.version}</version>
+ </dependency>
+
+ </dependencies>
+ </plugin>
+
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.11</version>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat7-maven-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <path>/${project.build.finalName}</path>
+ <addContextWarDependencies>true</addContextWarDependencies>
+ <port>${tomcat.port.it}</port>
+ <fork>true</fork> <!-- needed for testing ITs -->
+ <systemProperties>
+
<org.apache.myfaces.PROJECT_STAGE>${projectStage}</org.apache.myfaces.PROJECT_STAGE>
+
<faces.PROJECT_STAGE>${projectStage}</faces.PROJECT_STAGE>
+ </systemProperties>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-tomcat</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run-war</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-tomcat</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>shutdown</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project>
Added:
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java?rev=1861658&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java
(added)
+++
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java
Wed Jun 19 18:00:56 2019
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.web.tomcat7.test;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Test bean which gets used in the TestServlet.
+ */
+@ApplicationScoped
+public class TestBean
+{
+
+ @Inject
+ HttpServletRequest request;
+
+ int i = 4711;
+
+ public int getI()
+ {
+ return i;
+ }
+
+ public void setI(int i)
+ {
+ this.i = i;
+ }
+
+ public HttpServletRequest getRequest()
+ {
+ return request;
+ }
+}
Added:
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java?rev=1861658&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java
(added)
+++
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java
Wed Jun 19 18:00:56 2019
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.web.tomcat7.test;
+
+import javax.enterprise.inject.spi.CDI;
+import javax.inject.Inject;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import java.io.IOException;
+
+/**
+ * Dummy Servlet which just checks whether CDI injection works
+ */
+public class TestServlet implements Servlet
+{
+
+ @Inject
+ private TestBean tb;
+
+ public void destroy()
+ {
+ // nothing to do
+ }
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ // nothing to do
+ }
+
+ public ServletConfig getServletConfig()
+ {
+ return null;
+ }
+
+ public void service(ServletRequest req, ServletResponse res) throws
ServletException, IOException
+ {
+ if (tb != null)
+ {
+ throw new RuntimeException("That's unexpected, we are in fatwar
mode so cannot activate the tomcat7 " +
+ "plugin and yet injection is working!");
+ }
+ // now grab the beans by hand
+ tb = CDI.current().select(TestBean.class).get();
+
+ ServletContext context =
CDI.current().select(ServletContext.class).get();
+
+ if (tb == null || tb.getI() != 4711)
+ {
+ throw new RuntimeException("CDI Lookup does not work!");
+ }
+ if (context == null)
+ {
+ throw new RuntimeException("CDI Lookup missing servlet context!");
+ }
+ if (tb.getRequest() == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
request!");
+ }
+ res.getWriter().write(":thumb_up:");
+ }
+
+ public String getServletInfo()
+ {
+ return null;
+ }
+}
Added:
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/META-INF/context.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/META-INF/context.xml?rev=1861658&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/META-INF/context.xml
(added)
+++
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/META-INF/context.xml
Wed Jun 19 18:00:56 2019
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version
+ 2.0 (the "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+ applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the
+ License.
+-->
+<Context>
+ <!-- cannot add the listener as we are a Fat WAR and thus cannot activate
the plugin -->
+<!-- <Listener
className="org.apache.webbeans.web.tomcat7.ContextLifecycleListener" />-->
+</Context>
Added:
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml?rev=1861658&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
(added)
+++
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/beans.xml
Wed Jun 19 18:00:56 2019
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans/>
Added:
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/web.xml?rev=1861658&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
(added)
+++
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/main/webapp/WEB-INF/web.xml
Wed Jun 19 18:00:56 2019
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<web-app id="owb-it" 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">
+ <listener>
+
<listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+
<servlet-class>org.apache.webbeans.web.tomcat7.test.TestServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>*.test</url-pattern>
+ </servlet-mapping>
+</web-app>
Added:
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/web/tomcat7/test/OwbTomcatPluginIT.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/web/tomcat7/test/OwbTomcatPluginIT.java?rev=1861658&view=auto
==============================================================================
---
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/web/tomcat7/test/OwbTomcatPluginIT.java
(added)
+++
openwebbeans/trunk/webbeans-tomcat7/src/it/fatwar/src/test/java/org/apache/webbeans/web/tomcat7/test/OwbTomcatPluginIT.java
Wed Jun 19 18:00:56 2019
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.web.tomcat7.test;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.lang.StringBuilder;
+import java.net.URL;
+
+/**
+ * Simple requests to the tomcat installation
+ */
+public class OwbTomcatPluginIT
+{
+ @Test
+ public void testTomcatRequest() throws Exception
+ {
+ // Get the response
+ StringBuilder builder = new StringBuilder();
+ try (BufferedReader rd = new BufferedReader(
+ new InputStreamReader(new
URL("http://localhost:9082/owbtomcat7it/test.test").openStream())))
+ {
+
+ String line = "";
+ while ((line = rd.readLine()) != null)
+ {
+ builder.append(line);
+ }
+ }
+
+ Assert.assertEquals(":thumb_up:", builder.toString());
+ }
+
+}
Modified:
openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java
(original)
+++
openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestBean.java
Wed Jun 19 18:00:56 2019
@@ -19,6 +19,8 @@
package org.apache.webbeans.web.tomcat7.test;
import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
/**
* Test bean which gets used in the TestServlet.
@@ -26,6 +28,10 @@ import javax.enterprise.context.Applicat
@ApplicationScoped
public class TestBean
{
+
+ @Inject
+ HttpServletRequest request;
+
int i = 4711;
public int getI()
@@ -37,4 +43,9 @@ public class TestBean
{
this.i = i;
}
+
+ public HttpServletRequest getRequest()
+ {
+ return request;
+ }
}
Modified:
openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java
(original)
+++
openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/src/main/java/org/apache/webbeans/web/tomcat7/test/TestServlet.java
Wed Jun 19 18:00:56 2019
@@ -21,6 +21,7 @@ package org.apache.webbeans.web.tomcat7.
import javax.inject.Inject;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@@ -35,6 +36,9 @@ public class TestServlet implements Serv
@Inject
private TestBean tb;
+ @Inject
+ private ServletContext context;
+
public void destroy()
{
// nothing to do
@@ -54,7 +58,15 @@ public class TestServlet implements Serv
{
if (tb == null || tb.getI() != 4711)
{
- throw new RuntimeException("CDI Injction doesn not work!");
+ throw new RuntimeException("CDI Injection does not work!");
+ }
+ if (context == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
context!");
+ }
+ if (tb.getRequest() == null)
+ {
+ throw new RuntimeException("CDI Injection missing servlet
request!");
}
}
Modified: openwebbeans/trunk/webbeans-tomcat7/src/it/settings.xml
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/settings.xml?rev=1861658&r1=1861657&r2=1861658&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tomcat7/src/it/settings.xml (original)
+++ openwebbeans/trunk/webbeans-tomcat7/src/it/settings.xml Wed Jun 19 18:00:56
2019
@@ -20,6 +20,14 @@ under the License.
-->
<settings>
+ <mirrors>
+ <mirror>
+ <id>mrm-maven-plugin</id>
+ <name>Mock Repository Manager</name>
+ <url>@repository.proxy.url@</url>
+ <mirrorOf>*</mirrorOf>
+ </mirror>
+ </mirrors>
<profiles>
<profile>
<id>it-repo</id>
@@ -29,27 +37,38 @@ under the License.
<repositories>
<repository>
<id>local.central</id>
- <url>@localRepositoryUrl@</url>
+ <url>@repository.proxy.url@</url>
<releases>
<enabled>true</enabled>
+ <checksumPolicy>ignore</checksumPolicy>
+ <updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
+ <checksumPolicy>ignore</checksumPolicy>
+ <updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>local.central</id>
- <url>@localRepositoryUrl@</url>
+ <url>@repository.proxy.url@</url>
<releases>
<enabled>true</enabled>
+ <checksumPolicy>ignore</checksumPolicy>
+ <updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
+ <checksumPolicy>ignore</checksumPolicy>
+ <updatePolicy>always</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
+ <properties>
+ <jetty.version>@jetty.version@</jetty.version>
+ </properties>
</profile>
</profiles>
</settings>