Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 749e500f09
Fetching contributors…

Cannot retrieve contributors at this time

148 lines (111 sloc) 6.29 KB
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="CFMongoDB" basedir="." default="runtests">
<target name="init">
<!-- //////// DIRECTORY AND CFC PATH SETUP (used in all targets) -->
<!-- what's the directory name of your application? this value will be used throughout this build file; if you don't want that, just replace the references to ${} with your desired values -->
<property name="" value="cfmongodb" />
<!-- what's the name of the directory where your tests live? Note: this is just the name of the directory, not the full path-->
<property name="" value="test" />
<!-- where do your tests live, relative to this build file? test.dir.location will be a full path to a directory -->
<property name="test.dir.location" location="${}" />
<!-- what is the cfc dot-notation path to that directory, as ColdFusion sees it? -->
<property name="test.cfcpath" value="${}.${}" />
<!-- //////// MXUNIT ANT TASK SETUP (used in runtests and junitreport targets) -->
<!-- what server and port should your tests run against? -->
<property name="test.server" value="localhost" />
<property name="test.serverport" value="80" />
<!-- what "runner" URL should the tests hit. In this example, you'd be hitting http://localhost:80/DirectoryNameOfYourProject/test/HttpAntRunner.cfc Simply copy mxunit/samples/HttpAntRunner.cfc into your test directory! -->
<property name="test.runner" value="/${}/${}/HttpAntRunner.cfc" />
<!-- this is where the xml and html will live for the report generator -->
<property name="test.output" location="${}/testresults" />
<property name="test.output.xml" location="${test.output}/xml" />
<property name="test.junitoutput" location="${test.output}/html" />
<!-- //////// ZIP-FILE SETUP (used by "dist" target) -->
<!-- where the zip file for deployment will live -->
<property name="dist.dir" location="deploy" />
<!-- what to call it -->
<property name="" value="${}.zip" />
<!-- what to start the "path" in the zip with -->
<property name="dist.prefixInZip" value="${}" />
<!-- where does the mxunit ant jar file live? it's easiest to copy it out of the mxunit install and put it into your app
You can also put any other ant-relatd jars in this directory; for example, if you want to use svnant, you'll need to put those jars here
<path id="project.classpath">
<fileset dir="lib">
<include name="**/*.jar" />
<property name="MongoDBService" value="'Mongo DB'"/>
<!-- dump the properties -->
<echoproperties prefix="test" />
<echoproperties prefix="dist" />
<target name="clean" depends="init">
<mkdir dir="${test.output.xml}" />
<mkdir dir="${test.junitoutput}" />
<mkdir dir="${dist.dir}" />
<target name="runtests" description="Make output directories and run the MXUnit task" depends="init,clean,jar">
<delete dir="${test.output.xml}/core" failonerror="false" />
<mkdir dir="${test.output.xml}/core" />
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpathref="project.classpath" />
<mxunittask server="${test.server}" port="${test.serverport}" defaultrunner="${test.runner}" outputdir="${test.output.xml}/core" verbose="true">
<directory path="${test.dir.location}" recurse="false" packageName="${test.cfcpath}" componentPath="${test.cfcpath}" />
<target name="runCFJavaloaderTests" depends="init,clean">
<delete dir="${test.output.xml}/withCFJavaloader" failonerror="false" />
<mkdir dir="${test.output.xml}/withCFJavaloader" />
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpathref="project.classpath" />
<mxunittask server="${test.server}" port="${test.serverport}" defaultrunner="/cfmongodb/test/withCFJavaloader/HttpAntRunner.cfc" outputdir="${test.output.xml}/withCFJavaloader" verbose="true">
<directory path="${test.dir.location}/withCFJavaloader" recurse="false" packageName="${test.cfcpath}.withCFJavaloader" componentPath="${test.cfcpath}.withCFJavaloader" />
<target name="runWithLibsFromClasspathTests" depends="init,clean">
<delete dir="${test.output.xml}/withLibsFromCFClasspath" failonerror="false" />
<mkdir dir="${test.output.xml}/withLibsFromCFClasspath" />
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpathref="project.classpath" />
<mxunittask server="${test.server}" port="${test.serverport}" defaultrunner="${test.runner}" outputdir="${test.output.xml}/withLibsFromCFClasspath" verbose="true">
<directory path="${test.dir.location}/withLibsFromCFClasspath" recurse="false" packageName="${test.cfcpath}.withLibsFromCFClasspath" componentPath="${test.cfcpath}.withLibsFromCFClasspath" />
<target name="dist" depends="init,jar" description="Builds the zip file for deployment">
<zip destfile="${dist.dir}/${}">
<zipfileset dir="." excludes=".git/, .gitignore, deploy/, settings.xml, .settings, java/bin/" prefix="${dist.prefixInZip}" casesensitive="false" />
<target name="compile" depends="init">
<mkdir dir="java/bin"/>
<javac srcdir="java/src" destdir="java/bin" classpathref="project.classpath" />
<target name="jar" depends="compile">
<delete file="lib/cfmongodb.jar" />
<jar destfile="lib/cfmongodb.jar" basedir="java/bin" />
<target name="buildAPIDocs" depends="init">
<delete dir="doc/api" />
<mkdir dir="doc" />
<loadresource property="apidocgen" failonerror="true">
<url url="http://${test.server}:${test.serverport}/cfmongodb/doc/build.cfm" />
<target name="startMongoService" depends="init">
<echo message="starting ${MongoDBService}"/>
<exec executable="cmd.exe">
<arg line="/c"/>
<arg line="net"/>
<arg line="start"/>
<arg line="${MongoDBService}"/>
<target name="stopMongoService" depends="init">
<echo message="stopping ${MongoDBService}"/>
<exec executable="cmd.exe">
<arg line="/c"/>
<arg line="net"/>
<arg line="stop"/>
<arg line="${MongoDBService}"/>
Jump to Line
Something went wrong with that request. Please try again.