0 Replies Latest reply on Aug 11, 2011 5:19 AM by omid pourhadi

    EntityQuery Test NG

    omid pourhadi Apprentice

      Hi,


      i created a class extends EntityQuery after i want to test it via TestNG i've got this Exception :



      Could not instantiate Seam component: projWbsQuery :




      Caused by: java.lang.IllegalArgumentException: 
      EntityManagerFactory not found in JNDI : java:/entityManager
      Caused by: javax.naming.NameNotFoundException: entityManager not bound
      



      How can i bind entityManager in TestNG for running entityQuery ?


      any help appreciate


      ProjWbsQ.java




      public class ProjWbsQ extends SeamTest {
      
           @Test
           public void testQuery() throws Exception{
                new FacesRequest("/eps/epsProjList.xhtml"){
                     protected void updateModelValues() throws Exception{
                          ProjWbsQuery proQ = (ProjWbsQuery)  Component.getInstance("projWbsQuery");
                          Project proj = proQ.getProjwbs().getProject();
                          proj.setProjectFlag("Y");
                          proQ.getProjwbs().setProject(proj);                    
                     }
                     protected void invokeApplication() throws Exception {
                          invokeMethod("#{projWbsQuery.epsProjOnly}");
                     }
                     protected void renderResponse() throws Exception {
                          assert (Boolean) getValue("#{projWbsQuery.resultCount eq>=0}");
                     }
      
      
                }.run();
           }
           
      }