<project default="run.tests">

    <target name="check.abHome-1">
        <condition property="abHomeSet">
            <not>
                <equals arg1="${ABHOME}" arg2=""/>
            </not>
        </condition>
    </target>

    <target name="check.abHome" depends="check.abHome-1" unless="abHomeSet">
        <fail message="ABHOME is not set... set it to IA installation directory..."/>
    </target>

    <target name="run.tests">
        <echo message="Running Security tests ..."/>
        <mkdir dir="${ABHOME}/log"/>
        <junit fork="yes" newenvironment="yes" showoutput="yes" jvm="${ABHOME}/java/bin/java.exe"
            failureproperty="junitfailed" printsummary="on">
            <classpath>
                <pathelement path="${ABHOME}/config"/>
                <fileset dir="${ABHOME}/lib" casesensitive="no">
                    <include name="ab-jnpserver.jar"/>
                    <include name="ab-presentation.jar"/>
                    <include name="ab-reqres.jar"/>
                    <include name="apv.jar"/>
                    <include name="audit-client.jar"/>
                    <include name="audit-server.jar"/>
                    <include name="Coregui.jar"/>
                    <include name="Coreguitest.jar"/>
                    <include name="CoreUtil.jar"/>
                    <include name="esig-client.jar"/>
                    <include name="esig-server.jar"/>
                    <include name="print.jar"/>
                    <include name="security-client.jar"/>
                    <include name="security-server.jar"/>
                    <include name="security-pTest.jar"/>
                    <include name="securitygui.jar"/>
                    <include name="transaction.jar"/>
                </fileset>
                <fileset dir="${ABHOME}/lib/junit" casesensitive="no">
                    <include name="jfcunit.jar"/>
                    <include name="jakarta-regexp-1.2.jar"/>
                </fileset>
                <fileset dir="${ABHOME}/lib/javamail" casesensitive="no">
                    <include name="mail.jar"/>
                </fileset>
                <fileset dir="${ABHOME}/lib/javaxml" casesensitive="no">
                    <include name="castor.jar"/>
                    <include name="castor-xml.jar"/>
                    <include name="dom.jar"/>
                    <include name="xercesImpl.jar"/>
                </fileset>
                <fileset dir="${ABHOME}/lib/JBoss" casesensitive="no">
                    <include name="activation.jar"/>
                    <include name="jbossall-client.jar"/>
                </fileset>
                <fileset dir="${ABHOME}/lib/derby" casesensitive="no">
                    <include name="derby.jar"/>
                </fileset>
            </classpath>
            <sysproperty key="user.dir" value="${ABHOME}/config/"/>
            <sysproperty key="user.bin" value="${ABHOME}/bin"/>
            <sysproperty key="ab.home" value="${ABHOME}"/>
            <sysproperty key="java.library.path" value="${ABHOME}/bin"/>
            <sysproperty key="ab.TestUsers.DBTest" value="com.apldbio.core.security.DBStub"/>
            <sysproperty key="java.security.auth.login.config" value="${ABHOME}/config/jaas.config"/>
            <sysproperty key="com.apldbio.core.security.Interactor" value="com.apldbio.core.security.auth.impl.TextInteractorStub"/>
            <sysproperty key="com.apldbio.core.proxy.ConfigURL" value="file:///${ABHOME}/config/iasec-test-clientconfig.xml"/>
            <sysproperty key="com.apldbio.security.keyFile" value="file:/${ABHOME}/config/password.dat"/>
            <sysproperty key="com.apldbio.core.security.db.DataSource" value="DerbyDataSource"/>
            <sysproperty key="com.apldbio.core.esig.impl.ESigEventPersistence" value="com.apldbio.core.esig.file.ESigEventPersistenceFile"/>
            <sysproperty key="com.apldbio.core.audit.impl.AuditRecordPersistence" value="com.apldbio.core.audit.file.AuditRecordFile"/>
            <sysproperty key="QueryBuilder" value="com.apldbio.core.audit.QueryBuilderFile"/>
            <formatter type="xml"/>
            <test name="com.apldbio.core.security.AllTests" todir="${ABHOME}/log" outfile="AutoTestSecurityClientResults"/>
        </junit>
    </target>
</project>
