Author: pete.muir(a)jboss.org
Date: 2010-01-25 15:32:26 -0500 (Mon, 25 Jan 2010)
New Revision: 5623
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Bird.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Capercaillie.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Feed.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Scottish.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/EnterpriseBeanTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/scope/unproxyable/UnproxyableTest.java
Log:
WELD-364, remove restriction on what methods can be observers in session beans
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-25 17:32:42
UTC (rev 5622)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-25 20:32:26
UTC (rev 5623)
@@ -141,7 +141,7 @@
initProxyClass();
checkEJBTypeAllowed();
checkConflictingRoles();
- checkObserverMethods();
+ //checkObserverMethods();
checkScopeAllowed();
registerInterceptors();
setInjectionTarget(new InjectionTarget<T>()
@@ -388,7 +388,7 @@
}
// TODO must be a nicer way to do this!
- public boolean isMethodExistsOnTypes(WeldMethod<?, ?> method)
+ private boolean isMethodExistsOnTypes(WeldMethod<?, ?> method)
{
for (Type type : getTypes())
{
Modified: core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
===================================================================
--- core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2010-01-25 17:32:42 UTC
(rev 5622)
+++ core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2010-01-25 20:32:26 UTC
(rev 5623)
@@ -53,6 +53,12 @@
<exclude name="testEJBDecoratorInvocation" />
</methods>
</class>
+ <!-- WELD-401 -->
+ <class
name="org.jboss.jsr299.tck.tests.event.broken.observer.notBusinessMethod.EJBObserverMethodNotBusinessMethodTest">
+ <methods>
+ <exclude
name="testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails" />
+ </methods>
+ </class>
<!-- Issues in JBoss AS -->
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Bird.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Bird.java
(rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Bird.java 2010-01-25
20:32:26 UTC (rev 5623)
@@ -0,0 +1,11 @@
+package org.jboss.weld.tests.enterprise;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface Bird
+{
+
+ public void observe(Feed feed);
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Bird.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Capercaillie.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Capercaillie.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Capercaillie.java 2010-01-25
20:32:26 UTC (rev 5623)
@@ -0,0 +1,24 @@
+package org.jboss.weld.tests.enterprise;
+
+import javax.ejb.Stateful;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+
+@Stateful
+@RequestScoped
+public class Capercaillie implements Scottish, Bird
+{
+
+ private Feed feed;
+
+ public void observe(@Observes Feed feed)
+ {
+ this.feed = feed;
+ }
+
+ public Feed getFeed()
+ {
+ return feed;
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Capercaillie.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/EnterpriseBeanTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/EnterpriseBeanTest.java 2010-01-25
17:32:42 UTC (rev 5622)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/EnterpriseBeanTest.java 2010-01-25
20:32:26 UTC (rev 5623)
@@ -72,4 +72,12 @@
assert false : "Expected a BowlerHatException to be in the cause stack";
}
+ @Test(description="WELD-364", groups = "broken")
+ public void testEJBRemoteInterfacesOkForObservers()
+ {
+ Feed feed = new Feed();
+ getCurrentManager().fireEvent(feed);
+ assert getReference(Scottish.class).getFeed().equals(feed);
+ }
+
}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Feed.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Feed.java
(rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Feed.java 2010-01-25
20:32:26 UTC (rev 5623)
@@ -0,0 +1,6 @@
+package org.jboss.weld.tests.enterprise;
+
+public class Feed
+{
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Feed.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Scottish.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Scottish.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Scottish.java 2010-01-25
20:32:26 UTC (rev 5623)
@@ -0,0 +1,11 @@
+package org.jboss.weld.tests.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface Scottish
+{
+
+ public Feed getFeed();
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/enterprise/Scottish.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/scope/unproxyable/UnproxyableTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/scope/unproxyable/UnproxyableTest.java 2010-01-25
17:32:42 UTC (rev 5622)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/scope/unproxyable/UnproxyableTest.java 2010-01-25
20:32:26 UTC (rev 5623)
@@ -28,7 +28,8 @@
public class UnproxyableTest extends AbstractWeldTest
{
- @Test
+ @Test(groups = "incontainer-broken")
+ //JBoss AS is producing the wrong exception.
public void test()
{
Show replies by date