Hi all,
I’ve just started playing with Coldbox and am thrilled at the depth and breadth of the tool.
I’ve managed to fight my way thru several little stumbles up the learning curve but find myself at a loss at the moment. I’m hoping someone will be able to point me in the right direction.
All seemed to be working. I had the ormSettings incorrectly configured and was getting postgresql error "cross-database references are not implemented"
I fixed the ormSettings such that the query would hit ‘test2.public’ and now get "ColdBox Controller Not Found"
Googling this I find Google Groups but I can’t seem to make heads or tails of what that is about.
------------------------------ My testbox ‘application.cfc’ ------------------------------------
<cfset this.name = “ColdBoxTestingSuite” & hash(getCurrentTemplatePath())>
<cfset this.mappings[ “/tests” ] = getDirectoryFromPath( getCurrentTemplatePath() )>
<cfset this.mappings[ “/coldbox” ] = “/var/www/coldbox”>
<cfset this.mappings[ “/models” ] = “/var/www/curator/models”>
<cfset this.mappings[ “/testbox” ] = “/var/www/coldbox/testbox”>
<cfset this.mappings[ “/cborm” ] = “/var/www/coldbox/modules/cborm”>
<cfset rootPath = REReplaceNoCase( this.mappings[ “/tests” ], “tests(\|/)”, “” )>
<cfset this.mappings[ “/root” ] = rootPath>
this.javaSettings = { loadPaths = [ “lib” ], reloadOnChange = false };
this.datasource = “curator”;
this.ormenabled = true;
this.ormSettings = {
datasource = “curator”,
cfclocation = this.mappings[ “/models” ],
catalog = “test2”,
schema = “public”,
dbcreate = “none”,
dialect = “PostgreSQL”,
logSQL = true,
// Enable event handling
eventHandler = “cborm.models.EventHandler”
// Set the event handler to use, which will be inside our application.
};
--------------------------- My ‘articleTest.cfc’ --------------------------------
component extends=“testbox.system.BaseSpec”{
/*********************************** LIFE CYCLE Methods ***********************************/
// executes before all suites+specs in the run() method
function beforeAll(){
aService = createObject(‘component’, ‘models.article.articleService’).init();
mockArticle = getMockBox().createMock(“models.article.article”).init(aService);
mockArticle.$property(propertyName=“ArticleID”,mock=“123456”);
mockArticle.$property(propertyName=“Headline”,mock=“A Sample Headline”);
}
// executes after all suites+specs in the run() method
function afterAll(){
}
/*********************************** BDD SUITES ***********************************/
function run( testResults, testBox ){
// all your suites go here.
describe( “An article”, function(){
it(“should be an object”, function(){
expect(mockArticle).toBeComponent();
});
it(“should be able to be created”, function(){
oA = aService.get(0);
expect(oA).toBeComponent();
});
});
}
}
---------------------- My articleService.cfc ----------------------------------------------
/**
-
Article service
/
component extends=“cborm.models.VirtualEntityService” singleton{
/* -
Constructor
*/
function init(){
// init super class
super.init(entityName=“article”);
// Use Query Caching
setUseQueryCaching( false );
// Query Cache Region
setQueryCacheRegion( ‘query.article’ );
// EventHandling
setEventHandling( true );
return this;
}
}