<?xml version="1.0" ?>
<!DOCTYPE project [
        <!ENTITY properties SYSTEM "file:../../xmls/properties.xml">
        <!ENTITY paths  SYSTEM "file:../../xmls/path_refs.xml">
        <!ENTITY taskdefs SYSTEM "file:../../xmls/taskdefs.xml">
        <!ENTITY taskdefs_post_compile SYSTEM "file:../../xmls/taskdefs_post_compile.xml">
        <!ENTITY targets SYSTEM "file:../../xmls/targets.xml">
]>

<!-- ===================================================================
<description>
   Test/Sample Component file for Axis

Notes:
   This is a build file for use with the Jakarta Ant build tool.

Prerequisites:

   jakarta-ant from http://jakarta.apache.org

Build Instructions:
   To compile
        ant compile
   To execute
        ant run

Author:
  Matt Seibert mseibert@us.ibm.com

Copyright:
  Copyright (c) 2002-2003 Apache Software Foundation.
</description>
==================================================================== -->

<project default="compile">

<property name="axis.home" location="../.." />
<property name="componentName" value="test/functional" />
        &properties;
        &paths;
        &taskdefs;
        &taskdefs_post_compile;
        &targets;

<target name="clean"/>

<target name="copy" depends="setenv">
    <ant inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}" dir="${axis.home}" antfile="buildSamples.xml" target="compile"/>
</target>

<target name="compile" depends="copy">
  <echo message="Compiling test.functional"/>
  <javac srcdir="${axis.home}" destdir="${build.dest}" debug="${debug}" nowarn="${nowarn}" source="${source}" fork="${javac.fork}">
    <classpath>
        <path refid="classpath"/>
    </classpath>
    <include name="test/functional/*.java"/>
  </javac>
  <!-- first, put the JWS where the functional test can see it -->
  <mkdir dir="${axis.home}/build/jws" />
  <copy file="${axis.home}/test/functional/AltStockQuoteService.jws" todir="${axis.home}/build/jws" />
  <copy file="${axis.home}/test/functional/GlobalTypeTest.jws" todir="${axis.home}/build/jws"/>
  <copy file="${axis.home}/test/functional/FaultTest.jws" todir="${axis.home}/build/jws"/>
  <copy file="${axis.home}/test/functional/AutoTypesTest.jws" todir="${axis.home}/build/jws" />
  <copy file="${axis.home}/webapps/axis/EchoHeaders.jws" todir="${axis.home}/build/jws" />
</target>

<target name="junit-functional-prepare" if="junit.present">
   <mkdir dir="${test.functional.reportdir}" />
   <path id="deploy.xml.files">
       <fileset dir="${build.dir}">
          <include name="work/samples/**/deploy.wsdd"/>
          <include name="work/test/rpc/deploy.wsdd"/>
       </fileset>
   </path>

   <path id="undeploy.xml.files">
       <fileset dir="${build.dir}">
          <include name="work/samples/**/undeploy.wsdd"/>
          <include name="work/test/rpc/undeploy.wsdd"/>
       </fileset>
   </path>

   <property name="deploy.xml.property" refid="deploy.xml.files"/>
   <property name="undeploy.xml.property" refid="undeploy.xml.files"/>
</target>

<target name="junit-functional" if="junit.present" depends="junit-functional-prepare,start-signature-signing-and-verification">
    <java classname="org.apache.axis.client.AdminClient" fork="yes">
      <classpath refid="classpath" />
      <arg line="${deploy.xml.property}"/>
    </java>

   <junit dir="${axis.home}" printsummary="yes" haltonfailure="${test.functional.fail}" fork="yes">
      <classpath refid="classpath" />
      <formatter type="xml" usefile="${test.functional.usefile}"/>
      <batchtest todir="${test.functional.reportdir}">
        <fileset dir="${build.dest}" excludesfile="${axis.home}/junit-exclude-tests.txt">
           <include name="${componentName}/FunctionalTests.class" />
        </fileset>
      </batchtest>
   </junit>

    <java classname="org.apache.axis.client.AdminClient" fork="yes">
      <classpath refid="classpath" />
      <arg line="${undeploy.xml.property}"/>
    </java>
</target>

<target name="run"  depends="setenv" >
    <runaxisfunctionaltests
      url="http://localhost:8088"
      tcpServerTarget="start-functional-test-tcp-server"
      httpServerTarget="start-functional-test-http-server"
      testTarget="junit-functional"
      httpStopTarget="stop-functional-test-http-server" />
</target>

</project>
