<?xml version="1.0"?>

<project name="portal-test-glassfish" basedir="." default="test" xmlns:antelope="antlib:ise.antelope.tasks">
	<import file="build-test.xml" />

	<target name="run-glassfish">
		<antcall target="clean-up-logs" />

		<record action="start" name="log" />

		<antcall target="run-simple-server">
			<param name="simple.server.dir" value="${app.server.glassfish.dir}" />
			<param name="simple.server.bin.dir" value="${app.server.glassfish.bin.dir}" />
			<param name="simple.server.deploy.dir" value="${app.server.glassfish.deploy.dir}" />
			<param name="simple.server.lib.global.dir" value="${app.server.glassfish.lib.global.dir}" />
			<param name="simple.server.portal.dir" value="${app.server.glassfish.instance.dir}/applications/liferay-portal" />
			<param name="simple.server.start.executable" value="asadmin${file.suffix.bat}" />
			<param name="simple.server.start.executable.arg.line" value="start-domain -v" />
			<param name="simple.server.stop.executable" value="asadmin${file.suffix.bat}" />
			<param name="simple.server.stop.executable.arg.line" value="stop-domain" />
		</antcall>

		<record action="stop" name="log" />

		<antcall target="evaluate-logs" />
	</target>

	<target name="run-selenium-glassfish">
		<if>
			<not>
				<isset property="build.app.server" />
			</not>
			<then>
				<ant antfile="build-dist.xml" target="build-dist-glassfish" />
			</then>
		</if>

		<antcall target="revert-test-properties" />

		<antcall target="prepare-virtual-host-name-properties" />

		<antcall target="start-selenium" />

		<antcall target="run-glassfish">
			<param name="test.class" value="${test.name}" />
		</antcall>

		<antcall target="stop-selenium" />
	</target>
</project>