From 9bf401e8d0ee62bd4b7a1c5669da920988c94194 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Tue, 27 Sep 2016 08:12:40 -0400 Subject: [PATCH] fixes errors when test harness URL is called without an initial call to the root path --- tests/Application.cfc | 40 ++++++++++++++++++++++++++++++++++++++++ tests/test.xml | 9 ++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 tests/Application.cfc diff --git a/tests/Application.cfc b/tests/Application.cfc new file mode 100644 index 00000000..03a27fdb --- /dev/null +++ b/tests/Application.cfc @@ -0,0 +1,40 @@ +/** +* Copyright Since 2005 Ortus Solutions, Corp +* www.coldbox.org | www.luismajano.com | www.ortussolutions.com | www.gocontentbox.org +************************************************************************************** +*/ +component{ + this.name = "A TestBox Runner Suite " & hash( getCurrentTemplatePath() ); + // any other application.cfc stuff goes below: + this.sessionManagement = true; + + // COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP + COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( expandPath( '../Application.cfc' ) ); + + // The web server mapping to this application. Used for remote purposes or static purposes + COLDBOX_APP_MAPPING = "/"; + // COLDBOX PROPERTIES + COLDBOX_CONFIG_FILE = "config.Coldbox"; + // COLDBOX APPLICATION KEY OVERRIDE + COLDBOX_APP_KEY = ""; + + // any mappings go here, we create one that points to the root called test. + this.mappings[ "/tests" ] = getDirectoryFromPath( getCurrentTemplatePath() ); + rootPath = REReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" ); + this.mappings[ "/root" ] = rootPath; + this.mappings[ "/relax" ] = COLDBOX_APP_ROOT_PATH & "modules/relax"; + this.mappings[ "/cbjavaloader" ] = COLDBOX_APP_ROOT_PATH & "modules/cbjavaloader"; + + // application start + public boolean function onApplicationStart(){ + application.cbBootstrap = new coldbox.system.Bootstrap( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING ); + application.cbBootstrap.loadColdbox(); + return true; + } + + // request start + public boolean function onRequestStart( String targetPage ){ + return true; + } + +} \ No newline at end of file diff --git a/tests/test.xml b/tests/test.xml index 7a82d325..d4432038 100644 --- a/tests/test.xml +++ b/tests/test.xml @@ -58,6 +58,7 @@ PLEASE NOTE THAT YOU MUST ALTER THE RUNNER'S URL ACCORDING TO YOUR ENVIRONMENT. + @@ -92,8 +93,9 @@ PLEASE NOTE THAT YOU MUST ALTER THE RUNNER'S URL ACCORDING TO YOUR ENVIRONMENT. - + + + + +