<commit_before><?xml version="1.0" encoding="utf-8"?> 
<!--
********************************************************************************
* Ant Script Library - Java test module 
* Contains ant targets related to the testing of java code
* Module property prefix: "java-test"
********************************************************************************
* Copyright 2009 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
********************************************************************************
 -->
<project name="asl-java-test">
    <dirname property="java-test.basedir" file="${ant.file.asl-java-test}"/>
    <import file="${java-test.basedir}/asl-java-build.xml"/>
    <import file="${java-test.basedir}/asl-java-coverage.xml"/>

    <!-- ***********************************************************************
    * Default values for java-report properties.
    ************************************************************************ -->
    <property name="java-test.src-dir" location="src/test/java"/>
    <property name="java-test.resources-dir" location="src/test/resources"/>
    <property name="java-test.classes-dir" location="${common.target-dir}/test-classes"/>
    <property name="java-test.test-data-dir" location="${common.target-dir}/test-data"/>
    <property name="java-test.maxmem" value="128m"/>
    <property environment="env"/>
    <property name="java-test.tools-jar-file" location="${env.JAVA_HOME}/lib/tools.jar"/>
    
    
    <!-- ***********************************************************************
    * target: test-all
    ************************************************************************ -->
    <target name="test-all"
            depends="test-run-unit, test-run-integration"
            description="Runs all tests">
        <fail message="Tests failed. Check log and/or reports" if="java-test.failed"/>
    </target>

    <!-- ***********************************************************************
    * target: test-unit
    ************************************************************************ -->
    <target name="test-unit"
            depends="test-run-unit"
            description="Runs unit tests">
        <fail message="Unit tests failed. Check log and/or reports" if="java-test.failed"/>
    </target>

    <!-- ***********************************************************************
    * target: test-integration
    ************************************************************************ -->
    <target name="test-integration"
            depends="test-run-integration"
            description="Runs integration tests">
        <fail message="Integration tests failed. Check log and/or reports" if="java-test.failed"/>
    </target>

    <!-- ***********************************************************************
    * macrodef: junit-asl
    ************************************************************************ -->
    <macrodef name="junit-asl">
        <attribute name="test-fileset-refid"/>
        <!-- Default to timeout after 25 minutes -->
        <attribute name="timeout" default="1500000"/>
        <sequential>
            <mkdir dir="${java-test.test-data-dir}"/>

            <junit errorProperty="java-test.failed"
                    failureProperty="java-test.failed"
                    fork="true" forkmode="once"
                    timeout="@{timeout}"
                    printsummary="false"
                    dir="${basedir}"
                    maxmemory="${java-test.maxmem}">
                <jvmarg value="-XX:MaxPermSize=256m"/>
                <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
                <classpath refid="java-test.junit-classpath"/>
                <formatter type="brief" usefile="false"/>
                <formatter type="xml"/>
                <test if="java-test.test-class"<commit_msg>Put unit-test output in test-data directory<commit_after><?xml version="1.0" encoding="utf-8"?> 
<!--
********************************************************************************
* Ant Script Library - Java test module 
* Contains ant targets related to the testing of java code
* Module property prefix: "java-test"
********************************************************************************
* Copyright 2009 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
********************************************************************************
 -->
<project name="asl-java-test">
    <dirname property="java-test.basedir" file="${ant.file.asl-java-test}"/>
    <import file="${java-test.basedir}/asl-java-build.xml"/>
    <import file="${java-test.basedir}/asl-java-coverage.xml"/>

    <!-- ***********************************************************************
    * Default values for java-report properties.
    ************************************************************************ -->
    <property name="java-test.src-dir" location="src/test/java"/>
    <property name="java-test.resources-dir" location="src/test/resources"/>
    <property name="java-test.classes-dir" location="${common.target-dir}/test-classes"/>
    <property name="java-test.test-data-dir" location="${common.target-dir}/test-data"/>
    <property name="java-test.maxmem" value="128m"/>
    <property environment="env"/>
    <property name="java-test.tools-jar-file" location="${env.JAVA_HOME}/lib/tools.jar"/>
    
    
    <!-- ***********************************************************************
    * target: test-all
    ************************************************************************ -->
    <target name="test-all"
            depends="test-run-unit, test-run-integration"
            description="Runs all tests">
        <fail message="Tests failed. Check log and/or reports" if="java-test.failed"/>
    </target>

    <!-- ***********************************************************************
    * target: test-unit
    ************************************************************************ -->
    <target name="test-unit"
            depends="test-run-unit"
            description="Runs unit tests">
        <fail message="Unit tests failed. Check log and/or reports" if="java-test.failed"/>
    </target>

    <!-- ***********************************************************************
    * target: test-integration
    ************************************************************************ -->
    <target name="test-integration"
            depends="test-run-integration"
            description="Runs integration tests">
        <fail message="Integration tests failed. Check log and/or reports" if="java-test.failed"/>
    </target>

    <!-- ***********************************************************************
    * macrodef: junit-asl
    ************************************************************************ -->
    <macrodef name="junit-asl">
        <attribute name="test-fileset-refid"/>
        <!-- Default to timeout after 25 minutes -->
        <attribute name="timeout" default="1500000"/>
        <sequential>
            <mkdir dir="${java-test.test-data-dir}"/>

            <junit errorProperty="java-test.failed"
                    failureProperty="java-test.failed"
                    fork="true" forkmode="once"
                    timeout="@{timeout}"
                    printsummary="false"
                    dir="${basedir}"
                    maxmemory="${java-test.maxmem}">
                <jvmarg value="-XX:MaxPermSize=256m"/>
                <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
                <classpath refid="java-test.junit-classpath"/>
                <formatter type="brief" usefile="false"/>
                <formatter type="xml"/>
                <test if="java-test.test-class"
                      todir="${java-test.test-data-dir}"
{'fraction_non_alphanumeric': 0.3335218916166987, 'fraction_numerical': 0.0058830184410001134, 'mean_word_length': 3.4489179667840966, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 2, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1728688', 'n_tokens_mistral': 2148, 'n_tokens_neox': 1981, 'n_words': 471}