2 Replies Latest reply on Jun 19, 2014 3:24 AM by jenskreidler

    API for reading current container's properties

    jenskreidler

      Hi,

      it there an API or any possibility to read the current arquillian container's properties before my own tests run?

       

      Assume you have got following arquillian.xml on test classpath, I'd like to read managementPort and managementAdress when arquillian uses either container jbossas-remote or jbossas-local

       

      <arquillian xmlns="http://jboss.org/schema/arquillian"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

       

          <container qualifier="jbossas-remote">

              <configuration>

                  <property name="managementAddress">someHost</property>

                  <property name="managementPort">9975</property>

                  <property name="username">user</property>

                  <property name="password">pass</property>

              </configuration>

          </container>

       

          <container qualifier="jbossas-local">

              <configuration>

                  <property name="managementAddress">localhost</property>

                  <property name="managementPort">9999</property>

                  <property name="username">user</property>

                  <property name="password">pass</property>

              </configuration>

          </container>

      </arquillian>


      Thanks in advance!

        • 1. Re: API for reading current container's properties
          aslak

          No User facing API no, What do you need them for?

           

          If you're just looking to connect to the Management API you can inject @ArquillianResource ManagementClient.

           

          ManagementClient has a method getControllerClient that return a connected ModelControllerClient.

          • 2. Re: API for reading current container's properties
            jenskreidler

            Much thanks Aslak. An instance of ManagementClient is sufficient. I need it to setup my arquillian-enabled integration-test and configure my ejb client against the server, no matter if the current arq-test is running locally (development) or in the CI server using an other maven-profile, thus pointing to an other server.