<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- $Revision: 1.3 $ $Date: 2004/12/03 03:52:52 $ -->

<project default="default"
    xmlns:j="jelly:core"
    xmlns:ant="jelly:ant"
    xmlns:maven="jelly:maven"
    xmlns:u="jelly:util"
    xmlns:deploy="geronimo:deploy"
    >

    <goal name="default" prereqs="jar:install"/>

    <postGoal name="jar:install">
        <attainGoal name="itest"/>
    </postGoal>

    <preGoal name="itest:setup">
        <delete dir="${maven.build.dir}/geronimo"/>
        <deploy:unpackServer
            geronimoVersion="1.0-SNAPSHOT"
            />
        <deploy:startRemoteServer
            geronimoTarget="${maven.build.dir}/geronimo"
            configs="org/apache/geronimo/ActiveMQServer org/apache/geronimo/RuntimeDeployer"/>
        <ant:echo message="Waiting for server"/>
        <deploy:waitForStarted
            uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
            username="system"
            password="manager"
            id="org/apache/geronimo/RuntimeDeployer"/>
        <echo message="server has started"/>
        <deploy:distribute
            uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
            username="system"
            password="manager"
	    module="${maven.repo.local}/${pom.groupId}/ears/activemq-itest-ear-${pom.currentVersion}.ear"
            />
        <deploy:start
            uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
            username="system"
            password="manager"
            id="org/codehaus/activemq/itest/ServerEar"/>
    </preGoal>

    <postGoal name="itest:teardown">
        <deploy:stopRemoteServer
            uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
            username="system"
            password="manager"/>
        <sleep seconds="2"/>
        <echo message="server has stopped"/>
    </postGoal>

</project>
