<project name="BPELUnit Ant Samples" default="test">
  <!--
      This script is an example of an ant build file making use of the
      BPELUnit task. Be sure to define the BPELUNIT_HOME property
      before calling the script.
  -->

  <property name="dir.build" location="bin"/>
  <property name="dir.src" location="src"/>
  <property name="bpelunit.home" location="."/>

  <path id="lib.path">
    <fileset dir="../net.bpelunit.framework/lib">
      <include name="**/*.jar" />
    </fileset>
    <pathelement location="../net.bpelunit.framework/bin"/>
    <pathelement location="${dir.build}"/>
  </path>

  <target name="init">
    <tstamp/>
  </target>

  <target name="build" depends="init"
          description="Compiles the Java source code">
    <mkdir dir="${dir.build}"/>
    <ant dir="../net.bpelunit.framework"/>
    <javac srcdir="${dir.src}" destdir="${dir.build}" debug="on">
      <classpath refid="lib.path"/>
    </javac>
  </target>

  <target name="clean" depends="init"
          description="Cleans all automatically generated files">
    <delete dir="${dir.build}"/>
  </target>

  <target name="test" depends="build">
    <typedef
        name="bpelunit"
        classname="net.bpelunit.framework.ui.ant.BPELUnit">
      <classpath refid="lib.path" />
    </typedef>

    <bpelunit testsuite="test/01_SendReceiveOnly/WastePaperBasketTestSuite.bpts"
              bpelunitdir="${bpelunit.home}">
      <output style="XML" file="out1.xml" />
    </bpelunit>

    <bpelunit
        testsuite="test/02_SendReceiveSync/CreditRatingServiceTestSuite.bpts"
        bpelunitdir="${bpelunit.home}">
      <output style="XML" file="out2.xml" />
    </bpelunit>

    <bpelunit
        testsuite="test/03_SendReceiveAsync/LoanServiceTestSuite.bpts"
        bpelunitdir="${bpelunit.home}">
      <output style="XML" file="out3.xml" />
    </bpelunit>

    <!-- This call requires an Oracle server -->
    <!--
        <bpelunit
            testsuite="test/04_DocLitTravelSync/DocLitTravelSyncSuite.bpts"
            bpelunitdir="${bpelunit.home}">
        <output style="XML" file="out4.xml" />
        </bpelunit>
    -->
  </target>

</project>
