<commit_before><?xml version="1.0"?>

<project name="Birt Data Test Project" basedir="." default="utest">

	<!-- set global properties for this build -->
	<!-- Public properties, used by public targets, top level build script
		     will pass on the value at runtime. Properties will have there default
		     value.

		     eclipse.home
		     dtp.home
		     test.report.dir
		     javadoc.dir
		     plugin.version 
	-->
	<!--properties -->

	<!-- ===== Default value for public properties ============= -->
	<property name="test.report.dir" location="report" />
	<property name="test.report.xml.dir" location="${test.report.dir}/xml" />
	<property name="test.javadoc.dir" location="doc" />
	
	<property name="romdoc.output.dir" location="romdoc/gen" />
	<property name="plugin.version" value="2.0.0" />
	<property name="export.dir" location="export" />
	
	<property name="eclipse.home" location="." />
	<property name="dtp.home" location=".." />
	
	<property name="core.dir" location="../org.eclipse.birt.core" />
	<property name="data.oda.dir" location="../org.eclipse.birt.data.oda" />
	<property name="data.oda.jdbc.dir" location="../org.eclipse.birt.report.data.oda.jdbc" />
	<property name="datatools.connectivity.oda.dir" location="../org.eclipse.datatools.connectivity.oda" />	
	<property name="module.dir" location = "../org.eclipse.birt.data" />
	<property name="testmodule.name" value = "org.eclipse.birt.tests.data" />
	
	<property name="test.src.dir" location="test" />
	<property name="test.build.dir" location="bin" />
	<property name="test.lib.dir" location="lib" />

	
	<property name="testOdaDriver.dir" location="test/org\eclipse\birt\data\engine\odaconsumer\testdriver" />
	<property name="testOdaDriver.plugin.name" value="org.eclipse.birt.data.engine.odaconsumer.testdriver" />
	<property name="testBirtOdaDriver.dir" location="test/org\eclipse\birt\data\engine\odaconsumer\birtdriver" />
	<property name="testBirtOdaDriver.plugin.name" value="org.eclipse.birt.data.engine.odaconsumer.birtdriver" />
	
	
	<!-- Class Path -->
	<path id="class.path">
		<fileset dir="${test.lib.dir}">
			<include name="*.jar" />
		</fileset>	
		<pathelement path="${test.build.dir}" />
		<pathelement path="${core.dir}\core.jar" />
		<pathelement path="${data.oda.dir}\oda.jar" />
		<pathelement path="${core.dir}\lib\js.jar" />
		<pathelement path="${data.oda.jdbc.dir}\derby.jar" />
		<pathelement path="${core.dir}\lib\junit.jar" />
		<pathelement path="${datatools.connectivity.oda.dir}\oda.jar" />
		<pathelement path="${datatools.connectivity.oda.dir}\odaconsumer-helper.jar" />
		<fileset dir="${eclipse.home}/plugins">
				<include name="org.eclipse.core.runtime_*/runtime.jar"/>
				<include name="org.eclipse.osgi_*/*.jar"/>
				<include name="org.eclipse.core.runtime*.jar"/>
				<include name="org.eclipse.osgi*.jar"/>
				<include name="org.junit_*/*.jar"/>			
		</fileset>	
		
		<fileset dir="${module.dir}">
			<include name="dte.jar" />
			<include name="lib/*.jar" />
		</fileset>	
	
	</path>

	
	<!-- Export the project, for instance, jar files are copied to a designated folder
		 the dependency on Jar should implement in top level script by call sequence	
		 Parameters:
		 		- ${export.dir} target directory to put the plugin binaries
		 		- ${plugin.version} the version of plugin exported
	 -->
	<target name="Export" >
	  	<copy todir="${export.dir}/${module.name}_${plugin.version}" failonerror="false">
	        <fileset dir="." includes="model.jar,plugin.xml,about.html,.options,lib/**,schema/**"/>
	    </copy>
		<copy todir="${export.dir}/${module.name}_${plugin.version}/romdoc" failonerror="false">
			<fileset dir="./romdoc/gen" includes="**/*.*"/>
		</copy>			    
	</target>

	
	<!-- Compile Model Test Files 
		 javac.failonerror should be true.
	-->
    <target name="compileTest" description="Compile Data Test Files">
		<delete dir="${test.build.dir}" />
    	<mkdir dir="${test.build.dir}" />
    	
        <copy todir="${test.build.dir}">
			<fileset dir="${test.src.dir}">
				<include name="**/input/*.*"/>
				<include name="**/golden/*.*"/>
				<include name="**/*.properties" />	
			</fileset>
		</copy>
 
		<javac srcdir="${test.src.dir}" 
			   destdir="${test.build.dir}" 
			   source="1.4" 
			   target="1.4"
			   debug="true" 
			   encoding="utf-8" 
			   failonerror="true" >
			   <classpath refid="class.path" />
		</javac>    	
    </target>

	<!-- Run Unit test.
			 Parameters:
			 		- ${utest.report.dir} target directory to put the unit test report
			 		
		 Notice: This public task UnitTest doesn't depend on complieSource, top level script 
		 will ensure that compilation is successful before call this UnitTest.
	-->
	<target name="UnitTest" depends="compileTest,APIJavadoc">
		<delete dir="${test.report.xml.dir}" />
		<mkdir dir="${test.report.xml.dir}"/>
		<junit printsummary="on" 
			   fork="true" 
			   dir="."
			   haltonfailure="false" 
			   failureproperty="test.failed"
		       showoutput="true">

			<jvmarg value="-DBIRT_HOME=${eclipse.home}" />
			<jvmarg value="-ea"/>
			<classpath refid="class.path" />
			<formatter type="xml" usefile="true" />

			<batchtest todir="${test.report.xml.dir}">
				<fileset dir="${test.src.dir}">
					<include name="**/*Test.java" />				
				</fileset>
			</batchtest>
		</junit>
	</target>

	<target name="Report" depends="compileTest">
		<junitreport todir="${test.report.dir}">
			<fileset dir="${test.report.xml.dir}">
				<include name="*.xml" />
				<exclude name="*TestSuites.xml" />
			</fileset>
			
			<report format="frames" todir="${test.report.dir}/" />
		</junitreport>
	</target>
	
	<!-- Clean the build environment -->
	<target name="Clean">
		<delete dir="${test.build.dir}" />
		<delete dir="${tes.report.dir}"/>
		<delete dir="${test.javadoc.dir}"/>
		<delete dir="${export.dir}"/>
		<delete file="model.jar" />
	</target>

	
	<!-- Generate the JavaDocs for public APIs. 
			 Parameters:
			 		- ${api.javadoc.dir} target directory to put the java document<commit_msg>delete the dependency of [compileTest],[UnitTest],[Report]<commit_after><?xml version="1.0"?>

