my Problem involves the following toolchain:
- javaee 7 application on a glassfish application Server.
- JSF with Primefaces as GUI Libraries.
- Selenium as GUI Testsuite.
Core Problem is, that i want to reset the Database (postgres/jpa/eclipselink) to a completely fresh state after each Selenium Testcase.
What i have until now is:
- Start of each Selenium Testcase initializes the Database with needed Data for this single test. Therefore it uses its own PersistenceUnit with "drop-and-create-tables".
- A HttpSessionListener that recognizes the testuser when he logs into the Application and then calls EntityManager.clear().
What I do not fully understand is, what happens with the data stored in my session beans? At the time the testuser logs in, each beans @PostConstruct is called and all Lists, Arrays etc. are reinitialized.
How can I be sure that all data stored in SessionBeans and even in the Primefaces caches (e.g. <p:tabview cache="true">
) are discarded?