<?xml version="1.0" encoding="UTF-8"?>

<!-- ============================================================ -->
<!--  JBoss, the OpenSource J2EE webOS                            -->
<!--  Distributable under LGPL license.                           -->
<!--  See terms of license at http://www.gnu.org.                 -->
<!-- ============================================================ -->

<!-- $Id: build-testsuite.xml 4142 2007-08-03 09:32:46Z thomas.diesler@jboss.com $ -->

<project>

  <!-- Define jboss.home -->
  <condition property="jboss.home" value="${jboss50.home}">
    <equals arg1="${jbossws.integration.target}" arg2="jboss50"/>
  </condition>
  <condition property="jboss.home" value="${jboss42.home}">
    <equals arg1="${jbossws.integration.target}" arg2="jboss42"/>
  </condition>
  <condition property="jboss.home" value="${jboss40.home}">
    <equals arg1="${jbossws.integration.target}" arg2="jboss40"/>
  </condition>
  
  <!-- ================================================================== -->
  <!-- Setup                                                              -->
  <!-- ================================================================== -->

  <!-- Verify required properties that must be set before this file is imported -->
  <fail message="Tests output dir not set." unless="tests.output.dir"/>
    
  <!-- Use -Ddebug=true for remote debugging -->
  <condition property="remote.debug.line" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005">
    <isset property="debug"/>
  </condition>
  <condition property="remote.debug.line" value="">
    <not>
      <isset property="debug"/>
    </not>
  </condition>

  <!-- Set a hostname property based on COMPUTERNAME for win32, HOSTNAME
  otherwise and initialize the node0/node1 cluster hostnames to localhost
  and ${hostname} by default. If you cannot route multicast traffic between
  localhost and hostname, then you need to specify node0 and node1 binding
  in the local.properties that can in order to be able to run the clustering
  tests.
  -->
  <property environment="env"/>
  <condition property="hostname" value="${env.COMPUTERNAME}">
    <os family="windows"/>
  </condition>
  <condition property="hostname" value="${env.HOSTNAME}">
    <not>
      <os family="windows"/>
    </not>
  </condition>

  <!-- node0 defaults -->
  <property name="node0" value="${jboss.bind.address}"/>
  <property name="node0.http.url" value="http://${node0}:8080"/>
  <property name="node0.jndi.url" value="jnp://${node0}:1099"/>
  <property name="node0.hajndi.url" value="jnp://${node0}:1100"/>

  <!-- ================================================================== -->
  <!-- Initialization                                                     -->
  <!-- ================================================================== -->

  <target name="tests-prepare">

    <mkdir dir="${tests.output.dir}/log"/>
    <delete file="${tests.output.dir}/log/test.log"/>

    <property name="jboss.client" value="${jboss.home}/client"/>
    <property name="jboss.lib" value="${jboss.home}/lib"/>
    <property name="jboss.server" value="${jboss.home}/server/${jboss.server.instance}"/>
    <property name="jboss.server.lib" value="${jboss.server}/lib"/>
    <property name="jboss.server.deploy" value="${jboss.server}/deploy"/>
  
    <!-- Java Endorsed -->
    <condition property="endorsed.dirs" value="${jboss.home}/lib/endorsed">
      <isset property="jboss.home"/>
    </condition>

    <echo/>
    <echo message="-----------------------------------------------"/>
    <echo message="jboss.home   = ${jboss.home}"/>
    <echo message="excludesfile = ${excludesfile}"/>
    <echo message="java.home    = ${java.home}"/>
    <echo message="jboss.bind   = ${jboss.bind.address}"/>
    <echo message="-----------------------------------------------"/>
    
    <tstamp>
      <format property="build.id" pattern="yyyyMMddHHmm"/>
    </tstamp>
  </target>

  <target name="tests-classpath" depends="tests-classpath-jboss50,tests-classpath-jboss42,tests-classpath-jboss40"/>
  
  <target name="tests-classpath-jboss50" depends="tests-prepare" if="jbossws.integration.jboss50">
    
    <path id="tests.javac.classpath">
      <path refid="ws.stack.classpath"/>
      <path refid="tests.extra.classpath"/>
      <pathelement location="${jboss.client}/activation.jar"/>
      <pathelement location="${jboss.client}/jaxws-tools.jar"/>
      <pathelement location="${jboss.client}/jboss-annotations-ejb3.jar"/>
      <pathelement location="${jboss.client}/jboss-common-core.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
      <pathelement location="${jboss.client}/jboss-logging-spi.jar"/>
      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
      <pathelement location="${jboss.client}/mail.jar"/>
		  <pathelement location="${jboss.client}/wsdl4j.jar"/>
      <pathelement location="${jboss.server.lib}/jboss-javaee.jar"/>
      <pathelement location="${jboss.server.lib}/jbosssx.jar"/>
      <pathelement location="${jboss.server.lib}/servlet-api.jar"/>
    </path>
    
    <!-- 
      The 'tests.client.classpath' contains jars that are available in the target container's client directory.
      There jars apply to all supported stacks. It MUST NOT contains jars from a local thirdparty dir.
      
      The 'ws.stack.classpath' contains jars that come with a specific stack distribution.
      The 'tests.extra.classpath' contains stack specific jars that are needed to run the stack specific tests.
    -->
    <path id="tests.client.classpath">
      <path refid="ws.stack.classpath"/>
      <path refid="tests.extra.classpath"/>
      <pathelement location="${jboss.client}/activation.jar"/>
      <pathelement location="${jboss.client}/javassist.jar"/>
      <pathelement location="${jboss.client}/jaxb-api.jar"/>
      <pathelement location="${jboss.client}/jaxb-impl.jar"/>
      <pathelement location="${jboss.client}/jaxb-xjc.jar"/>
      <pathelement location="${jboss.client}/jboss-jboss50.jar"/>
      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
      <pathelement location="${jboss.client}/jbossall-client.jar"/>
      <pathelement location="${jboss.client}/jbossws-jboss50.jar"/>
      <pathelement location="${jboss.client}/log4j.jar"/>
      <pathelement location="${jboss.client}/mail.jar"/>
      <pathelement location="${jboss.client}/stax-api.jar"/>
      <!-- FIXME jars should be available in the client dir -->
      <pathelement location="${jboss.lib}/jboss-aop-jdk50.jar"/>
      <pathelement location="${jboss.lib}/jboss-vfs.jar"/>
      <pathelement location="${jboss.server.lib}/jboss.jar"/>
      <pathelement location="${jboss.server.lib}/jbosssx.jar"/>
      <pathelement location="${jboss.server.lib}/hibernate3.jar"/>
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi.jar"/>
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi-saaj.jar"/>
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/scout.jar"/>
      <pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
    </path>
  </target>
  
  <target name="tests-classpath-jboss42" depends="tests-prepare" if="jbossws.integration.jboss42">
    
    <path id="tests.javac.classpath">
      <path refid="ws.stack.classpath"/>
      <path refid="tests.extra.classpath"/>
      <pathelement location="${jboss.client}/activation.jar"/>
      <pathelement location="${jboss.client}/jaxb-api.jar"/>
      <pathelement location="${jboss.client}/jaxb-impl.jar"/>
      <pathelement location="${jboss.client}/jboss-annotations-ejb3.jar"/>
      <pathelement location="${jboss.client}/jboss-common-client.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3x.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
      <pathelement location="${jboss.client}/jboss-j2ee.jar"/>
      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
      <pathelement location="${jboss.client}/jbosssx-client.jar"/>
      <pathelement location="${jboss.client}/mail.jar"/>
      <pathelement location="${jboss.client}/stax-api.jar"/>
      <pathelement location="${jboss.client}/wsdl4j.jar"/>
      <pathelement location="${jboss.server.lib}/servlet-api.jar"/>
    </path>
    
    <!-- 
      The 'tests.client.classpath' contains jars that are available in the target container's client directory.
      There jars apply to all supported stacks. It MUST NOT contains jars from a local thirdparty dir.
      
      The 'ws.stack.classpath' contains jars that come with a specific stack distribution.
      The 'tests.extra.classpath' contains stack specific jars that are needed to run the stack specific tests.
    -->
    <path id="tests.client.classpath">
      <path refid="ws.stack.classpath"/>
      <path refid="tests.extra.classpath"/>
      <pathelement location="${jboss.client}/activation.jar"/>
      <pathelement location="${jboss.client}/jaxb-api.jar"/>
      <pathelement location="${jboss.client}/jaxb-impl.jar"/>
      <pathelement location="${jboss.client}/commons-logging.jar"/>
      <pathelement location="${jboss.client}/javassist.jar"/>
      <pathelement location="${jboss.client}/jaxb-xjc.jar"/>
      <pathelement location="${jboss.client}/jboss-annotations-ejb3.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3x.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
      <pathelement location="${jboss.client}/jbossws-jboss42.jar"/>
      <pathelement location="${jboss.client}/jbossall-client.jar"/>
      <pathelement location="${jboss.client}/log4j.jar"/>
      <pathelement location="${jboss.client}/mail.jar"/>
      <pathelement location="${jboss.client}/stax-api.jar"/>
      <!-- FIXME jars should be available in the client dir -->
      <pathelement location="${jboss.server.deploy}/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>    	
      <pathelement location="${jboss.server.deploy}/jboss-aop-jdk50.deployer/trove.jar"/>    	
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi.jar"/>
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi-saaj.jar"/>
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/scout.jar"/>
      <pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
    </path>
  </target>
  
  <target name="tests-classpath-jboss40" depends="tests-prepare" if="jbossws.integration.jboss40">
    <path id="tests.javac.classpath">
      <path refid="ws.stack.classpath"/>
      <path refid="tests.extra.classpath"/>
      <pathelement location="${jboss.client}/activation.jar"/>
      <pathelement location="${jboss.client}/jaxb-api.jar"/>
      <pathelement location="${jboss.client}/jaxb-impl.jar"/>
      <pathelement location="${jboss.client}/jboss-annotations-ejb3.jar"/>
      <pathelement location="${jboss.client}/jboss-common-client.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3x.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
      <pathelement location="${jboss.client}/jboss-j2ee.jar"/>
      <pathelement location="${jboss.client}/jboss-remoting.jar"/>
      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
      <pathelement location="${jboss.client}/mail.jar"/>
      <pathelement location="${jboss.client}/wsdl4j.jar"/>		
      <pathelement location="${jboss.client}/stax-api.jar"/>
      <pathelement location="${jboss.client}/jbosssx-client.jar"/>
      <pathelement location="${jboss.server.lib}/javax.servlet.jar"/>
    </path>
    
    <!-- 
      The 'tests.client.classpath' contains jars that are available in the target container's client directory.
      There jars apply to all supported stacks. It MUST NOT contains jars from a local thirdparty dir.
      
      The 'ws.stack.classpath' contains jars that come with a specific stack distribution.
      The 'tests.extra.classpath' contains stack specific jars that are needed to run the stack specific tests.
    -->
    <path id="tests.client.classpath">
      <path refid="ws.stack.classpath"/>
      <path refid="tests.extra.classpath"/>
      <pathelement location="${jboss.client}/commons-logging.jar"/>
      <pathelement location="${jboss.client}/javassist.jar"/>
      <pathelement location="${jboss.client}/jaxb-xjc.jar"/>
      <pathelement location="${jboss.client}/jboss-aop-jdk50-client.jar"/>
      <pathelement location="${jboss.client}/jboss-aspect-jdk50-client.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3x.jar"/>
      <pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
      <pathelement location="${jboss.client}/jboss-saaj.jar"/>
      <pathelement location="${jboss.client}/jbossws-jboss40.jar"/>
      <pathelement location="${jboss.client}/jbossall-client.jar"/>
      <pathelement location="${jboss.client}/log4j.jar"/>
      <pathelement location="${jboss.client}/mail.jar"/>
      <pathelement location="${jboss.client}/stax-api.jar"/>
      <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
      <!-- FIXME jars should be available in the client dir -->
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi.jar"/>
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/juddi-saaj.jar"/>
      <pathelement location="${jboss.server.deploy}/juddi-service.sar/scout.jar"/>
      <pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
    </path>
  </target>
  
  <!-- ================================================================== -->
  <!-- Compiling                                                          -->
  <!-- ================================================================== -->

  <macrodef name="macro-compile-classes">
    <attribute name="excludesfile"/>
    <attribute name="srcdir"/>
    <sequential>
      <mkdir dir="${tests.output.dir}/classes"/>
      <javac destdir="${tests.output.dir}/classes" debug="${javac.debug}" encoding="utf-8" verbose="${javac.verbose}" deprecation="${javac.deprecation}"
        failonerror="${javac.fail.onerror}" excludesfile="@{excludesfile}">
        <src path="@{srcdir}"/>
        <classpath refid="tests.javac.classpath"/>
      </javac>
    </sequential>
  </macrodef>
  
  <!-- ================================================================== -->
  <!-- Building                                                           -->
  <!-- ================================================================== -->
  
  <macrodef name="macro-copy-resources">
    <attribute name="srcdir"/>
    <sequential>
      
      <!-- copy etc -->
      <copy todir="${tests.output.dir}/classes">
        <fileset dir="@{srcdir}/etc">
          <include name="jndi.properties"/>
          <include name="tst.policy"/>
          <include name="log4j.xml"/>
          <include name="auth.conf"/>
        </fileset>
        <filterset>
          <filter token="jboss.bind.address" value="${node0}"/>
        </filterset>
      </copy>
      
      <!-- copy handler definitions -->
      <copy todir="${tests.output.dir}/classes">
        <fileset dir="@{srcdir}/java">
          <include name="**/*.xml"/>
        </fileset>
      </copy>
      
      <!-- copy non binary files -->
      <copy todir="${tests.output.dir}/resources">
        <fileset dir="@{srcdir}/resources">
          <include name="**/*.wsdl"/>
          <include name="**/*.xml"/>
          <exclude name="jaxrpc/samples-override/**"/>
        </fileset>
        <filterset>
          <filter token="java.home" value="${java.home}"/>
          <filter token="jboss.bind.address" value="${node0}"/>
          <filter token="tests.output.dir" value="${tests.output.dir}"/>
          <filter token="wsdl-publish-location" value="${tests.output.dir}/wsdl-publish"/>
        </filterset>
      </copy>
      
      <!-- Copy binary files -->
      <copy todir="${tests.output.dir}/resources">
        <fileset dir="@{srcdir}/resources">
          <exclude name="**/*.wsdl"/>
          <exclude name="**/*.xml"/>
        </fileset>
      </copy>
    </sequential>
  </macrodef>
  
  <!-- ================================================================== -->
  <!-- Testing                                                            -->
  <!-- ================================================================== -->
  
  <!-- Run all unit tests and generate a report -->
  <target name="tests" depends="tests-jars" description="Run all unit tests and generate a report">
    <antcall target="tests-run-internal">
      <param name="include.wildcard" value="org/jboss/test/ws/**/*TestCase.class"/>
      <param name="exclude.wildcard" value="no-wildcard-exclude-see-excludesfile"/>
      <param name="haltonfailure" value="false"/>
    </antcall>
    <antcall target="tests-report"/>
  </target>

  <!-- Run smoke test cases -->
  <target name="tests-smoke" depends="tests-init" description="Run smoke unit tests">
    <antcall target="tests-run-internal">
      <param name="include.wildcard" value="org/jboss/test/ws/jaxws/samples/**/*TestCase.class org/jboss/test/ws/*/smoke/**/*TestCase.class"/>
      <param name="exclude.wildcard" value="org/jboss/test/ws/*/samples/jaxr/**"/>
      <!--
        According to our commit policy, haltonfailure MUST be be true for tests-samples.
        It is a prerequisite for any commit that this target passes without failure.
      -->
      <param name="haltonfailure" value="true"/>
    </antcall>
    <antcall target="tests-report"/>
  </target>

  <!-- Run samples test cases -->
  <target name="tests-samples" depends="tests-init" description="Run samples unit tests">
    <antcall target="tests-run-internal">
      <param name="include.wildcard" value="org/jboss/test/ws/*/samples/**/*TestCase.class"/>
      <param name="exclude.wildcard" value="org/jboss/test/ws/*/samples/jaxr/**"/>      
    </antcall>    
  </target>
  
  <!-- Run integration test cases -->
  <target name="tests-integration" depends="tests-jars" description="Run integration unit tests">
    <antcall target="tests-run-internal">
      <param name="include.wildcard" value="org/jboss/test/ws/jaxws/samples/**/*TestCase.class org/jboss/test/ws/*/smoke/**/*TestCase.class"/>
      <param name="exclude.wildcard" value="org/jboss/test/ws/*/samples/jaxr/**"/>
      <param name="haltonfailure" value="false"/>
    </antcall>
    <antcall target="tests-report"/>
  </target>
  
  <!--
     Run a collection of unit tests.
     ant -Dtest=jaxws/samples/provider test
  -->
  <target name="test" depends="tests-init" if="test" description="Run all unit tests in a given directory">
    <antcall target="tests-run-internal">
      <param name="include.wildcard" value="org/jboss/test/ws/${test}/**/*TestCase.class"/>
      <param name="exclude.wildcard" value="no-wildcard-exclude-see-excludesfile"/>
      <param name="haltonfailure" value="false"/>
    </antcall>
  </target>
  
  <!-- Common test target -->
  <target name="tests-run-internal" depends="tests-init">
    <mkdir dir="${tests.output.dir}/reports"/>
    <junit printsummary="yes" showoutput="yes" dir="${tests.output.dir}" haltonfailure="${haltonfailure}">
      <jvmarg value="-Djava.security.manager"/>
      <sysproperty key="build.testlog" value="${tests.output.dir}/log"/>
      <sysproperty key="client.scenario" value="${client.scenario}"/>
      <sysproperty key="java.endorsed.dirs" value="${endorsed.dirs}"/>
      <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
      <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.virtual.protocol"/>
      <sysproperty key="java.security.policy" value="${tests.output.dir}/classes/tst.policy"/>
      <sysproperty key="jboss.home" value="${jboss.home}"/>
      <sysproperty key="jboss.server.instance" value="${jboss.server.instance}"/>
      <sysproperty key="jboss.bind.address" value="${node0}"/>
      <sysproperty key="jbossws.integration.target" value="${jbossws.integration.target}"/>
      <sysproperty key="jmx.authentication.username" value="${jmx.authentication.username}"/>
      <sysproperty key="jmx.authentication.password" value="${jmx.authentication.password}"/>
      <sysproperty key="java.security.auth.login.config" value="${tests.output.dir}/classes/auth.conf"/>
      <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.keystore"/>
      <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.truststore"/>
      <sysproperty key="org.jboss.ws.wsse.keyStorePassword" value="jbossws"/>
      <sysproperty key="org.jboss.ws.wsse.trustStorePassword" value="jbossws"/>
      <sysproperty key="org.jboss.ws.wsse.keyStoreType" value="jks"/>
      <sysproperty key="org.jboss.ws.wsse.trustStoreType" value="jks"/>
      <classpath>
        <path refid="tests.client.classpath"/>
        <pathelement location="${tests.output.dir}/classes"/>
      </classpath>
      <formatter type="plain" usefile="true"/>
      <formatter type="xml" usefile="true"/>
      <batchtest todir="${tests.output.dir}/reports" fork="true">
        <fileset dir="${tests.output.dir}/classes" includes="${include.wildcard}" excludes="${exclude.wildcard}"/>
      </batchtest>
    </junit>
  </target>
  
  <!--
     Run a single unit test.
     ant -Dtest=org.jboss.test.ws.jaxws.samples.provider.ProviderPayloadTestCase one-test
  -->
  <target name="one-test" depends="tests-init" if="test" description="Run a single unit test">
    <mkdir dir="${tests.output.dir}/reports"/>
    <junit printsummary="yes" showoutput="yes" dir="${tests.output.dir}">
      <jvmarg line="${remote.debug.line}"/>
      <jvmarg value="-Djava.security.manager"/>
      <sysproperty key="build.testlog" value="${tests.output.dir}/log"/>
      <sysproperty key="client.scenario" value="${client.scenario}"/>
      <sysproperty key="java.endorsed.dirs" value="${endorsed.dirs}"/>
      <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
      <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.virtual.protocol"/>
      <sysproperty key="java.security.policy" value="${tests.output.dir}/classes/tst.policy"/>
      <sysproperty key="jboss.home" value="${jboss.home}"/>
      <sysproperty key="jboss.server.instance" value="${jboss.server.instance}"/>
      <sysproperty key="jboss.bind.address" value="${node0}"/>
      <sysproperty key="jbossws.integration.target" value="${jbossws.integration.target}"/>
      <sysproperty key="jmx.authentication.username" value="${jmx.authentication.username}"/>
      <sysproperty key="jmx.authentication.password" value="${jmx.authentication.password}"/>
      <sysproperty key="java.security.auth.login.config" value="${tests.output.dir}/classes/auth.conf"/>
      <!--
      http://jira.jboss.com/jira/browse/JBWS-917
      <sysproperty key="javax.net.ssl.keyStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.keystore"/>
      <sysproperty key="javax.net.ssl.trustStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.truststore"/>
      <sysproperty key="javax.net.ssl.keyStorePassword" value="jbossws"/>
      <sysproperty key="javax.net.ssl.trustStorePassword" value="jbossws"/>
      <sysproperty key="javax.net.ssl.keyStoreType" value="jks"/>
      <sysproperty key="javax.net.ssl.trustStoreType" value="jks"/>
      -->
      <!-- HTTPS hostname wrong:  should be <localhost> -->
      <sysproperty key="org.jboss.security.ignoreHttpsHost" value="true"/>
      <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.keystore"/>
      <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.truststore"/>
      <sysproperty key="org.jboss.ws.wsse.keyStorePassword" value="jbossws"/>
      <sysproperty key="org.jboss.ws.wsse.trustStorePassword" value="jbossws"/>
      <sysproperty key="org.jboss.ws.wsse.keyStoreType" value="jks"/>
      <sysproperty key="org.jboss.ws.wsse.trustStoreType" value="jks"/>
      <classpath>
        <path refid="tests.client.classpath"/>
        <pathelement location="${tests.output.dir}/classes"/>
      </classpath>
      <formatter type="plain" usefile="true"/>
      <formatter type="xml" usefile="true"/>
      <test todir="${tests.output.dir}/reports" name="${test}" fork="true"/>
    </junit>
  </target>
  
  <!-- ================================================================== -->
  <!-- Reporting                                                          -->
  <!-- ================================================================== -->
  
  <!-- Build the tests report -->
  <target name="tests-report" depends="tests-init" description="Build the tests report">
    <mkdir dir="${tests.output.dir}/reports"/>
    <junitreport todir="${tests.output.dir}/reports">
      <fileset dir="${tests.output.dir}/reports">
        <include name="TEST-*.xml"/>
      </fileset>
      <report format="frames" todir="${tests.output.dir}/reports/html"/>
    </junitreport>
    <zip destfile="${tests.output.dir}/test-report-${build.id}.zip">
      <fileset dir="${tests.output.dir}" includes="reports/**"/>
    </zip>
  </target>
  
  <!-- ================================================================== -->
  <!-- Cleaning                                                           -->
  <!-- ================================================================== -->
  
  <target name="tests-clean" description="Delete all generated test files.">
    <delete dir="${tests.output.dir}"/>
  </target>
  
</project>
