Skip to content

Commit

Permalink
Merge pull request #157 from zspitzer/change-addall-to-append
Browse files Browse the repository at this point in the history
TESTBOX-407 switch from java method addAll() to cfml array.Append()
  • Loading branch information
lmajano authored Dec 5, 2024
2 parents 66b3ebc + 42ec064 commit d3e47f0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions system/BaseSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,11 @@ component {
var consolidatedLabels = arguments.spec.labels;
var md = getMetadata( this );
param md.labels = "";
consolidatedLabels.addAll( listToArray( md.labels ) );
consolidatedLabels.append( listToArray( md.labels, true ) );
// Build labels from nested suites, so suites inherit from parent suite labels
var parentSuite = arguments.suite;
while ( !isSimpleValue( parentSuite ) ) {
consolidatedLabels.addAll( parentSuite.labels );
consolidatedLabels.append( parentSuite.labels, true );
parentSuite = parentSuite.parentref;
}

Expand Down
8 changes: 4 additions & 4 deletions system/TestBox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -406,16 +406,16 @@ component accessors="true" {

// Verify URL conventions for bundle, suites and specs exclusions.
if ( !isNull( url.testBundles ) ) {
testBundles.addAll( listToArray( urlDecode( url.testBundles ) ) );
testBundles.append( listToArray( urlDecode( url.testBundles ) ), true );
}
if ( !isNull( url.testSuites ) ) {
arguments.testSuites.addAll( listToArray( urlDecode( url.testSuites ) ) );
arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true );
}
if ( !isNull( url.testSpecs ) ) {
arguments.testSpecs.addAll( listToArray( urlDecode( url.testSpecs ) ) );
arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true );
}
if ( !isNull( url.testMethod ) ) {
arguments.testSpecs.addAll( listToArray( urlDecode( url.testMethod ) ) );
arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true );
}

// Using a directory runner?
Expand Down
6 changes: 3 additions & 3 deletions system/compat/framework/TestSuite.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ component accessors="true" {

remote function addTest( required componentName, required method ){
arrayAppend( variables.bundles, arguments.componentName );
variables.testSpecs.addAll( listToArray( arguments.method ) );
variables.testSpecs.append( listToArray( arguments.method ), true );
return this;
}

remote function add( required componentName, required methods ){
arrayAppend( variables.bundles, arguments.componentName );
variables.testSpecs.addAll( listToArray( arguments.methods ) );
variables.testSpecs.append( listToArray( arguments.methods ), true );
return this;
}

Expand All @@ -36,7 +36,7 @@ component accessors="true" {

remote function run( testMethod = "" ){
if ( len( arguments.testMethod ) ) {
variables.testSpecs.addAll( listToArray( arguments.testMethod ) );
variables.testSpecs.append( listToArray( arguments.testMethod ), true );
}
return new Results( variables.bundles, variables.testSpecs );
}
Expand Down
2 changes: 1 addition & 1 deletion system/runners/BDDRunner.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ component
// Build labels from nested suites, so suites inherit from parent suite labels
var parentSuite = arguments.suite;
while ( !isSimpleValue( parentSuite ) ) {
consolidatedLabels.addAll( parentSuite.labels );
consolidatedLabels.append( parentSuite.labels, true );
parentSuite = parentSuite.parentref;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/runners/mxunit/compat-testsuites.cfm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<cfsetting showdebugoutput="false" >
<cfset suite = new testbox.system.compat.framework.TestSuite().TestSuite()>
<cfset suite.addAll( "testbox.tests.specs.MXUnitCompatTest" )>
<cfset suite.append( "testbox.tests.specs.MXUnitCompatTest" )>
<cfset r = suite.run()>
<cfoutput>#r.getResultsOutput( reporter="simple" )#</cfoutput>

Expand Down

0 comments on commit d3e47f0

Please sign in to comment.