Skip to content

Commit

Permalink
Apply cfformat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano authored and github-actions[bot] committed Apr 20, 2023
1 parent 286841c commit 844d3af
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions test-harness/tests/Application.cfc
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
/**
* Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
* www.ortussolutions.com
* ---
*/
component{
* Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
* www.ortussolutions.com
* ---
*/
component {

// The name of the module used in cfmappings ,etc
request.MODULE_NAME = "route-visualizer";
// The directory name of the module on disk. Usually, it's the same as the module name
request.MODULE_PATH = "route-visualizer";

// APPLICATION CFC PROPERTIES
this.name = "#request.MODULE_NAME# Testing Suite";
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan( 0, 0, 15, 0 );
this.applicationTimeout = createTimeSpan( 0, 0, 15, 0 );
this.setClientCookies = true;
this.name = "#request.MODULE_NAME# Testing Suite";
this.sessionManagement = true;
this.sessionTimeout = createTimespan( 0, 0, 15, 0 );
this.applicationTimeout = createTimespan( 0, 0, 15, 0 );
this.setClientCookies = true;
// Turn on/off white space management
this.whiteSpaceManagement = "smart";
this.enableNullSupport = shouldEnableFullNullSupport();
this.enableNullSupport = shouldEnableFullNullSupport();

// Create testing mapping
this.mappings[ "/tests" ] = getDirectoryFromPath( getCurrentTemplatePath() );

// The application root
rootPath = REReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" );
this.mappings[ "/root" ] = rootPath;
rootPath = reReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" );
this.mappings[ "/root" ] = rootPath;

// The module root path
moduleRootPath = REReplaceNoCase( rootPath, "#request.MODULE_PATH#(\\|/)test-harness(\\|/)", "" );
this.mappings[ "/moduleroot" ] = moduleRootPath;
this.mappings[ "/#request.MODULE_NAME#" ] = moduleRootPath & "#request.MODULE_PATH#";
moduleRootPath = reReplaceNoCase(
rootPath,
"#request.MODULE_PATH#(\\|/)test-harness(\\|/)",
""
);
this.mappings[ "/moduleroot" ] = moduleRootPath;
this.mappings[ "/#request.MODULE_NAME#" ] = moduleRootPath & "#request.MODULE_PATH#";

// ORM Definitions
/**
Expand All @@ -50,20 +54,19 @@ component{
**/

function onRequestStart( required targetPage ){

// Set a high timeout for long running tests
setting requestTimeout="9999";
setting requestTimeout ="9999";
// New ColdBox Virtual Application Starter
request.coldBoxVirtualApp = new coldbox.system.testing.VirtualApp( appMapping = "/root" );
request.coldBoxVirtualApp= new coldbox.system.testing.VirtualApp( appMapping = "/root" );

// If hitting the runner or specs, prep our virtual app
if ( getBaseTemplatePath().replace( expandPath( "/tests" ), "" ).reFindNoCase( "(runner|specs)" ) ) {
request.coldBoxVirtualApp.startup();
}

// ORM Reload for fresh results
if( structKeyExists( url, "fwreinit" ) ){
if( structKeyExists( server, "lucee" ) ){
if ( structKeyExists( url, "fwreinit" ) ) {
if ( structKeyExists( server, "lucee" ) ) {
pagePoolClear();
}
// ormReload();
Expand All @@ -73,13 +76,14 @@ component{
return true;
}

public void function onRequestEnd( required targetPage ) {
public void function onRequestEnd( required targetPage ){
request.coldBoxVirtualApp.shutdown();
}

private boolean function shouldEnableFullNullSupport() {
var system = createObject( "java", "java.lang.System" );
var value = system.getEnv( "FULL_NULL" );
return isNull( value ) ? false : !!value;
}
private boolean function shouldEnableFullNullSupport(){
var system = createObject( "java", "java.lang.System" );
var value = system.getEnv( "FULL_NULL" );
return isNull( value ) ? false : !!value;
}

}

0 comments on commit 844d3af

Please sign in to comment.