[jboss-user] [JBoss Seam] - Re: Unit Testing EL in EJB-QL/HQL

2007-05-13 Thread stu2
Well injection of logs is only saving you this: public Log log = Logging.getLog(RegisterAndLoginTest.class); | I use this outside of SFSBs where unit testing is important. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045302#4045302 Reply to the post

[jboss-user] [JBoss Seam] - Re: Unit Testing EL in EJB-QL/HQL

2007-05-12 Thread zzzz8
mrobinson28 wrote : | So my questions: | | | * From the exception it looks like I may have to provide more than I am currently via something in org.jboss.seam.mock.* e.g currentUser (In the application currentUser is a session scoped component that is instantiated when a user logs

[jboss-user] [JBoss Seam] - Re: Unit Testing EL in EJB-QL/HQL

2007-05-12 Thread matt.drees
Yeah, I mock the log object in my unit tests to get around the fact that there is no application context active. It looks like this, and seems to work ok: | package org.uscm.crs.misc; | | import org.jboss.seam.log.Log; | import org.jboss.seam.log.Logging; | | public class

[jboss-user] [JBoss Seam] - Re: Unit Testing EL in EJB-QL/HQL

2007-04-13 Thread mrobinson28
Ok, in my unit test I originally had: | EntityManager entityManager = emf.createEntityManager(); | I have replaced it with: | EntityManager entityManager = new EntityManagerProxy( emf.createEntityManager() ); | Now the exception is: | java.lang.IllegalStateException: No

[jboss-user] [JBoss Seam] - Re: Unit Testing EL in EJB-QL/HQL

2007-04-12 Thread stu2
I've been using SeamTest in integration mode (I'm not using setField for instance) and the em accepts seam parameters in EJB-QL. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4036731#4036731 Reply to the post :

[jboss-user] [JBoss Seam] - Re: Unit Testing EL in EJB-QL/HQL

2007-04-12 Thread [EMAIL PROTECTED]
If you're using integration tests, Seam will proxy the EM. If you're writing a unit test, and creating your own EM from an EMF, you need to do: EntityManager em = new EntityManagerProxy( emf.createEntityManager() ); View the original post :