<?xml version="1.0"?>
<!--

    Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<project name="Assertion Coverage Generation" default="usage" basedir=".">
  
  <!-- ######################################################################## -->
  <!-- ######################################################################## -->
  <!--  This ant build file generates the coverage numbers for each technology  -->
  <!--  area that is part of the J2EE TCK.  Each technology area has a target   -->
  <!--  defined in this file which generates the coverage numbers for that      -->
  <!--  technology area.  There is also an "all" target that generates all the  -->
  <!--  coverage numbers for all defined technology targets.                    -->
  <!--                                                                          -->
  <!--  To define a new target copy one of the existing targets and supply the  -->
  <!--  appropriate properties.  Or use one of the template proerties listed at -->
  <!--  the end of this file.  The user must define the following params:       -->
  <!--    api.coverage.dir : location to write API coverage results to          -->
  <!--    api.assertions   : location of API assertion document                 -->
  <!--    spec.coverage.dir: location to write SPEC coverage results to         -->
  <!--    spec.assertions  : location of SPEC assertion document                -->
  <!--    test.src.dir     : relative location of test source code              -->
  <!--    filter.string    : this is an optional parameter, it is only used in  -->
  <!--                       the case where users want to pass a filter string  -->
  <!--                       to the legacy assert utility (see the legacy       -->
  <!--                       assert utility README for details)                 -->
  <!--                                                                          -->
  <!--  Note: Some technologies only have API or SPEC assertions.  In those     -->
  <!--        cases omit the params that do not apply.  For instance, if your   -->
  <!--        technology only has API assertions delete the spec.coverage.dir   -->
  <!--        and spec.assertions parameters from your technology task.         -->
  <!--                                                                          -->
  <!--                                                                          -->
  <!--  After defining your technolgy target, add your technology target name   -->
  <!--  to the depends list of the all target if your technology is part of the -->
  <!--  EE platform specification. This will cause your technology coverage     -->
  <!--  to be invoked when the all target is invoked.                           -->
  <!-- ######################################################################## -->
  <!-- ######################################################################## -->


  <!-- ############################################################################ -->
  <!--  Required properties                                                         -->
  <!-- ############################################################################ -->

  <property environment="env"/>
  <property name="ts.home"                   value="${env.TS_HOME}"/>
  <property name="ts.test.dir"               value="${ts.home}/src/com/sun/ts/tests"/>
  <property name="ts.docs.dir"               value="${ts.home}/internal/docs"/>
  <property name="ts.tools.home"             value="${env.TS_TOOLS_HOME}"/>
  <property name="assertion.coverage"        value="${ts.tools.home}/tools/assertion-coverage"/>
  <property name="legacy.assert"             value="${ts.tools.home}/tools/legacy-assert"/>
  <property name="xsl.transform"             value="${ts.tools.home}/tools/xsl-transformer"/>
  <property name="local.dtd.dir"             value="${ts.tools.home}/docs/dtd/assertions"/>
  <property name="verify.src.assertions"     value="true"/>
  <property name="legacy.assert.output"      value="/tmp/legacy-assert-output.temp"/>
  <property name="legacy.assert.output.spec" value="/tmp/spec-legacy-assert-output.temp"/>
  <property name="legacy.assert.output.api"  value="/tmp/api-legacy-assert-output.temp"/>
  <property name="coverage.base.dir"         value="${ts.home}/tmp/assertion-coverage"/>
  <property name="backup.ext"                value="bak"/> 
  <property name="api.stylesheet"            value="${ts.tools.home}/docs/xsl/assertions/javadoc_assertions.xsl"/>
  <property name="spec.stylesheet"           value="${ts.tools.home}/docs/xsl/assertions/spec_assertions.xsl"/>
  <property name="api.html.assertion.file"   value="api-assertions.html"/>
  <property name="spec.html.assertion.file"  value="spec-assertions.html"/>
  <property name="srcdirs"  value="appclient,ejb,integration,jacc,jsf,jstl,assembly,
                              ejb30,internal,jaspic,jdbc,jsonb,jta,saaj,concurrency,ejb32,
                              javaee,jaxrs,jms,jsonp,jws,samples,common,connector,el,javamail,servlet,
                              webservices13,websocket,xa,jaxws,jpa,jsp,securityapi,webservices12"/>
 
  <taskdef resource="net/sf/antcontrib/antlib.xml"
             classpath="${ts.home}/lib/ant-contrib-1.0b3.jar"/>

  <!-- ############################################################################ -->
  <!--  Helper targets used to calculate coverage numbers for each technology area  -->
  <!-- ############################################################################ -->

  <target name="check.ts.home" unless="env.TS_HOME">
    <fail message="Please set the &quot;TS_HOME&quot; environment variable to an appropriate value."/>
  </target>

  <target name="check.ts.tools.home" unless="env.TS_TOOLS_HOME">
    <fail message="Please set the &quot;TS_TOOLS_HOME&quot; environment variable to an appropriate value."/>
  </target>

  <target name="check.src.dir" unless="test.src.dir.specified">
    <fail message="Please specify a valid value for the &quot;test.src.dir&quot; property"/>
  </target>

  <target name="backup">
    <property name="bak.dir" value="${move.dir}/bak"/>
    <mkdir dir="${bak.dir}"/>
    <copy todir="${bak.dir}" overwrite="true">
      <fileset dir="${move.dir}">
        <include name="*.xml"/>
        <include name="*.html"/>
      </fileset>
    </copy>
    <delete>
      <fileset dir="${move.dir}">
        <include name="*.xml"/>
        <include name="*.html"/>
      </fileset>
    </delete>
  </target>

  <target name="build.api.assertions.html" if="do.api">
    <echo message="Transforming API assertion doc:"/>
    <echo message="    xml-file    = ${api.assertions}"/>
    <echo message="    xslt-file   = ${api.stylesheet}"/>
    <echo message="    output-file = ${api.coverage.dir}/${api.html.assertion.file}"/>
    <ant dir="${xsl.transform}" target="run">
      <property name="xml-file"       value="${api.assertions}"/>
      <property name="xslt-file"      value="${api.stylesheet}"/>
      <property name="output-file"    value="${api.coverage.dir}/${api.html.assertion.file}"/>
      <property name="local-dtd-path" value="${local.dtd.dir}"/>
    </ant>
  </target>

  <target name="build.spec.assertions.html" if="do.spec">
    <echo message="Transforming SPEC assertion doc:"/>
    <echo message="    xml-file    = ${spec.assertions}"/>
    <echo message="    xslt-file   = ${spec.stylesheet}"/>
    <echo message="    output-file = ${spec.coverage.dir}/${spec.html.assertion.file}"/>
    <ant dir="${xsl.transform}" target="run">
      <property name="xml-file"       value="${spec.assertions}"/>
      <property name="xslt-file"      value="${spec.stylesheet}"/>
      <property name="output-file"    value="${spec.coverage.dir}/${spec.html.assertion.file}"/>
      <property name="local-dtd-path" value="${local.dtd.dir}"/>
    </ant>
  </target>

  <target name="generate.spec.assertion.coverage" if="do.spec">
    <antcall target="backup">
      <param name="move.dir" value="${spec.coverage.dir}"/>
    </antcall>
    <echo message="assertion-coverage (SPEC):"/>
    <echo message="    all-assertions-file    = ${spec.assertions}"/>
    <echo message="    tested-assertions-file = ${legacy.assert.output.spec}"/>
    <echo message="    coverage-dir           = ${spec.coverage.dir}"/>
    <ant dir="${assertion.coverage}" target="run">
      <property name="all-assertions-file"    value="${spec.assertions}"/>
      <property name="tested-assertions-file" value="${legacy.assert.output.spec}"/>
      <property name="coverage-dir"           value="${spec.coverage.dir}"/>
      <property name="local-dtd-path"         value="${local.dtd.dir}"/>
      <property name="verify-source-code-ids" value="${verify.src.assertions}"/>
    </ant>
  </target>

  <target name="generate.api.assertion.coverage" if="do.api">
    <antcall target="backup">
      <param name="move.dir" value="${api.coverage.dir}"/>
    </antcall>
    <echo message="assertion-coverage (API):"/>
    <echo message="    all-assertions-file    = ${api.assertions}"/>
    <echo message="    tested-assertions-file = ${legacy.assert.output.api}"/>
    <echo message="    coverage-dir           = ${api.coverage.dir}"/>
    <ant dir="${assertion.coverage}" target="run">
      <property name="all-assertions-file"    value="${api.assertions}"/>
      <property name="tested-assertions-file" value="${legacy.assert.output.api}"/>
      <property name="coverage-dir"           value="${api.coverage.dir}"/>
      <property name="local-dtd-path"         value="${local.dtd.dir}"/>
      <property name="verify-source-code-ids" value="${verify.src.assertions}"/>
    </ant>
  </target>

  <target name="generate.assertion.list.no.filter" unless="use.filter">
    <echo message="legacy-assert:"/>
    <echo message="    output.filename = ${legacy.assert.output}"/>
    <echo message="    initial.dir     = ${test.src.dir}"/>
    <ant dir="${legacy.assert}" target="get.assertions">
      <property name="output.filename"     value="${legacy.assert.output}"/>
      <property name="initial.dir"         value="${test.src.dir}"/>
      <property name="queue.handler.class" value="com.sun.ts.legacy.SplitCoverageHandler"/>
    </ant>
  </target>

  <target name="generate.assertion.list.filter" if="use.filter">
    <echo message="legacy-assert:"/>
    <echo message="    assertion.filter = ${filter.string}"/>
    <echo message="    output.filename  = ${legacy.assert.output}"/>
    <echo message="    initial.dir      = ${test.src.dir}"/>
    <ant dir="${legacy.assert}" target="get.assertions">
      <property name="output.filename"     value="${legacy.assert.output}"/>
      <property name="assertion.filter"    value="${filter.string}"/>
      <property name="initial.dir"         value="${test.src.dir}"/>
      <property name="queue.handler.class" value="com.sun.ts.legacy.SplitCoverageHandler"/>
    </ant>
  </target>

  <target name="calculate.coverage" depends="check.ts.home,check.ts.tools.home">
    <condition property="do.api">
      <and>
        <not>
          <equals arg1="${api.coverage.dir}" arg2="$${api.coverage.dir}"/>
        </not>
        <not>
          <equals arg1="${api.assertions}" arg2="$${api.assertions}"/>
        </not>
      </and>
    </condition>
    <condition property="do.spec">
      <and>
        <not>
          <equals arg1="${spec.coverage.dir}" arg2="$${spec.coverage.dir}"/>
        </not>
        <not>
          <equals arg1="${spec.assertions}" arg2="$${spec.assertions}"/>
        </not>
      </and>
    </condition>
    <condition property="use.filter">
      <not>
        <equals arg1="${filter.string}" arg2="$${filter.string}"/>
      </not>
    </condition>
    <condition property="test.src.dir.specified">
      <not>
        <equals arg1="${test.src.dir}" arg2="$${test.src.dir}"/>
      </not>
    </condition>
    <antcall target="check.src.dir"/>
    <antcall target="generate.assertion.list.filter"/>
    <antcall target="generate.assertion.list.no.filter"/>
    <antcall target="generate.api.assertion.coverage"/>
    <antcall target="generate.spec.assertion.coverage"/>
    <antcall target="build.api.assertions.html"/>    
    <antcall target="build.spec.assertions.html"/>
  </target>

  <property name="gen.index.dir" value="${ts.tools.home}/tools/gen-index"/>
  <target name="generate.index.page">
    <echo message=""/>
    <echo message="gen-index:"/>
    <echo message="    base.dir = ${coverage.base.dir}"/>
    <echo message=""/>
    <ant dir="${gen.index.dir}" target="run">
      <property name="base.dir" value="${coverage.base.dir}"/>
    </ant>
  </target>

  <property name="gen.summary.dir" value="${ts.tools.home}/tools/gen-summary"/>
  <target name="generate.exec.summary">
    <echo message=""/>
    <echo message="gen-exec-summary:"/>
    <echo message="    base.dir = ${coverage.base.dir}"/>
    <echo message=""/>
    <ant dir="${gen.summary.dir}" target="run">
      <property name="base.dir" value="${coverage.base.dir}"/>
    </ant>
  </target>

  <property name="document.dir"  value="${ts.docs.dir}/html-assertions"/>
  <property name="assertion.jar" value="${document.dir}/JavaEE_7.0_Assertion_Docs.jar"/>
  <target name="copy.html.assertions">
    <copy todir="${document.dir}">
      <fileset dir="${coverage.base.dir}">
        <include name="**/api-assertions.html"/>
        <include name="**/spec-assertions.html"/>
        <include name="assertion-index.html"/>
        <exclude name="**/bak/*"/>
      </fileset>
    </copy>
    <delete file="${assertion.jar}" failonerror="false"/>
    <jar destfile="${assertion.jar}" basedir="${document.dir}"/>
  </target>

  <target name="set.permissions">
    <chmod perm="777" type="both">
      <fileset dir="${coverage.base.dir}" includes="**,**/*"/>
    </chmod>
  </target>

  <target name="build.page">
    <antcall target="generate.exec.summary"/>
    <antcall target="generate.index.page"/>
    <antcall target="set.permissions"/>
  </target>

  <target name="start.log">
   <record name="coverage.log" action="start"/>
  </target>
	
  <target name="delete.metrics">
    <delete includeemptydirs="true" failonerror="false">
	  <fileset dir="${coverage.base.dir}" includes="**/*"/>
	</delete>
  </target>

  <!-- APIs that are required by EE 6 spec but are missing assertion artifacts: -->
  <!-- JavaMail, JAF, connector, JAXB, Common Annotations (sorta, each area     -->
  <!-- must test these), JSP Debugging (may be included with jsp area,          -->
  <!-- not sure), stax. We also need to clean up webservices, the EE 5 spec     -->
  <!-- lists webservices 1.2, JAX-WS 2.0 and Web Services Metadata (not sure    -->
  <!-- how these map to our assertion docs).                                    -->
  
  <!-- Removed Jakarta Deployment, jaxws, saaj and jws from the code coverage as the corresponding  -->
  <!-- tests are no more part of Java EE 8 CTS                                  -->
  <target name="all" depends="start.log,
	                              jta,jdbc,ejb,connector,jaspic,
	                              jsp,el,servlet,jms,jacc,javaee,jstl,jpa,
	                              jaxrs,webservices,jsf,
                                concurrency,websocket,securityapi">
    <antcall target="generate.exec.summary"/>
    <antcall target="generate.index.page"/>
    <antcall target="set.permissions"/>
    <record name="coverage.log" action="stop"/>
  </target>
	
  <target name="dougs.stuff" depends="start.log,jsp,el,jstl,jsf">
    <antcall target="generate.exec.summary"/>
    <antcall target="generate.index.page"/>
    <antcall target="set.permissions"/>
    <record name="coverage.log" action="stop"/>
  </target>

  <!-- ############################################################################ -->
  <!--  Default target                                                              -->
  <!-- ############################################################################ -->
  <target name="usage">
    <echo message="Usage ant -buildfile coverage-build.xml &lt;target&gt;"/>
	<echo message="  Where &lt;target&gt; can be:"/>
	<echo message="    usage   : Prints this message."/>
	<echo message="    all     : Calculates the assertion coverage numbers"/>
	<echo message="              for all defined technology targets."/>
	<echo message=""/>
	<echo message="Note: TS_HOME must be set to a valid TS workspace location and"/>
	<echo message="      TS_TOOLS_HOME must be set to a valid tools location that"/>
	<echo message="      has been built."/>
	<echo message=""/>
  </target>
	
	
  <!-- ############################################################################ -->
  <!--  Targets to create the assertion coverage numbers for each technology area   -->
  <!-- ############################################################################ -->

  <target name="securityapi">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/securityapi_1_0/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/securityapi_1_0/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/securityapi/SecurityAPIJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/securityapi/SecurityAPISpecAssertions.xml"/>
      <param name="test.src.dir"      value="/securityapi"/>
    </antcall>
  </target>

  <target name="javaee">
    <for param="srcdir" list="${srcdirs}"
                          trim="true" delimiter=",">
      <sequential>
        <antcall target="calculate.coverage">
          <param name="spec.coverage.dir" value="${coverage.base.dir}/javaee_8/spec"/>
          <param name="spec.assertions"   value="${ts.docs.dir}/javaee/JavaEESpecAssertions.xml"/> 
          <param name="test.src.dir"      value="/@{srcdir}"/>
          <param name="filter.string"     value="JavaEE"/>
        </antcall>
      </sequential>
    </for>
  </target>

  <target name="connector">
    <antcall target="calculate.coverage">   
      <param name="spec.coverage.dir" value="${coverage.base.dir}/connector_1_7/spec"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/connector/ConnectorSpecAssertions.xml"/>
      <param name="api.coverage.dir"  value="${coverage.base.dir}/connector_1_7/api"/>
      <param name="api.assertions"    value="${ts.docs.dir}/connector/ConnectorAPIAssertions-nums.xml"/>
      <param name="test.src.dir"      value="/connector"/>
      <param name="filter.string"     value="Connector"/>
    </antcall>
  </target>

  <target name="standalone-connector">
    <antcall target="calculate.coverage">   
      <param name="spec.coverage.dir" value="${coverage.base.dir}/connector_1_7/spec"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/connector/StandaloneConnectorSpecAssertions.xml"/>
      <param name="api.coverage.dir"  value="${coverage.base.dir}/connector_1_7/api"/>
      <param name="api.assertions"    value="${ts.docs.dir}/connector/StandaloneConnectorAPIAssertions-nums.xml"/>
      <param name="test.src.dir"      value="/connector"/>
      <param name="filter.string"     value="Connector"/>
    </antcall>
  </target>

  <target name="jaspic">
    <antcall target="calculate.coverage">   
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jaspic_1_1/spec"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jaspic/JASPICSpecAssertions.xml"/>
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jaspic_1_1/api"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jaspic/JASPICJavadocAssertions.xml"/>
      <param name="test.src.dir"      value="/jaspic"/>
      <param name="filter.string"     value="JASPIC"/>
    </antcall>
  </target>

  <target name="jaxws">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jaxws_2_2/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jaxws_2_2/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jaxws/JAXWSJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jaxws/JAXWSSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jaxws"/>
    </antcall>
  </target>

  <target name="jws">
    <antcall target="calculate.coverage">
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jws_2_1/spec"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jws/JWSSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jws"/>
    </antcall>
  </target>

  <target name="saaj">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/saaj_1_3/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/saaj_1_3/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/saaj/SAAJJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/saaj/SAAJSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/saaj"/>
    </antcall>
  </target>

  <target name="jms">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jms_2_0/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jms_2_0/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jms/JMSJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jms/JMSSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jms"/>
    </antcall>
  </target>

  <target name="jta">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jta_1_1/api"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jta/JTAJavadocAssertions.xml"/>
      <param name="test.src.dir"      value="/jta"/>
    </antcall>
  </target>

  <target name="jdbc">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jdbc_3_0/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jdbc_3_0/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jdbc/JDBCJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jdbc/JDBCSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jdbc"/>
    </antcall>
  </target>

  <target name="ejb">
    <for param="srcdir" list="${srcdirs}"
                          trim="true" delimiter=",">
      <sequential>
        <antcall target="calculate.coverage">
          <param name="api.coverage.dir"  value="${coverage.base.dir}/ejb_3_2/api"/>
          <param name="spec.coverage.dir" value="${coverage.base.dir}/ejb_3_2/spec"/>
          <param name="api.assertions"    value="${ts.docs.dir}/ejb/EJBJavaDocAssertions.xml"/>
          <param name="spec.assertions"   value="${ts.docs.dir}/ejb/EJBSpecAssertions.xml"/>
          <param name="test.src.dir"      value="/@{srcdir}"/>
          <param name="filter.string"     value="EJB"/>
        </antcall>
     </sequential>
   </for>
  </target>

  <target name="jsp">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jsp_2_2/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jsp_2_2/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jsp/JSPJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jsp/JSPSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jsp"/>
      <param name="filter.string"     value="JSP"/>
    </antcall>
  </target>

  <target name="el">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/el_3_0/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/el_3_0/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/el/ELJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/el/ELSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/el"/>
      <param name="filter.string"     value="EL"/>
    </antcall>
  </target>

  <target name="servlet">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/servlet_4_0/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/servlet_4_0/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/servlet/ServletJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/servlet/ServletSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/servlet"/>
    </antcall>
  </target>

  <target name="jacc">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jacc_1_5/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jacc_1_5/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jacc/JACCJavaDocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jacc/JACCSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jacc"/>
    </antcall>
  </target>

  <target name="webservices">
    <for param="srcdir" list="${srcdirs}"
                        trim="true" delimiter=",">
      <sequential>
        <antcall target="calculate.coverage">
          <param name="spec.coverage.dir" value="${coverage.base.dir}/webservices_1_3/spec"/>
          <param name="spec.assertions"   value="${ts.docs.dir}/webservices/WEBSERVICESSpecAssertions.xml"/>
          <param name="test.src.dir"      value="/@{srcdir}"/>
          <param name="filter.string"     value="WS4EE"/>
        </antcall>
      </sequential>
    </for>
  </target>

  <target name="jsf">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jsf_2_3/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jsf_2_3/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jsf/JSFJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jsf/JSFSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jsf"/>
      <param name="filter.string"     value="JSF"/>
    </antcall>
  </target>

  <target name="jstl">
    <antcall target="calculate.coverage">
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jstl_1_2/spec"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jstl/JSTLSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jstl"/>
      <param name="filter.string"     value="JSTL"/>
    </antcall>
  </target>

  <target name="jpa">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jpa_2_2/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/jpa_2_2/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jpa/Persistence22JavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jpa/PersistenceSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jpa"/>
      <param name="filter.string"     value="PERSISTENCE"/>
    </antcall>
  </target>

  <target name="jpa-ee-only">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/jpa_2_1/api"/>
  	  <param name="spec.coverage.dir" value="${coverage.base.dir}/jpa_2_1/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/jpa/PersistenceJavaDocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/jpa/PersistenceSpecAssertions.xml"/>
      <param name="test.src.dir"      value="/jpa/ee"/>
      <param name="filter.string"     value="PERSISTENCE"/>
    </antcall>
  </target>

  <target name="concurrency">
 	<antcall target="calculate.coverage">
 	  <param name="api.coverage.dir"  value="${coverage.base.dir}/concurrency_1_0/api"/>
 	  <param name="api.assertions"    value="${ts.docs.dir}/concurrency/ConcurrencyJavadocAssertions.xml"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/concurrency_1_0/spec"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/concurrency/ConcurrencySpecAssertions.xml"/>
 	  <param name="test.src.dir"      value="/concurrency"/>
 	  <param name="filter.string"     value="CONCURRENCY"/>
 	</antcall>
  </target>

  <!-- ############################################################################ -->
  <!--  Targets listed below are currently undefined, can be used as templates      -->
  <!-- ############################################################################ -->

  <target name="jaas">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/TBD/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/TBD/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/TBD"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/TBD"/>
      <param name="test.src.dir"      value="/jaas"/>
    </antcall>
  </target>

  <target name="javamail">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/TBD/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/TBD/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/TBD"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/TBD"/>
      <param name="test.src.dir"      value="/javamail"/>
    </antcall>
  </target>

  <target name="jaxm">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/TBD/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/TBD/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/TBD"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/TBD"/>
      <param name="test.src.dir"      value="/jaxm"/>
    </antcall>
  </target>

  <target name="jaxp">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/TBD/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/TBD/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/TBD"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/TBD"/>
      <param name="test.src.dir"      value="/jaxp"/>
    </antcall>
  </target>

  <target name="soap">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/TBD/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/TBD/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/TBD"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/TBD"/>
      <param name="test.src.dir"      value="/soap"/>
    </antcall>
  </target>

  <target name="websocket">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/websocket_1_1/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/websocket_1_1/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/websocket/WebSocketJavadocAssertions.xml"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/websocket/WebSocketSpecAssertion.xml"/>
      <param name="test.src.dir"      value="/websocket"/>
    </antcall>
  </target>

  <target name="xa">
    <antcall target="calculate.coverage">
      <param name="api.coverage.dir"  value="${coverage.base.dir}/TBD/api"/>
      <param name="spec.coverage.dir" value="${coverage.base.dir}/TBD/spec"/>
      <param name="api.assertions"    value="${ts.docs.dir}/TBD"/>
      <param name="spec.assertions"   value="${ts.docs.dir}/TBD"/>
      <param name="test.src.dir"      value="/xa"/>
    </antcall>
  </target>

</project>
