[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-992) Use Spring configured EntityManagerFactory in spring example

Ian Hlavats (JIRA) jira-events at lists.jboss.org
Tue Mar 6 14:39:23 EST 2007

    [ http://jira.jboss.com/jira/browse/JBSEAM-992?page=comments#action_12355189 ] 
Ian Hlavats commented on JBSEAM-992:

For unit testing, if I use a Seam-managed persistence context then I am using the embedded EJB container with TestNG. 

How do you test Spring integration with this approach?

How do you bootstrap a Spring WebApplicationContext in a mock servlet environment?

So far I have been creating the Spring application context from my EJBs and getting Spring beans directly in my Seam components (during @Create or @PostConstruct, not using @In).

The other option, to use a Spring-managed persistence context, would lend itself to standalone unit testing, but the Hibernate entity manager does not work without the EJB container running.

How do you get the Hibernate EntityManager in a standalone unit test? I don't think a JNDI lookup will work here.

Some guidance here would be much appreciated.

> Use Spring configured EntityManagerFactory in spring example
> ------------------------------------------------------------
>                 Key: JBSEAM-992
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-992
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: Spring
>    Affects Versions: 1.2.0.GA
>            Reporter: youngm
>             Fix For: 1.2.1.GA
> Since most Spring project will be using a Spring configured EntityManagerFactory we should use one in the Spring example as well and inject this EntityManagerFactory into the Seam Managed PersistenceContext component with an expression.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list