Skip to content

Commit

Permalink
fixes errors when test harness URL is called without an initial call …
Browse files Browse the repository at this point in the history
…to the root path
  • Loading branch information
jclausen committed Sep 27, 2016
1 parent 7f23306 commit 9bf401e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
40 changes: 40 additions & 0 deletions 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;
}

}
9 changes: 8 additions & 1 deletion tests/test.xml
Expand Up @@ -58,6 +58,7 @@ PLEASE NOTE THAT YOU MUST ALTER THE RUNNER'S URL ACCORDING TO YOUR ENVIRONMENT.

<!-- Start Init -->
<delete dir="${report.dir}" />
<mkdir dir="${report.dir}" />
<mkdir dir="${junitreport.dir}" />
<!-- update permissions -->
<antcall target="update.permissions" />
Expand Down Expand Up @@ -92,8 +93,9 @@ PLEASE NOTE THAT YOU MUST ALTER THE RUNNER'S URL ACCORDING TO YOUR ENVIRONMENT.
</exec>
<!-- Startup the apidocs server, wait for a few seconds for server to start -->
<exec executable="box" dir="${appdir}">
<arg line="server start" />
<arg line="server start --force" />
</exec>

<sleep seconds="5"/>

<!-- Directory Runner
Expand All @@ -109,6 +111,11 @@ PLEASE NOTE THAT YOU MUST ALTER THE RUNNER'S URL ACCORDING TO YOUR ENVIRONMENT.
<get dest="${report.dir}/results.txt"
src="${url.runner}&amp;reporter=${test.reporter}&amp;labels=${test.labels}&amp;reportPath=${report.dir}&amp;propertiesSummary=true"
verbose="true"/>

<!-- stop our server -->
<exec executable="box" dir="${appdir}">
<arg line="server stop --force" />
</exec>

<!-- Bundles Runner
You can also run tests for specific bundles by using the runner with the bundles params
Expand Down

0 comments on commit 9bf401e

Please sign in to comment.