    <!--
       ========================================================================
         Run Orion 1.4 tests
       ========================================================================
    -->
    <target name="test.orion.14" depends="prepare.test.orion.14"
        if="maven.appserver.home" description="Run tests on Orion 1.4">

        <!-- Start the servlet engine, wait for it to be started, run the
             unit tests, stop the servlet engine, wait for it to be stopped.
             The servlet engine is stopped if the tests fail for any reason -->

        <runservertests testURL="http://localhost:${test.port}/test"
            startTarget="start.orion.14"
            stopTarget="stop.orion.14"
            testTarget="test"/>

    </target>

    <!--
       ========================================================================
         Start Orion 1.4
       ========================================================================
    -->
    <target name="start.orion.14">

        <java classname="com.evermind.server.ApplicationServer" fork="yes">
            <arg value="-config"/>
            <arg value="${maven.appserver.dir}/conf/server.xml"/>
            <classpath>
              <fileset dir="${maven.appserver.home}">
                  <include name="*.jar"/>
              </fileset>
            </classpath>
        </java>

    </target>

    <!--
       ========================================================================
         Stop Orion 1.4
       ========================================================================
    -->
    <target name="stop.orion.14">

        <java classname="com.evermind.client.orion.OrionConsoleAdmin" fork="yes">
            <arg value="ormi://localhost:23791/"/>
            <arg value="admin"/>
            <arg value="password"/>
            <arg value="-shutdown"/>
            <classpath>
              <fileset dir="${maven.appserver.home}">
                  <include name="*.jar"/>
              </fileset>
            </classpath>
        </java>

    </target>

    <!--
       ========================================================================
         Display a warning message if the needed servlet engine home property
         is not set
       ========================================================================
    -->
    <target name="check.test.orion.14" unless="maven.appserver.home">

        <echo message=""/>
        <echo message="******************************************************"/>
        <echo message="WARNING : The 'maven.appserver.home' property has not been"/>
        <echo message="set. No test will be run on that servlet engine."/>
        <echo message="******************************************************"/>
        <echo message=""/>

    </target>

    <!--
       ========================================================================
         Prepare directories and variables for running the tests
       ========================================================================
    -->
    <target name="prepare.test.orion.14"
        depends="check.test.orion.14,testwar" if="maven.appserver.home">

        <echo message="maven.appserver.home = ${maven.appserver.home}"/>

        <property name="maven.appserver.dir" value="${target.test.dir}/orion14"/>
        <property name="conf.orion14.dir" value="${conf.test.dir}/orion14"/>

        <!-- Create work and conf directories and copy configuration files -->
        <mkdir dir="${maven.appserver.dir}"/>
        <mkdir dir="${maven.appserver.dir}/conf"/>

        <!-- Orion need to have a /persistence directory created, otherwise
             it throws an error -->
        <mkdir dir="${maven.appserver.dir}/persistence"/>

        <copy todir="${maven.appserver.dir}/conf" filtering="on">
            <fileset dir="${conf.orion14.dir}"/>
        </copy>

        <!-- Copy the war file -->
        <copy file="${target.test.dir}/test.war"
            tofile="${maven.appserver.dir}/test.war"/>

    </target>
