Project-Specific RemoteFacade URL

Pointing a project at a custom RemoteFacade URL involves two simple steps:

  1. Create the new RemoteFacade.cfc
  2. Point your project properties to the new URL

How

Creating the new RemoteFacade.cfc

  1. Create a New CFC. Put it wherever. Name it whatever.
  2. Set the "extends" attribute of the component tag to "mxunit.Framework.RemoteFacade"
  3. Ensure you can access the wsdl for the file in a browser. For example, if you created c:\inetpub\wwwroot\myproject\RemoteFacade.cfc, try hitting http://localhost/myproject/RemoteFacade.cfc?wsdl

Pointing your project properties to the new URL

  1. Right click on the project name in the Navigator or Project Explorer
  2. Select "Properties"
  3. Select "MXUnit Properties"
  4. Add the path to your custom remote URL

Example #1: Creating a custom RemoteFacade.cfc for your project which tests CF ORM / Hibernate Components

In your project, create a file named RemoteFacade.cfc and give it this content:

<cfcomponent extends="mxunit.framework.RemoteFacade"> </cfcomponent>

Right click on your project and set the RemoteFacade URL property to point to the URL for this new component

Now, all calls to your tests for this project will route through this RemoteFacade.cfc. Since your project also has an Application.cfc, that means that everything from your Application.cfc will apply

Example #2: Creating a custom RemoteFacade.cfc for your project and including custom behavior for every test case

Follow the same steps as above

In your new RemoteFacade.cfc, implement the actOnTestCase method to peform whatever behavior you would like for each test case. Here's an example:

<cfcomponent extends="mxunit.framework.RemoteFacade"> <cffunction name="actOnTestCase"> <cfargument name="TestCase"> <cfif findNoCase("TestManager.Retail",GetMetadata(TestCase).name)> <cfinclude template="retail/Application.cfm"> <cfelse> <cfinclude template="enrollment/Application.cfm"> </cfif> </cffunction> </cfcomponent>