openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsandt...@apache.org
Subject svn commit: r1676545 - in /openwebbeans/trunk/webbeans-web: ./ src/it/ src/it/webcdiapp/ src/it/webcdiapp/src/ src/it/webcdiapp/src/main/ src/it/webcdiapp/src/main/java/ src/it/webcdiapp/src/main/java/org/ src/it/webcdiapp/src/main/java/org/apache/ src...
Date Tue, 28 Apr 2015 14:32:23 GMT
Author: rsandtner
Date: Tue Apr 28 14:32:22 2015
New Revision: 1676545

URL: http://svn.apache.org/r1676545
Log:
OWB-1052 added it-folder and a simple test

Added:
    openwebbeans/trunk/webbeans-web/src/it/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/settings.xml   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/pom.xml
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/
  (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/
  (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/
  (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/TestServlet.java
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/
  (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/RequestScopedBean.java
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/   (with
props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/openwebbeans/
  (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/beans.xml   (with
props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/web.xml   (with
props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/index.jsp
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/   (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/
  (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/
  (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/it/
  (with props)
    openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/it/RequestScopedIT.java
Modified:
    openwebbeans/trunk/webbeans-web/pom.xml

Modified: openwebbeans/trunk/webbeans-web/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/pom.xml?rev=1676545&r1=1676544&r2=1676545&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/pom.xml (original)
+++ openwebbeans/trunk/webbeans-web/pom.xml Tue Apr 28 14:32:22 2015
@@ -104,5 +104,43 @@
         </dependency>
 
     </dependencies>
+
+
+    <profiles>
+        <profile>
+            <id>run-its</id>
+            <build>
+                <plugins>
+                    <!-- invoke the integration tests under src/it -->
+                    <plugin>
+                        <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>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>integration-test</id>
+                                <goals>
+                                    <goal>install</goal>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
     
 </project>

Propchange: openwebbeans/trunk/webbeans-web/src/it/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Added: openwebbeans/trunk/webbeans-web/src/it/settings.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/settings.xml?rev=1676545&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openwebbeans/trunk/webbeans-web/src/it/settings.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/pom.xml?rev=1676545&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/pom.xml (added)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/pom.xml Tue Apr 28 14:32:22 2015
@@ -0,0 +1,260 @@
+<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-web-it-webcdiapp</artifactId>
+    <packaging>war</packaging>
+
+    <name>Webbeans Web IT</name>
+
+
+    <properties>
+        <tomcat.version>7.0.61</tomcat.version>
+        <tomcat.fork>true</tomcat.fork>
+        <tomcat.port.it>8089</tomcat.port.it>
+    </properties>
+
+
+    <dependencies>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jcdi_1.1_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-interceptor_1.2_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-web</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>jstl</groupId>
+            <artifactId>jstl</artifactId>
+            <version>1.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.2.1</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+
+    <build>
+        <finalName>webbeanswebCdiApp</finalName>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.tomcat.maven</groupId>
+                    <artifactId>tomcat7-maven-plugin</artifactId>
+                    <version>2.2</version>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.apache.tomcat.embed</groupId>
+                            <artifactId>tomcat-embed-core</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-util</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-coyote</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-api</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-jdbc</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-dbcp</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-servlet-api</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-jsp-api</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-jasper</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-jasper-el</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-el-api</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-catalina</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-tribes</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-catalina-ha</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-annotations-api</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>tomcat-juli</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.tomcat.embed</groupId>
+                            <artifactId>tomcat-embed-logging-juli</artifactId>
+                            <version>${tomcat.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.tomcat.embed</groupId>
+                            <artifactId>tomcat-embed-logging-log4j</artifactId>
+                            <version>${tomcat.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.0</version>
+                <configuration>
+                    <path>/${project.build.finalName}</path>
+                    <addContextWarDependencies>true</addContextWarDependencies>
+                    <port>${tomcat.port.it}</port>
+                    <fork>${tomcat.fork}</fork> <!-- true is needed for IT,
but if we want to start it we do not want to fork -->
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>start-tomcat</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>stop-tomcat</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>shutdown</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/TestServlet.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/TestServlet.java?rev=1676545&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/TestServlet.java
(added)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/TestServlet.java
Tue Apr 28 14:32:22 2015
@@ -0,0 +1,50 @@
+/*
+ * 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.openwebbeans.web.it;
+
+import org.apache.openwebbeans.web.it.beans.RequestScopedBean;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebServlet(urlPatterns = "/check")
+public class TestServlet extends HttpServlet
+{
+    private static final long serialVersionUID = -8232635534522251153L;
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
IOException
+    {
+        if (req.getParameter("reset") != null)
+        {
+            RequestScopedBean.resetCounter();
+        }
+        else
+        {
+            resp.setContentType("text/plain");
+            resp.setStatus(HttpServletResponse.SC_OK);
+
+            resp.getWriter().append(RequestScopedBean.info());
+        }
+    }
+}

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/RequestScopedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/RequestScopedBean.java?rev=1676545&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/RequestScopedBean.java
(added)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/RequestScopedBean.java
Tue Apr 28 14:32:22 2015
@@ -0,0 +1,75 @@
+/*
+ * 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.openwebbeans.web.it.beans;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.Initialized;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.inject.Named;
+
+@RequestScoped
+@Named
+public class RequestScopedBean
+{
+
+    private static int requestInstanceCounter = 0;
+    private static int requestContextCounter = 0;
+
+    private String name = "Super name";
+
+
+    @PostConstruct
+    protected void init()
+    {
+        requestInstanceCounter++;
+    }
+
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public int getRequestInstanceCount()
+    {
+        return requestInstanceCounter;
+    }
+
+    public int getRequestContextCount()
+    {
+        return requestContextCounter;
+    }
+
+    public static void resetCounter()
+    {
+        requestContextCounter = 0;
+        requestInstanceCounter = 0;
+    }
+
+    public void onRequestInit(@Observes @Initialized(RequestScoped.class) Object payload)
+    {
+        requestContextCounter++;
+    }
+
+    public static String info()
+    {
+        return String.valueOf(requestInstanceCounter) + ',' + String.valueOf(requestContextCounter);
+    }
+}

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/openwebbeans/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/openwebbeans/openwebbeans.properties?rev=1676545&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
(added)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
Tue Apr 28 14:32:22 2015
@@ -0,0 +1,19 @@
+#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.
+configuration.ordinal=100
+
+org.apache.webbeans.application.jsp=true
\ No newline at end of file

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/beans.xml?rev=1676545&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/web.xml?rev=1676545&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/index.jsp?rev=1676545&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/index.jsp (added)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/index.jsp Tue Apr 28
14:32:22 2015
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ page import="java.util.Date" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>Testpage</title>
+</head>
+<body>
+
+Current time: <% out.println(new Date()); %>
+<br />
+
+Name from RequestScopedBean: <c:out value="${requestScopedBean.name}" />
+<br />
+
+Current instance: <c:out value="${requestScopedBean.requestInstanceCount}"/>
+
+</body>
+</html>

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Propchange: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/it/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 28 14:32:22 2015
@@ -0,0 +1,11 @@
+target
+.metadata
+.classpath
+.project
+.settings
+*.iml
+*.ipr
+*.iws
+.idea
+.git
+.gitignore

Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/it/RequestScopedIT.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/it/RequestScopedIT.java?rev=1676545&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/it/RequestScopedIT.java
(added)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/test/java/org/apache/openwebbeans/web/it/RequestScopedIT.java
Tue Apr 28 14:32:22 2015
@@ -0,0 +1,81 @@
+/*
+ * 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.openwebbeans.web.it;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpEntity;
+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.InputStream;
+import java.io.InputStreamReader;
+
+public class RequestScopedIT
+{
+    public static final String BASE_URL = "http://localhost:8089/webbeanswebCdiApp";
+
+    @Test
+    public void testRequestScoped() throws Exception
+    {
+        DefaultHttpClient client = new DefaultHttpClient();
+        HttpGet jspGet = new HttpGet(BASE_URL + "/index.jsp");
+
+        checkResponse(client.execute(jspGet));
+        jspGet.releaseConnection();
+
+        HttpGet checkGet = new HttpGet(BASE_URL + "/check");
+        HttpResponse response = client.execute(checkGet);
+        checkResponse(response);
+
+        HttpEntity httpEntity = response.getEntity();
+        Assert.assertNotNull(httpEntity);
+
+        InputStream content = null;
+        try
+        {
+            content = httpEntity.getContent();
+            Assert.assertNotNull(content);
+            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(content));
+            String result = bufferedReader.readLine();
+            Assert.assertNotNull(result);
+            Assert.assertEquals("2,2", result);
+        }
+        finally {
+            if (content != null)
+            {
+                content.close();
+            }
+        }
+
+
+        checkGet.releaseConnection();
+    }
+
+    private void checkResponse(HttpResponse response)
+    {
+        Assert.assertNotNull(response);
+        Assert.assertNotNull(response.getStatusLine());
+        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+    }
+
+}



Mime
View raw message