Hi

On 5 févr. 07, at 16:19, Sven Haiges wrote:

Hi all,

in the hope of getting another quick answer :-)

I can currently run all my webtests via

webtest -buildfile c:\eclipse_workspaces\ws1\adflex\WEB-INF\src- webtest\all.xml (see below)

No I would like to run this ant file as part of an ant target of our "normal" build.xml, so I created another target in our old build,xml file:

    <target name="webtest">
            <ant dir="./WEB-INF/src-webtest" antfile="all.xml" />
    </target>

I'd rather have ant call one of the shell scripts provided with webtest, so that 'd be sure that the environment is correct.

In webtest's build script, we use following code to call the unix, or the windows, shell script:

            <property environment="env"/>
            <exec os="Linux, Mac OS X"
dir="@{dir}" executable="${installTest.dir}/bin/ webtest.sh" failonerror="true"
                  newenvironment="true"
                    >
                <env key="PATH" value="${env.PATH}"/>
                <env key="JAVA_HOME" value="${java.home}"/>
                <arg line="@{line}"/>
            </exec>
            <exec os="Windows"
                  dir="@{dir}" executable="cmd.exe" failonerror="true"
                  newenvironment="true"
                    >
                <env key="PATH" value="${env.PATH}"/>
                <env key="JAVA_HOME" value="${java.home}"/>
                <arg file="${installTest.dir}/bin/webtest.bat"/>

                <arg line="-Dwebtest.home"/>
                <arg file="${installTest.dir}"/>
                <arg line="@{line}"/>
            </exec>

where
@{dir} would be  WEB-INF/src-webtest
${installTest.dir} would be your WEBTEST_HOME
@{line} would be -buildfile all.xml


Best
        dna

--
The Laws of Computer Programming
* Jenkinson's Law *
It won't work.


Reply via email to