You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2015/05/09 23:08:29 UTC
svn commit: r1678526 - in /openwebbeans/trunk/webbeans-web/src:
it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/
it/webcdiapp/src/main/webapp/ main/java/org/apache/webbeans/web/context/
Author: struberg
Date: Sat May 9 21:08:28 2015
New Revision: 1678526
URL: http://svn.apache.org/r1678526
Log:
OWB-1071 add test case for problem with META-INF/beans.xml interpretation in webapps
txs to Ludovic PĂ©net for the report and test description!
Added:
openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/NonAnnotatedDependentBean.java
Modified:
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/webapp/index.jsp
openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Added: openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/NonAnnotatedDependentBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/NonAnnotatedDependentBean.java?rev=1678526&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/NonAnnotatedDependentBean.java (added)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/NonAnnotatedDependentBean.java Sat May 9 21:08:28 2015
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+/**
+ * This bean is _not_ annotated with a bean scope
+ * but we are in a BDA with implicit bean-discovery mode ALL.
+ * That means this class should get picked up as dependent scoped bean
+ */
+public class NonAnnotatedDependentBean
+{
+ public int meaningOfLife()
+ {
+ return 42;
+ }
+}
Modified: 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=1678526&r1=1678525&r2=1678526&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/RequestScopedBean.java (original)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/java/org/apache/openwebbeans/web/it/beans/RequestScopedBean.java Sat May 9 21:08:28 2015
@@ -22,6 +22,7 @@ import javax.annotation.PostConstruct;
import javax.enterprise.context.Initialized;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes;
+import javax.inject.Inject;
import javax.inject.Named;
@RequestScoped
@@ -32,6 +33,8 @@ public class RequestScopedBean
private static int requestInstanceCounter = 0;
private static int requestContextCounter = 0;
+ private @Inject NonAnnotatedDependentBean nonAnnotatedBean;
+
private String name = "Super name";
@@ -72,4 +75,9 @@ public class RequestScopedBean
{
return String.valueOf(requestInstanceCounter) + ',' + String.valueOf(requestContextCounter);
}
+
+ public int getMeaningOfLife()
+ {
+ return nonAnnotatedBean.meaningOfLife();
+ }
}
Modified: 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=1678526&r1=1678525&r2=1678526&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/index.jsp (original)
+++ openwebbeans/trunk/webbeans-web/src/it/webcdiapp/src/main/webapp/index.jsp Sat May 9 21:08:28 2015
@@ -32,6 +32,8 @@ Name from RequestScopedBean: <c:out valu
<br />
Current instance: <c:out value="${requestScopedBean.requestInstanceCount}"/>
+<br/>
+Meaning of Life: <c:out value="${requestScopedBean.meaningOfLife}"/>
</body>
</html>
Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java?rev=1678526&r1=1678525&r2=1678526&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java (original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java Sat May 9 21:08:28 2015
@@ -463,7 +463,7 @@ public class WebContextsService extends
{
sessionIsExpiring = sessionIsExpiring(session);
}
-
+
// init in this case only attaches the existing session to the ThreadLocal
initSessionContext(session);
context = sessionContexts.get();