Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-592

Bind CommandRunner to JNDI when GlassFish Embedded Container starts

    XMLWordPrintable

Details

    Description

      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

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

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

      Then in the test class we could use

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

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

      api http://embedded-glassfish.java.net/nonav/apidocs/org/glassfish/embeddable/CommandRunner.html
      asadmin http://download.oracle.com/docs/cd/E18930_01/html/821-2416/giobi.html#scrolltoc

      Attachments

        Activity

          People

            magnus.smith Magnus Smith (Inactive)
            magnus.smith Magnus Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: