Version 19

    What to do when you need to add a test requiring a custom configuration of JBoss.

     

    Make the custom configuration

     

    This is part of your test target in testsuite/build.xml

     

    Custom jboss configurations can be added using the create-config macro as demonstrated by this tomcat-sso-tests target. The create-config macro has the following attributes/elements:

     

    • baseconf : the existing jboss configuration that will be used as the base configuration to copy

    • newconf : the name of the new configuration being created

    • patternset : this is the equivalent of the standard patternset element which is used to restrict which content from the baseconf is to be copied into newconf.

     

    This macro makes a new config whose name is given by the newconf attribute by copying the config given by the baseconf. The content that   is copied from baseconf is limited to the patternset nested element. In addition, any content under /testsuite/src/resources/test-configs/@ is also copied.

     

    If you need to override configuration settings or add new content, create a directory with the same name as the newconf attribute value under the testsuite/src/resources/tests-configs directory. In this case, there is a tomcat-sso directory which adds some security files to the conf directory, removes the jbossweb sar dependencies it does not need, and enables the sso valve in the server.xml:

     

    $ ls -R src/resources/test-configs/tomcat-sso
    src/resources/test-configs/tomcat-sso:
    CVS/  conf/  deploy/
    
    src/resources/test-configs/tomcat-sso/conf:
    CVS/  login-config.xml*  sso-roles.properties*  sso-users.properties*
    
    src/resources/test-configs/tomcat-sso/deploy:
    CVS/  jbossweb-tomcat50.sar/
    
    src/resources/test-configs/tomcat-sso/deploy/jbossweb-tomcat50.sar:
    CVS/  META-INF/  server.xml*
    
    src/resources/test-configs/tomcat-sso/deploy/jbossweb-tomcat50.sar/META-INF:
    CVS/  jboss-service.xml*
    

    The full tomcat-sso-tests target is show here.

       <target name="tomcat-sso-tests"
          description="Tomcat tests requiring SSO configured">
          <!-- Create the sso enabled tomcat config starting with the default config -->
          <create-config baseconf="default" newconf="tomcat-sso">
             <patternset>
                <include name="conf/**" ></include>
                <include name="deploy/jbossweb*.sar/**" ></include>
                <include name="deploy/jmx-invoker-adaptor-server.sar/**" ></include>
                <include name="lib/**" ></include>
             </patternset>
          </create-config>
          <server:start name="tomcat-sso"></server:start>
          --YOUR JUNIT TESTS--
          <server:stop name="tomcat-sso"></server:stop>
       </target>
    

     

     

    Add your server configuration.

     

    Add your configuration to the tag.

     

    For more information refer the wiki page on ServerControllerTasks

     

    Starting and stopping the server

     

    Use the <server:start> and <server:stop> with the name of the configuration to be started.

     

    This could be part of your tests target after you have created the configuration.

     

    For more information refer the wiki page on ServerControllerTasks