Skip to content

Commit 3b4ff8c

Browse files
committed
Merge branch 'development' of github.com:coldbox-modules/cbvalidation into development
2 parents bcc70e9 + 6a7ab62 commit 3b4ff8c

File tree

2 files changed

+40
-27
lines changed

2 files changed

+40
-27
lines changed

build/Build.cfc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ component {
130130
)
131131
.toConsole();
132132

133-
// Prepare exports directory
134-
variables.exportsDir = variables.artifactsDir & "/#projectName#/#arguments.version#";
135-
directoryCreate( variables.exportsDir, true, true );
133+
ensureExportDir( argumentCollection = arguments );
136134

137135
// Project Build Dir
138136
variables.projectBuildDir = variables.buildDir & "/#projectName#";
@@ -200,11 +198,12 @@ component {
200198
version = "1.0.0",
201199
outputDir = ".tmp/apidocs"
202200
){
201+
ensureExportDir( argumentCollection = arguments );
202+
203203
// Create project mapping
204204
fileSystemUtil.createMapping( arguments.projectName, variables.cwd );
205205
// Generate Docs
206206
print.greenLine( "Generating API Docs, please wait..." ).toConsole();
207-
directoryCreate( arguments.outputDir, true, true );
208207

209208
command( "docbox generate" )
210209
.params(
@@ -315,4 +314,18 @@ component {
315314
return ( createObject( "java", "java.lang.System" ).getProperty( "cfml.cli.exitCode" ) ?: 0 );
316315
}
317316

317+
/**
318+
* Ensure the export directory exists at artifacts/NAME/VERSION/
319+
*/
320+
private function ensureExportDir(
321+
required projectName,
322+
version = "1.0.0"
323+
){
324+
if ( structKeyExists( variables, "exportsDir" ) && directoryExists( variables.exportsDir ) ){
325+
return;
326+
}
327+
// Prepare exports directory
328+
variables.exportsDir = variables.artifactsDir & "/#projectName#/#arguments.version#";
329+
directoryCreate( variables.exportsDir, true, true );
330+
}
318331
}

test-harness/tests/Application.cfc

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
/**
2-
* Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
3-
* www.ortussolutions.com
4-
* ---
5-
*/
2+
* Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
3+
* www.ortussolutions.com
4+
* ---
5+
*/
66
component {
77

88
// UPDATE THE NAME OF THE MODULE IN TESTING BELOW
99
request.MODULE_NAME = "cbvalidation";
1010
request.MODULE_PATH = "cbvalidation";
1111

1212
// APPLICATION CFC PROPERTIES
13-
this.name = "ColdBoxTestingSuite";
14-
this.sessionManagement = true;
15-
this.setClientCookies = true;
16-
this.sessionTimeout = createTimeSpan( 0, 0, 15, 0 );
17-
this.applicationTimeout = createTimeSpan( 0, 0, 15, 0 );
18-
// Turn on/off white space management
13+
this.name = "ColdBoxTestingSuite";
14+
this.sessionManagement = true;
15+
this.setClientCookies = true;
16+
this.sessionTimeout = createTimespan( 0, 0, 15, 0 );
17+
this.applicationTimeout = createTimespan( 0, 0, 15, 0 );
18+
// Turn on/off white space management
1919
this.whiteSpaceManagement = "smart";
20-
this.enableNullSupport = shouldEnableFullNullSupport();
20+
this.enableNullSupport = shouldEnableFullNullSupport();
2121

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

2525
// The application root
26-
rootPath = reReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" );
27-
this.mappings[ "/root" ] = rootPath;
26+
rootPath = reReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" );
27+
this.mappings[ "/root" ] = rootPath;
2828
this.mappings[ "/cbi18n" ] = rootPath & "modules/cbi18n";
2929

3030
// The module root path
@@ -39,18 +39,18 @@ component {
3939
// request start
4040
public boolean function onRequestStart( String targetPage ){
4141
// Set a high timeout for long running tests
42-
setting requestTimeout="9999";
42+
setting requestTimeout ="9999";
4343
// New ColdBox Virtual Application Starter
44-
request.coldBoxVirtualApp = new coldbox.system.testing.VirtualApp( appMapping = "/root" );
44+
request.coldBoxVirtualApp= new coldbox.system.testing.VirtualApp( appMapping = "/root" );
4545

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

5151
// ORM Reload for fresh results
52-
if( structKeyExists( url, "fwreinit" ) ){
53-
if( structKeyExists( server, "lucee" ) ){
52+
if ( structKeyExists( url, "fwreinit" ) ) {
53+
if ( structKeyExists( server, "lucee" ) ) {
5454
pagePoolClear();
5555
}
5656
// ormReload();
@@ -60,14 +60,14 @@ component {
6060
return true;
6161
}
6262

63-
public void function onRequestEnd( required targetPage ) {
63+
public void function onRequestEnd( required targetPage ){
6464
request.coldBoxVirtualApp.shutdown();
6565
}
6666

67-
private boolean function shouldEnableFullNullSupport() {
68-
var system = createObject( "java", "java.lang.System" );
69-
var value = system.getEnv( "FULL_NULL" );
70-
return isNull( value ) ? false : !!value;
71-
}
67+
private boolean function shouldEnableFullNullSupport(){
68+
var system = createObject( "java", "java.lang.System" );
69+
var value = system.getEnv( "FULL_NULL" );
70+
return isNull( value ) ? false : !!value;
71+
}
7272

7373
}

0 commit comments

Comments
 (0)