This content has been marked as final.
Show 6 replies
-
1. Re: injection in tests ?
pmuir Dec 30, 2007 1:52 PM (in response to berkay)Are you running an integration or unit test?
-
2. Re: injection in tests ?
berkay Dec 31, 2007 2:19 AM (in response to berkay)will test both of them..
how can i initialize hibernateSession ? -
3. Re: injection in tests ?
pmuir Dec 31, 2007 5:43 AM (in response to berkay)It depends on which sort of test you are doing... So, which one?
-
4. Re: injection in tests ?
berkay Dec 31, 2007 10:20 AM (in response to berkay)Hi Pete,
It must be unit testing. Here is what I have tried with best of my knowledge. Here is my @BeforeClass method :@BeforeClass public void init(){ try { HibernateSessionFactory hsf=new HibernateSessionFactory(); hibernateSession=hsf.getSessionFactory().openSession(); } catch (HibernateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
I getFAILED CONFIGURATION: @BeforeMethod begin java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application at org.jboss.seam.contexts.Lifecycle.getApplication(Lifecycle.java:36) at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:173) at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:124) at org.jboss.seam.mock.BaseSeamTest.begin(BaseSeamTest.java:918) at org.jboss.seam.mock.SeamTest.begin(SeamTest.java:28)
Happy new year -
-
6. Re: injection in tests ?
pmuir Jan 2, 2008 5:32 AM (in response to berkay)If you are running SeamTest, then it should be an integration test. Post the whole log from the failed test, including the container start.