File tree 2 files changed +66
-0
lines changed
main/java/org/javaee7/ejb/stateful
test/java/org/javaee7/ejb/stateful
2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .javaee7 .ejb .stateful ;
2
+
3
+ import javax .annotation .Resource ;
4
+ import javax .ejb .SessionContext ;
5
+ import javax .ejb .Stateful ;
6
+
7
+ /**
8
+ *
9
+ * @author Arjan Tijms
10
+ *
11
+ */
12
+ @ Stateful
13
+ public class ReentrantStatefulBean {
14
+
15
+ @ Resource
16
+ private SessionContext sessionConext ;
17
+
18
+ public void initialMethod () {
19
+ sessionConext .getBusinessObject (ReentrantStatefulBean .class ).reentrantMehthod ();
20
+ }
21
+
22
+ public void reentrantMehthod () {
23
+
24
+ }
25
+
26
+ }
Original file line number Diff line number Diff line change
1
+ package org .javaee7 .ejb .stateful ;
2
+
3
+ import javax .inject .Inject ;
4
+
5
+ import org .jboss .arquillian .container .test .api .Deployment ;
6
+ import org .jboss .arquillian .junit .Arquillian ;
7
+ import org .jboss .shrinkwrap .api .Archive ;
8
+ import org .jboss .shrinkwrap .api .ShrinkWrap ;
9
+ import org .jboss .shrinkwrap .api .spec .WebArchive ;
10
+ import org .junit .Test ;
11
+ import org .junit .runner .RunWith ;
12
+
13
+ /**
14
+ * This tests that a stateful bean is capable of calling a method via
15
+ * a business proxy on itself.
16
+ *
17
+ * @author Arjan Tijms
18
+ *
19
+ */
20
+ @ RunWith (Arquillian .class )
21
+ public class ReentrantCallTest {
22
+
23
+ @ Inject
24
+ private ReentrantStatefulBean reentrantStatefulBean ;
25
+
26
+ @ Deployment
27
+ public static Archive <?> deployment () {
28
+ return ShrinkWrap .create (WebArchive .class )
29
+ .addClass (ReentrantStatefulBean .class );
30
+ }
31
+
32
+
33
+ @ Test
34
+ public void doReentrantCall () {
35
+ // initialMethod() will internally call another method on itself.
36
+ // This should not throw an exception. See e.g. https://issues.apache.org/jira/browse/OPENEJB-1099
37
+ reentrantStatefulBean .initialMethod ();
38
+ }
39
+
40
+ }
You can’t perform that action at this time.
0 commit comments