4 Replies Latest reply on Feb 24, 2013 3:25 AM by Adrien Adrien

    [ARQ-GRAPHENE]Migration from jsfunit : how to use local ejb in the client side with graphene

    Adrien Adrien Apprentice

      Hi

      I'm actually lookup to begin to migrate my jsfunit   tests to arquillian / graphene and i ve some problems.

       

      Problem :I can't lookup a local ejb (lookup naming exception) in a graphene test

       

      I m using

      • richfaces 4.3 / mojarra 2.16/ jboss 7.1.1 / face-config.xml (no cdi)
      • arquillian/graphen in  remote to execute my test on a jboss 7.1.1 already started, (jboss-as-arquillian-container-remote)

      So I would like to know if :

      • Is it possible than the graphene client run in the same remote container  with my application.ear ?
      • If yes, isit possible to use local ejb with graphene?

      Actually I launch my test from eclipse (right button test on the test class), all full server tests run well, pure graphene run well, but use graphene and access local ejb don't work.

       

      I m certainly mis undestanding, but if i set @Deployment(testable=true)  the all the tests is executed on the remote container, the @Runclient is forced to run the client part in the remote container?

       

       

      Thanks for your help

      Adrien

       

      Here , what i've try

       

      @RunWith(Arquillian.class) 

      public class MFindersClientOnServerTest {

      private static final String WEBAPP_SRC = "D:\\myExistingProject-0.0.1-SNAPSHOT";

          @ArquillianResource

          URL contextPath;

         

          @Drone

          WebDriver driver;

       

      //force execution on server

      @Deployment(testable=true)    

          public static WebArchive createDeployment() {

          //archive from  existing application

           WebArchive war = ShrinkWrap.create(WebArchive.class, WebDriverLoginPage.class.getName()+".war");

           war.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)

               .importDirectory(WEBAPP_SRC).as(GenericArchive.class),

               "/", Filters.includeAll()); 

          

           return (WebArchive) war;

          }

         

          @Test

          @RunAsClient

          public void alogin(){

               assertNotNull( lookup();) // cause naming exception, impossible lookup

              

          }

         

          private static Object lookup( ) {

              InitialContext ctx;

              try {

                  ctx = new InitialContext();           

                  //String name = "java:module/MFinderBeanImpl;

                  //String name = "java:app/test/"+c.getSimpleName();

                  String name = "java:app/test/MFinderBeanImpl;           

                  return ctx.lookup(name);

              } catch (NamingException e) {           

                  e.printStackTrace();           

              }

          }