MXUnit Unit Testing framework for ColdFusion developers Download Details Home Support BlogWhen you have a multiple tests all residing in a directory and subdirectories, it's very conventient to run everything contained in those directories. In this context, a directory of tests implies a test suite, and MXUnit enables you to run directories as test suites.
Running directories of tests can be done with a single line of code:
<cfinvoke component="mxunit.runner.DirectoryTestSuite"
method="run"
directory="#expandPath('/mxunit/PluginDemoTests')#"
recurse="true"
excludes="InvalidMarkupTest,FiveSecondTest"
returnvariable="results" />
Explanantion:
component: The MXUnit runner component responsible for running all the tests.method: The component's method being invoked.directory: A physical path to the directory containing your tests.recurse: A flag to indicate whether or not to run tests in all subdirectories.excludes: A list of component names to exclude.returnvariable: The variable name of the TestResult object returnedcomponentPath: (Not listed above) Optional parameter that increases performance. This is the component name prefix; e.g., com.foo.bar. If not specified, MXUnit will locate the full component name using the ColdFusion server cache of components.
<cfinvoke component="mxunit.runner.DirectoryTestSuite"
method="run"
directory="#expandPath('/mxunit/PluginDemoTests')#"
recurse="true"
excludes="InvalidMarkupTest,FiveSecondTest"
returnvariable="results" />
<cfoutput> #results.getResultsOutput('extjs')# </cfoutput>
Copy the above to a file called /mxunit/doc/tutorial/directoryRunner.cfm and run it: http://localhost:8500/mxunit/doc/tutorial/directoryRunner.cfm
You should see this:
