4

I have a few SessionScoped beans that I would like to test and it occurred to me that I am not testing what happens when they get passivated.

I would very much like to resolve this gap within the integration testing. However, there doesn't seem to be easy to find documentation on this.

I have found a question with regards to how to do with OpenEJB but I don't think that'll work for me.

Ideally, I would like a platform independent way that works with Arquillian but I will settle for something that'll work with JBoss 7.x.

Community
  • 1
  • 1
drone.ah
  • 1,135
  • 14
  • 28
  • What do you intend to test upon bean passivation? The JBoss AS 7 test suite does have [a test](https://github.com/jbossas/jboss-as/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/stateful/passivation/PassivationSucceedsUnitTestCase.java) that could help you, but I'm not entirely sure if that would help. It would require configuring the passivation store `max-size` and/or `idle-timeout` values. – Vineet Reynolds Feb 25 '13 at 15:44
  • I have a session scoped bean which contains some data. Some of these are defined as transient and I would like to test this does not break the bean on use after passivation. – drone.ah Feb 25 '13 at 17:22
  • Did you need to test the passivation/reactivation process or the process within JBoss AS 7? If just the former, then use the serialization/deserialization functionality within Java EE 6. If the latter, then that is a harder thing to do and you will have to come up with some good reasons why you don't trust JBoss AS 7. – Bob Dalgleish Apr 30 '13 at 23:30
  • I would like to test that the fields that I have marked as transient does not break the bean when it is reactivated... – drone.ah May 03 '13 at 13:29

0 Answers0