What do I need to make this work. I am sure I am doing something simple wrong. Thanks for any help.
component extends=“coldbox.system.testing.BaseTestCase” appMapping="/awng" displayname=“AllTests” output=“false” hint=“Test suite for test cases.”
{
// Test Suite
public void function suite() output=“false”
{
testSuite = CreateObject(“component”,“mxunit.framework.TestSuite”).TestSuite();
//Add all runnable methods in LoginTest
testSuite.addAll(“test.integration.LoginTest”);
Okay, I thought you could call a testsuite from eclipse (ColdFusion Builder 2) I have everything else working I think.
I saw in the ColdBox documentaiton -
ColdBox Test Suites
So now that you completed your incredible unit test, you can also create testing suites. The Application Template comes with a pre-coded testing suite to cover the two test cases: generalTest.cfc and mainTest.cfc. So below you can see the code for the test suite for cfcunit:
**<cfcomponent** displayname="AllTests" output="false" hint="Test suite for test cases.">
**<cffunction** name="suite" returntype="org.cfcunit.framework.Test" access="public" output="false">
**<cfset** var suite = CreateObject("component", "org.cfcunit.framework.TestSuite").init("Test Suite")>
<--- Add the test cases --->
**<cfset** suite.addTestSuite(CreateObject("component", "cases.generalTest"))>
**<cfset** suite.addTestSuite(CreateObject("component", "cases.mainTest"))>
**<cfreturn** suite/>
**</cffunction>**
**</cfcomponent>**
Here is the test suite for mxunit:
**<cfscript>**
testSuite = CreateObject("component","mxunit.framework.TestSuite").TestSuite();
//Add all runnable methods in MyComponentTest
testSuite.addAll("generalTest");
testSuite.addAll("mainTest");
results = testSuite.run();
writeOutput(results.getResultsOutput('html'));
**</cfscript>**
All this does is add the two test cases we created to the suite. We can then test all of them at once via cfcUnit or test the entire directory via mxunit.