Return-Path: X-Original-To: apmail-openwebbeans-commits-archive@www.apache.org Delivered-To: apmail-openwebbeans-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 632D11083F for ; Tue, 28 Apr 2015 14:32:24 +0000 (UTC) Received: (qmail 95491 invoked by uid 500); 28 Apr 2015 14:32:24 -0000 Delivered-To: apmail-openwebbeans-commits-archive@openwebbeans.apache.org Received: (qmail 95467 invoked by uid 500); 28 Apr 2015 14:32:24 -0000 Mailing-List: contact commits-help@openwebbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwebbeans.apache.org Delivered-To: mailing list commits@openwebbeans.apache.org Received: (qmail 95456 invoked by uid 99); 28 Apr 2015 14:32:24 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2015 14:32:24 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 1B89BAC0623 for ; Tue, 28 Apr 2015 14:32:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@openwebbeans.apache.org From: rsandtner@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150428143224.1B89BAC0623@hades.apache.org> 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 @@ + + + + + run-its + + + + + org.apache.maven.plugins + maven-invoker-plugin + + true + src/it + ${project.build.directory}/it + ${project.build.directory}/local-repo + src/it/settings.xml + + */pom.xml + + + install + + + + + integration-test + + install + run + + + + + + + + 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 @@ + + + + 4.0.0 + + + org.apache.openwebbeans + openwebbeans + @project.version@ + + + org.apache.openwebbeans.it + openwebbeans-web-it-webcdiapp + war + + Webbeans Web IT + + + + 7.0.61 + true + 8089 + + + + + + + junit + junit + + + + org.apache.geronimo.specs + geronimo-jcdi_1.1_spec + + + + org.apache.geronimo.specs + geronimo-atinject_1.0_spec + + + + org.apache.geronimo.specs + geronimo-interceptor_1.2_spec + + + + org.apache.geronimo.specs + geronimo-servlet_3.0_spec + provided + + + + org.apache.openwebbeans + openwebbeans-web + ${project.version} + + + + jstl + jstl + 1.2 + + + + org.apache.httpcomponents + httpclient + 4.2.1 + test + + + + + + + webbeanswebCdiApp + + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.2 + + + org.apache.tomcat.embed + tomcat-embed-core + ${tomcat.version} + + + org.apache.tomcat + tomcat-util + ${tomcat.version} + + + org.apache.tomcat + tomcat-coyote + ${tomcat.version} + + + org.apache.tomcat + tomcat-api + ${tomcat.version} + + + + org.apache.tomcat + tomcat-jdbc + ${tomcat.version} + + + + org.apache.tomcat + tomcat-dbcp + ${tomcat.version} + + + + org.apache.tomcat + tomcat-servlet-api + ${tomcat.version} + + + + org.apache.tomcat + tomcat-jsp-api + ${tomcat.version} + + + + org.apache.tomcat + tomcat-jasper + ${tomcat.version} + + + + org.apache.tomcat + tomcat-jasper-el + ${tomcat.version} + + + + org.apache.tomcat + tomcat-el-api + ${tomcat.version} + + + + org.apache.tomcat + tomcat-catalina + ${tomcat.version} + + + + org.apache.tomcat + tomcat-tribes + ${tomcat.version} + + + + org.apache.tomcat + tomcat-catalina-ha + ${tomcat.version} + + + + org.apache.tomcat + tomcat-annotations-api + ${tomcat.version} + + + + org.apache.tomcat + tomcat-juli + ${tomcat.version} + + + + org.apache.tomcat.embed + tomcat-embed-logging-juli + ${tomcat.version} + + + org.apache.tomcat.embed + tomcat-embed-logging-log4j + ${tomcat.version} + + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.11 + + + integration-test + + integration-test + + + + verify + + verify + + + + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.0 + + /${project.build.finalName} + true + ${tomcat.port.it} + ${tomcat.fork} + + + + start-tomcat + pre-integration-test + + run + + + + stop-tomcat + post-integration-test + + shutdown + + + + + + + + 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 @@ + +<%@ 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" %> + + + Testpage + + + +Current time: <% out.println(new Date()); %> +
+ +Name from RequestScopedBean: +
+ +Current instance: + + + 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()); + } + +}