<project name="Birt Data Test Project" basedir="." default="utest">

	<!-- set global properties for this build -->
	<!-- Public properties, used by public targets, top level build script
		     will pass on the value at runtime. Properties will have there default
		     value.

		     eclipse.home
		     dtp.home
		     test.report.dir
		     javadoc.dir
		     plugin.version 
	-->
	<!--properties -->

	<!-- ===== Default value for public properties ============= -->
	<property name="test.report.dir" location="report" />
	<property name="test.report.xml.dir" location="${test.report.dir}/xml" />
	<property name="test.javadoc.dir" location="doc" />
	
	<property name="romdoc.output.dir" location="romdoc/gen" />
	<property name="plugin.version" value="2.0.0" />
	<property name="export.dir" location="export" />
	
	<property name="eclipse.home" location="." />
	<property name="dtp.home" location=".." />
	
	<property name="core.dir" location="../org.eclipse.birt.core" />
	<property name="data.oda.dir" location="../org.eclipse.birt.data.oda" />
	<property name="data.oda.jdbc.dir" location="../org.eclipse.birt.report.data.oda.jdbc" />
	<property name="datatools.connectivity.oda.dir" location="../org.eclipse.datatools.connectivity.oda" />	
	<property name="module.dir" location = "../org.eclipse.birt.data" />
	<property name="testmodule.name" value = "org.eclipse.birt.tests.data" />
	
	<property name="test.src.dir" location="test" />
	<property name="test.build.dir" location="bin" />
	<property name="test.lib.dir" location="lib" />

	
	<property name="testOdaDriver.dir" location="test/org\eclipse\birt\data\engine\odaconsumer\testdriver" />
	<property name="testOdaDriver.plugin.name" value="org.eclipse.birt.data.engine.odaconsumer.testdriver" />
	<property name="testBirtOdaDriver.dir" location="test/org\eclipse\birt\data\engine\odaconsumer\birtdriver" />
	<property name="testBirtOdaDriver.plugin.name" value="org.eclipse.birt.data.engine.odaconsumer.birtdriver" />
	
	
	<!-- Class Path -->
	<path id="class.path">
		<fileset dir="${test.lib.dir}">
			<include name="*.jar" />
		</fileset>	
		<pathelement path="${test.build.dir}" />
		<pathelement path="${core.dir}\core.jar" />
		<pathelement path="${data.oda.dir}\oda.jar" />
		<pathelement path="${core.dir}\lib\js.jar" />
		<pathelement path="${data.oda.jdbc.dir}\derby.jar" />
		<pathelement path="${core.dir}\lib\junit.jar" />
		<pathelement path="${datatools.connectivity.oda.dir}\oda.jar" />
		<pathelement path="${datatools.connectivity.oda.dir}\odaconsumer-helper.jar" />
		<fileset dir="${eclipse.home}/plugins">
				<include name="org.eclipse.core.runtime_*/runtime.jar"/>
				<include name="org.eclipse.osgi_*/*.jar"/>
				<include name="org.eclipse.core.runtime*.jar"/>
				<include name="org.eclipse.osgi*.jar"/>
				<include name="org.junit_*/*.jar"/>			
		</fileset>	
		
		<fileset dir="${module.dir}">
			<include name="dte.jar" />
			<include name="lib/*.jar" />
		</fileset>	
	
	</path>

	
	<!-- Export the project, for instance, jar files are copied to a designated folder
		 the dependency on Jar should implement in top level script by call sequence	
		 Parameters:
		 		- ${export.dir} target directory to put the plugin binaries
		 		- ${plugin.version} the version of plugin exported
	 -->
	<target name="Export" >
	  	<copy todir="${export.dir}/${module.name}_${plugin.version}" failonerror="false">
	        <fileset dir="." includes="model.jar,plugin.xml,about.html,.options,lib/**,schema/**"/>
	    </copy>
		<copy todir="${export.dir}/${module.name}_${plugin.version}/romdoc" failonerror="false">
			<fileset dir="./romdoc/gen" includes="**/*.*"/>
		</copy>			    
	</target>

	
	<!-- Compile Model Test Files 
		 javac.failonerror should be true.
	-->
    <target name="compileTest" >
		<delete dir="${test.build.dir}" />
    	<mkdir dir="${test.build.dir}" />
    	
        <copy todir="${test.build.dir}">
			<fileset dir="${test.src.dir}">
				<include name="**/input/*.*"/>
				<include name="**/golden/*.*"/>
				<include name="**/*.properties" />	
			</fileset>
		</copy>
 
		<javac srcdir="${test.src.dir}" 
			   destdir="${test.build.dir}" 
			   source="1.4" 
			   target="1.4"
			   debug="true" 
			   encoding="utf-8" 
			   failonerror="true" >
			   <classpath refid="class.path" />
		</javac>    	
    </target>

	<!-- Run Unit test.
			 Parameters:
			 		- ${utest.report.dir} target directory to put the unit test report
			 		
		 Notice: This public task UnitTest doesn't depend on complieSource, top level script 
		 will ensure that compilation is successful before call this UnitTest.
	-->
	<target name="UnitTest" >
		<delete dir="${test.report.xml.dir}" />
		<mkdir dir="${test.report.xml.dir}"/>
		<junit printsummary="on" 
			   fork="true" 
			   dir="."
			   haltonfailure="false" 
			   failureproperty="test.failed"
		       showoutput="true">

			<jvmarg value="-DBIRT_HOME=${eclipse.home}" />
			<jvmarg value="-ea"/>
			<classpath refid="class.path" />
			<formatter type="xml" usefile="true" />

			<batchtest todir="${test.report.xml.dir}">
				<fileset dir="${test.src.dir}">
					<include name="**/*Test.java" />				
				</fileset>
			</batchtest>
		</junit>
	</target>

	<target name="Report" >
		<junitreport todir="${test.report.dir}">
			<fileset dir="${test.report.xml.dir}">
				<include name="*.xml" />
				<exclude name="*TestSuites.xml" />
			</fileset>
			
			<report format="frames" todir="${test.report.dir}/" />
		</junitreport>
	</target>
	
	<!-- Clean the build environment -->
	<target name="Clean">
		<delete dir="${test.build.dir}" />
		<delete dir="${tes.report.dir}"/>
		<delete dir="${test.javadoc.dir}"/>
		<delete dir="${export.dir}"/>
		<delete file="model.jar" />
	</target>

	
	<!-- Generate the JavaDocs for public APIs. 
			 Parameters:
			 		- ${api.javadoc.dir} target directory to put the java document
{'fraction_non_alphanumeric': 0.1983815800450488, 'fraction_numerical': 0.001668474180362059, 'mean_word_length': 3.420353982300885, 'pattern_counts': {'":': 0, '<': 223, '<?xml version=': 2, '>': 221, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, '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': '2643737', 'n_tokens_mistral': 4425, 'n_tokens_neox': 3926, 'n_words': 751}