I am having some trouble getting MX Unit configured to work with ColdBox under Eclipse.
ColdBox v3.1.0
MXUnit v2.1.1
Tomcat v7.0.23
Railo v3.3.1
Mac OSX v10.7.3
I belive that have configured the default installation settings and the project being run from the root directory (http://localhost:8080/index.cfm/home/aboutsite).
http://localhost:8080/
/coldbox
/config
/handlers
/mxunit
/test/integration/HomeTest.cfc
The project is configured with the URL http://localhost:8080/mxunit/framework/RemoteFacade.cfc?wsdl which passes the test from the MXUnit Properties window.
Here is the content of my test case HomeTest.cfc:
component extends=“coldbox.system.testing.BaseTestCase” {
public void function setUp() {
//Setup ColdBox Mappings For this Test
setAppMapping(ExpandPath( “…/…/”));
setConfigMapping(ExpandPath(instance.AppMapping & “config/Coldbox.cfc”));
// Call the super setup method to setup the app.
super.setup();
}
public void function testPlain() {
assertTrue(true);
}
}
When I run the test, the MXUnit plug in shows success, but the Tomcat console reports the following error message:
key [cbController] doesn’t exist in struct (keys:applicationname,wireBox)
at railo.runtime.type.util.StructSupport.invalidKey(StructSupport.java:30):30
at railo.runtime.type.StructImpl.get(StructImpl.java:78):78
at railo.runtime.type.util.StructSupport.get(StructSupport.java:125):125
at coldbox.system.coldbox_cfc$cf.udfCall1(/Users/brian/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Railo_3_3_1/coldbox/system/Coldbox.cfc:395):395
If I change the test case to include a call to getRequestContext(), the test case succeeds and the RequestContext is displayed in the output, but the same error is given in the Tomcat console.
public void function testPlain() {
local.rc = getRequestContext();
debug(local.rc);
assertTrue(true);
}
If I change the test case to include a call to execute() such as the one below, then the test fails with the error “railo.runtime.exp.Abort: Page request is aborted”, but the Tomcat console does not show an error message.
public void function testPlain() {
execute(“home.aboutSite”);
assertTrue(true);
}
Additionally, once I run any of these test cases, the MXUnit Plugin “Test Facade URL” fails with the key [cbController] doesn’t exist in struct (keys:applicationname,wireBox) error until I restart the server.
So, what do I not have configured correctly?
Brian