Automated TestCycle Unit Testing Module

Public Targets

TargetDescription
testcyclerun integration tests, starts/stops server as needed

Source: testcycle.xml

				<?xml version="1.0" encoding="UTF-8"?>
<project name="testcycle">
	<description>
  + ==\_/============J=A=V=A=G=E=N===A=N=T===M=O=D=U=L=E=S================= +
  +  \(_)/                                                                  +
  +  -(_)-          Automated TestCycle Unit Testing Module                 +
  +  /(_)\                                                                  +
  + ======================================================================= +
  +    Copyright (c) 2002-2005 Outsource Cafe, Inc.  All rights reserved.   +
  + ======================================================================= +
  +
  + Deploys/Undeploys module to server and calls 'itest' target.  This module
  + adds continious integration automation to the itest.xml module.
  +
  + Standard Targets: 
  +   testcycle - builds, deploys, starts server (if not running) and tests
  +
  + Prerequisite modules: 
  +   props-global.xml, classpath.xml, appserver-X.xml, (itest.xml or ejbtest-X.xml)
  +
  + Prerequisite targets: 
  +   itest.run - (itest.xml/ejbtest.xml) runs unit test(s).
  +   itest.fail - (itest.xml/ejbtest.xml) handles test failure clean-up.
  +   started - (appserver-X.xml) checks if server allready running
  +   start - (appserver-X.xml) called if server is not running
  +   stop - (appserver-X.xml) called only if start was called
  +   deploy - (appserver-X.xml) called after server start
  +   undeploy - (appserver-X.xml) called after tests are run
  +
  + Prerequisite properties: 
  +   appserver.start.delay - (appserver-X.xml) Max seconds needed to start server.
  +   appserver.deploy.delay - (appserver-X.xml) Max seconds needed to deploy distro.
  +
  + developer: RichardEasterling@OutsourceCafe.com
  + ======================================================================= +
  + Licensed under the Apache License, Version 2.0 (the "License");
  + you may not use this file except in compliance with the License.
  + You may obtain a copy of the License at
  +
  +   http://www.apache.org/licenses/LICENSE-2.0
  +
  + Unless required by applicable law or agreed to in writing, software
  + distributed under the License is distributed on an "AS IS" BASIS,
  + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + See the License for the specific language governing permissions and
  + limitations under the License.
  + =J=A=M===========================================J=A=V=A=G=E=N=.=C=O=M= +
	</description>
	<property name="TESTCYCLE.PRESENT" value="true"></property>
	<!-- ====================================================================== -->
	<!-- standard targets: -->
	<!-- ====================================================================== -->
	<target name="testcycle" depends="server.cycle" description="run integration tests, starts/stops server as needed"></target>
	<!-- ====================================================================== -->
	<!-- testcycle: start,deploy,deploydelay,itest.run,undeploy,stop -->
	<!-- ====================================================================== -->
	<target name="server.cycle" depends="started">
		<fail unless="APPSERVER.PRESENT" message="No app server imported into build"></fail>
		<parallel>
			<antcall target="start"></antcall>
			<sequential>
				<echo>Application Server Start Delay - sleeping ${appserver.start.delay}s...</echo>
				<waitfor maxwait="${appserver.start.delay}" maxwaitunit="second" checkevery="5" checkeveryunit="second">
					<isset property="server.started"></isset>
				</waitfor>
				<echo>Application Server Started</echo>
				<antcall target="post.start.sequence"></antcall>
			</sequential>
		</parallel>
	</target>
	<!-- ====================================================================== -->
	<!-- post-start sequence supports testcycle -->
	<!-- ====================================================================== -->
	<target name="post.start.sequence" depends="deploy,deploy.delay,itest.run,undeploy,stop,itest.fail"></target>
	<!-- =================================================================== -->
	<!-- deploydelay - seconds to wait before deployment completes-->
	<!-- =================================================================== -->
	<target name="deploy.delay">
		<echo>Application Server Deploy Delay - sleeping ${appserver.deploy.delay}s...</echo>
		<sleep seconds="${appserver.deploy.delay}"></sleep>
	</target>
</project>