Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.javaee7.ejb.stateful;

import javax.annotation.Resource;
import javax.ejb.SessionContext;
import javax.ejb.Stateful;

/**
*
* @author Arjan Tijms
*
*/
@Stateful
public class ReentrantStatefulBean {

@Resource
private SessionContext sessionConext;

public void initialMethod() {
sessionConext.getBusinessObject(ReentrantStatefulBean.class).reentrantMehthod();
}

public void reentrantMehthod() {

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.javaee7.ejb.stateful;

import javax.inject.Inject;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
* This tests that a stateful bean is capable of calling a method via
* a business proxy on itself.
*
* @author Arjan Tijms
*
*/
@RunWith(Arquillian.class)
public class ReentrantCallTest {

@Inject
private ReentrantStatefulBean reentrantStatefulBean;

@Deployment
public static Archive<?> deployment() {
return ShrinkWrap.create(WebArchive.class)
.addClass(ReentrantStatefulBean.class);
}


@Test
public void doReentrantCall() {
// initialMethod() will internally call another method on itself.
// This should not throw an exception. See e.g. https://issues.apache.org/jira/browse/OPENEJB-1099
reentrantStatefulBean.initialMethod();
}

}