0 Replies Latest reply on Dec 24, 2013 6:34 AM by Vijay Nair

    Arquillian Newbie - EJB Testing - Glassfish Remote 3.1.2

    Vijay Nair Newbie

      Dear All,

       

      I am in the process of writing some Arquillian test cases for an EJB 3.0 application using Arquillian (1.1.0) and Glassfish Remote (3.1.2 using Arquillian-Glassfish Remote library (1.0.0.CR4).

       

      Try as I might, I am unable to get it working. I am relatively new to EJB 3.0 too so please excuse my knowledge in advance.

       

      Here is my EJB Local Interface Code and EJB Code

       

      @Local
      public interface IELEJBLocal {
          public String processUIRequest(String reqXml) throws Exception;
         public String processGwRequest(String reqXml) throws Exception;
      }
      
      @Stateless(name="EJB1Halo")
      public class EJB1 implements IELEJBLocal {
      
         
          public String processUIRequest(String reqXml) throws Exception{
              System.out.println("**UI Request has been processed");
              return null;
          }
      
          public String processGwRequest(String reqXml) throws Exception{
              return null;
          }
         
         
      }
      
      

       

      Here is my Arquillian Test Case

       

      @RunWith(Arquillian.class)
      public class ELCMLiabilityOperationsTest {
          
          @Deployment
           public static JavaArchive createDeployment() {
              return ShrinkWrap.create(JavaArchive.class, "NewTest.jar")
                      .addClasses(IELEJBLocal.class, EJB1.class);
              }
           
           @EJB(name="EJB1Halo")
           IELEJBLocal local;
           
           
           @Test
           public void testNormalEJB(){
               try{
                   System.out.println("Local is"+local);
                  local.processUIRequest("");
               }catch(Exception ex){
                   ex.printStackTrace();
               }
           }
      }
      

       

      The output is always shown as indicating that my injection is wrong

      "Local is" + null
      

       

      I can also see the following on the glassfish console when the test starts up

       

      INFO: EJB5181:Portable JNDI names for EJB EJB1Halo: [java:global/test/EJB1Halo, java:global/test/EJB1Halo!com.ofss.elcm.ejb.IELEJBLocal]
      

       

       

      Any help is greatly appreciated. Thanks in advance.

       

      Regards..Vijay