我需要编写一个脚本来搜索文件夹结构中文件类型为 .jmx 的文件。例如,我将有一个名为 Testing 的根文件夹,其中将包含接口名称,例如客户、购物篮、搜索等。然后在每个文件夹中将有另一个名为 jmxFiles 的文件夹,其中将包含这些 .jmx 文件。所以我需要做的是让 ant 搜索整个文件夹结构。
我现在拥有的是:
<?xml version="1.0" encoding="UTF-8"?>
<project default="all">
<!-- Define an environment variable pointing to JMETER folder or change this -->
<property environment="env"/>
<property name="jmeter.save.saveservice.output_format" value="xml"/>
<property name="jmeter-home" location="${env.JMETER_DIR}"/>
<property name="jtesting-home" location="C:/Users/MURPHYA1/Desktop/JTesting"/>
<!-- ant-jmeter.jar comes with jmeter, be sure this is the release you have -->
<path id="ant.jmeter.classpath">
<pathelement
location="${jmeter-home}/extras/ant-jmeter-1.1.1.jar" />
</path>
<taskdef
name="jmeter"
classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"
classpathref="ant.jmeter.classpath" />
<target name="clean">
<delete dir="${jtesting-home}/results"/>
<delete file="jmeter.log"/>
<mkdir dir="${jtesting-home}/results/jtl"/>
<mkdir dir="${jtesting-home}/results/html"/>
</target>
<target name="test" depends="clean">
<jmeter
jmeterhome="${jtesting-home}"
resultlogdir="${jtesting-home}/results/jtl">
<testplans dir="JTesting" includes="**/*.jmx"/>
<property name="jmeter.save.saveservice.output_format" value="xml"/>
<property name="jmeter.save.saveservice.assertion_results" value="all"/>
<property name="jmeter.save.saveservice.bytes" value="true"/>
<property name="file_format.testlog" value="${format}"/>
<property name="jmeter.save.saveservice.response_data.on_error" value="${funcMode}"/>
<property name="testData.fullPath" value="C:/TestData"/>
</jmeter>
</target>
<property name="lib.dir" value="${jmeter-home}/lib"/>
<!-- Use xalan copy from JMeter lib directory to ensure consistent processing with Java 1.4+ -->
<path id="xslt.classpath">
<fileset dir="${lib.dir}" includes="xalan*.jar"/>
<fileset dir="${lib.dir}" includes="serializer*.jar"/>
</path>
<!-- This is not needed for the plugin, but it produces a nice html report
which can be saved usin hudson's archive artifact feature -->
<target name="report" depends="test">
<xslt
classpathref="xslt.classpath"
basedir="results/jtl"
destdir="results/html"
includes="*.jtl"
style="${jmeter-home}/extras/jmeter-results-detail-report_21.xsl"/>
</target>
<target name="all" depends="test, report"/>
</project>
* / .jmx 会工作还是我需要别的东西?
谢谢