I need to test Seam component that uses EntityManager. My test is based on 
"Simplicity and power beyond Java EE" book example : 

public class HelloWorldTest extends SeamTest 
  | {
  | 
  | @Test
  | public void unitTestSayHello() throws Exception 
  | {
  |   Manager manager = new ManagerAction ();
  |   EntityManagerFactory emf =
  |    Persistence.createEntityManagerFactory("helloworld");
  |   EntityManager em = emf.createEntityManager();
  |   setField(manager, "em", em);
  |   Person person = new Person ();
  |   person.setName ("Thomas Heute");
  |   setField(manager, "person", person);
  |   setField(manager, "confirmed", false);
  | 

The only difference in my case is initializing EntityManager in @BeforeClass 
method to use it in different @Test methods then. 

What is incorrect ? 




View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109640#4109640

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109640
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to