I have several @Stateful
SessionBeans annotated like this:
@Stateful
@Remote(AdminFacade.class)
public class TAdminFacadeBean implements TgAdminFacade,Serializable
{
...
}
Now I want to test them with Arquillian (1.0.0.Alpha5), but get lot's of different errors, messages vary either if the annotations are @Stateful
or @Stateless
, if a @Named
is added or if there is no @Remote (and implements
Interface).
Steps to reproduce:
- Create new maven project with archetype org.jboss.weld.archetypes:jboss-javaee6-webapp:1.0.1.CR2
- You might need to set jboss.home (see readme.txt)
- Modify pom.xml and set profiles.profile[id=default].build.plugins.plugin[artifactId=maven-surefire-plugin].configuration.skip to false
- Start JBoss-6.0.0.Final
- Execute test (should pass):
mvn test -Parq-jbossas-remote
The bean tested here ist MemberRegistration
:
@Model
public class MemberRegistration
{
...
}
If you now change @Model
to @Stateful
, JBoss loops with stacktraces, with @Named @Stateful
this error:
java.lang.IllegalArgumentException: ArquillianServletRunner not found.
Could not determine ContextRoot from ProtocolMetadata, please contact
DeployableContainer developer.
@Named @Stateless
:
javax.transaction.NotSupportedException: BaseTransaction.checkTransactionState
- ARJUNA-16051 thread is already associated with a transaction!
How can I test my @Stateful
Beans with Arquillian?