1 Reply Latest reply on Sep 13, 2011 8:48 AM by aslak

    Bind CommandRunner for Embedded Glassfish on start

    magnus.smith

      I was thinking that it would be really useful if the Glassfish CommandRunner could be bound to jndi when the embedded container is started.

       

      Looks like it would just be a case of adding

       

      {code:java}

      CommandRunner commandRunner = glassfish.getCommandRunner();

      new InitialContext().bind("org.glassfish.embeddable.CommandRunner", commandRunner);

      {code}

       

       

      to the start method on the GlassfishContainer and then unbinding it on the stop method.

       

      Then in the test class we could use

       

      {code:java}

      @Resource(mappedName = "org.glassfish.embeddable.CommandRunner")

      CommandRunner commandRunner

      {code}

       

      This would open up all the glassfish admin commands from test classes.

        • 1. Re: Bind CommandRunner for Embedded Glassfish on start
          aslak

          You want to create a JIRA and make a pull request on this ?

           

          First though,  i'm sceptical since this opens up to control a lot of things outside of Arquillians control and makes it very easy to create inconsistent state between TestClasses.. but, in the current form Arquillian is missing the abstraction of adding Resources to GlassFish (which i do see is useful)..

           

          -aslak-