Skip to content

Commit e37ac8d

Browse files
authored
test: support full-null relationship coverage (#312)
* test: support full-null relationship coverage (#154) * test: avoid literal member syntax on older Adobe CF * test: run all engines with full null support * fix: preserve omitted arguments with full null support * fix: support native BoxLang test coverage * test: stabilize the complete engine matrix * test: use supported full-null engine pairings * test: guard deprecated ColdBox interception data * test: harden ColdBox full-null lazy guards * test: guard optional CacheBox full-null settings * test: complete ColdBox 7 full-null guards * test: patch cbjavaloader for full null support * test: update to TestBox 7 * fix: initialize optional callbacks with full null support * test: patch mementifier for full null support * test: use public struct checks for entity mementos * fix: guard optional state with full null support * fix: preserve relationship keys with full null support * fix: detect omitted null check values * fix: distinguish omitted null check values * test: install MySQL support for BoxLang BE
1 parent 6c486ae commit e37ac8d

39 files changed

Lines changed: 562 additions & 117 deletions
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
diff --git a/tests/resources/app/coldbox/system/testing/VirtualApp.cfc b/tests/resources/app/coldbox/system/testing/VirtualApp.cfc
2+
--- a/tests/resources/app/coldbox/system/testing/VirtualApp.cfc
3+
+++ b/tests/resources/app/coldbox/system/testing/VirtualApp.cfc
4+
@@ -94 +94 @@
5+
- return !isNull( application.cbController );
6+
+ return application.keyExists( "cbController" ) && !isNull( application.cbController );
7+
@@ -112 +112 @@
8+
- if ( !isNull( application.cbController ) ) {
9+
+ if ( application.keyExists( "cbController" ) && !isNull( application.cbController ) ) {
10+
diff --git a/tests/resources/app/coldbox/system/logging/config/LogBoxConfig.cfc b/tests/resources/app/coldbox/system/logging/config/LogBoxConfig.cfc
11+
--- a/tests/resources/app/coldbox/system/logging/config/LogBoxConfig.cfc
12+
+++ b/tests/resources/app/coldbox/system/logging/config/LogBoxConfig.cfc
13+
@@ -64 +64 @@
14+
- if ( isNull( variables.utility ) ) {
15+
+ if ( !variables.keyExists( "utility" ) || isNull( variables.utility ) ) {
16+
diff --git a/tests/resources/app/coldbox/system/core/util/Util.cfc b/tests/resources/app/coldbox/system/core/util/Util.cfc
17+
--- a/tests/resources/app/coldbox/system/core/util/Util.cfc
18+
+++ b/tests/resources/app/coldbox/system/core/util/Util.cfc
19+
@@ -296 +296 @@
20+
- if ( isNull( variables.mixerUtil ) ) {
21+
+ if ( !variables.keyExists( "mixerUtil" ) || isNull( variables.mixerUtil ) ) {
22+
diff --git a/tests/resources/app/coldbox/system/logging/Logger.cfc b/tests/resources/app/coldbox/system/logging/Logger.cfc
23+
--- a/tests/resources/app/coldbox/system/logging/Logger.cfc
24+
+++ b/tests/resources/app/coldbox/system/logging/Logger.cfc
25+
@@ -399 +399 @@
26+
- if ( isNull( local.logEvent ) ) {
27+
+ if ( !local.keyExists( "logEvent" ) || isNull( local.logEvent ) ) {
28+
diff --git a/tests/resources/app/coldbox/system/core/delegates/Env.cfc b/tests/resources/app/coldbox/system/core/delegates/Env.cfc
29+
--- a/tests/resources/app/coldbox/system/core/delegates/Env.cfc
30+
+++ b/tests/resources/app/coldbox/system/core/delegates/Env.cfc
31+
@@ -87 +87 @@
32+
- if ( isNull( variables.javaSystem ) ) {
33+
+ if ( !variables.keyExists( "javaSystem" ) || isNull( variables.javaSystem ) ) {
34+
diff --git a/tests/resources/app/coldbox/system/web/services/InterceptorService.cfc b/tests/resources/app/coldbox/system/web/services/InterceptorService.cfc
35+
--- a/tests/resources/app/coldbox/system/web/services/InterceptorService.cfc
36+
+++ b/tests/resources/app/coldbox/system/web/services/InterceptorService.cfc
37+
@@ -194 +194 @@
38+
- if ( !isNull( arguments.interceptData ) ) {
39+
+ if ( arguments.keyExists( "interceptData" ) && !isNull( arguments.interceptData ) ) {
40+
diff --git a/tests/resources/app/coldbox/system/testing/BaseTestCase.cfc b/tests/resources/app/coldbox/system/testing/BaseTestCase.cfc
41+
--- a/tests/resources/app/coldbox/system/testing/BaseTestCase.cfc
42+
+++ b/tests/resources/app/coldbox/system/testing/BaseTestCase.cfc
43+
@@ -162 +162 @@
44+
- if ( isNull( variables._ranBeforeAll ) ) {
45+
+ if ( !variables.keyExists( "_ranBeforeAll" ) || isNull( variables._ranBeforeAll ) ) {
46+
@@ -172 +172 @@
47+
- if ( isNull( variables._ranAfterAll ) ) {
48+
+ if ( !variables.keyExists( "_ranAfterAll" ) || isNull( variables._ranAfterAll ) ) {
49+
@@ -784 +784 @@
50+
- if ( !isNull( arguments.interceptData ) ) {
51+
+ if ( arguments.keyExists( "interceptData" ) && !isNull( arguments.interceptData ) ) {
52+
@@ -847 +847 @@
53+
- if ( isNull( variables.cbUtil ) ) {
54+
+ if ( !variables.keyExists( "cbUtil" ) || isNull( variables.cbUtil ) ) {
55+
@@ -859 +859 @@
56+
- if ( isNull( variables.env ) ) {
57+
+ if ( !variables.keyExists( "env" ) || isNull( variables.env ) ) {
58+
diff --git a/tests/resources/app/coldbox/system/ioc/Builder.cfc b/tests/resources/app/coldbox/system/ioc/Builder.cfc
59+
--- a/tests/resources/app/coldbox/system/ioc/Builder.cfc
60+
+++ b/tests/resources/app/coldbox/system/ioc/Builder.cfc
61+
@@ -82 +82 @@
62+
- if ( isNull( variables.coldboxDSL ) ) {
63+
+ if ( !variables.keyExists( "coldboxDSL" ) || isNull( variables.coldboxDSL ) ) {
64+
@@ -94 +94 @@
65+
- if ( isNull( variables.cacheBoxDSL ) ) {
66+
+ if ( !variables.keyExists( "cacheBoxDSL" ) || isNull( variables.cacheBoxDSL ) ) {
67+
@@ -106 +106 @@
68+
- if ( isNull( variables.logBoxDSL ) ) {
69+
+ if ( !variables.keyExists( "logBoxDSL" ) || isNull( variables.logBoxDSL ) ) {
70+
diff --git a/tests/resources/app/coldbox/system/cache/store/ConcurrentStore.cfc b/tests/resources/app/coldbox/system/cache/store/ConcurrentStore.cfc
71+
--- a/tests/resources/app/coldbox/system/cache/store/ConcurrentStore.cfc
72+
+++ b/tests/resources/app/coldbox/system/cache/store/ConcurrentStore.cfc
73+
@@ -261 +261 @@
74+
- if ( isNull( variables.collections ) ) {
75+
+ if ( !variables.keyExists( "collections" ) || isNull( variables.collections ) ) {
76+
diff --git a/tests/resources/app/coldbox/system/FrameworkSupertype.cfc b/tests/resources/app/coldbox/system/FrameworkSupertype.cfc
77+
--- a/tests/resources/app/coldbox/system/FrameworkSupertype.cfc
78+
+++ b/tests/resources/app/coldbox/system/FrameworkSupertype.cfc
79+
@@ -621 +621 @@
80+
- if ( isNull( variables.asyncManager ) ) {
81+
+ if ( !variables.keyExists( "asyncManager" ) || isNull( variables.asyncManager ) ) {
82+
@@ -755 +755 @@
83+
- if ( isNull( variables.cbDateTimeHelper ) ) {
84+
+ if ( !variables.keyExists( "cbDateTimeHelper" ) || isNull( variables.cbDateTimeHelper ) ) {
85+
diff --git a/tests/resources/app/coldbox/system/core/util/Util.cfc b/tests/resources/app/coldbox/system/core/util/Util.cfc
86+
--- a/tests/resources/app/coldbox/system/core/util/Util.cfc
87+
+++ b/tests/resources/app/coldbox/system/core/util/Util.cfc
88+
@@ -124 +124 @@
89+
- if ( isNull( variables.inetAddress ) ) {
90+
+ if ( !variables.keyExists( "inetAddress" ) || isNull( variables.inetAddress ) ) {
91+
diff --git a/tests/resources/app/coldbox/system/cache/config/CacheBoxConfig.cfc b/tests/resources/app/coldbox/system/cache/config/CacheBoxConfig.cfc
92+
--- a/tests/resources/app/coldbox/system/cache/config/CacheBoxConfig.cfc
93+
+++ b/tests/resources/app/coldbox/system/cache/config/CacheBoxConfig.cfc
94+
@@ -107 +107 @@
95+
- if ( !isNull( cacheBoxDSL.logBoxConfig ) ) {
96+
+ if ( structKeyExists( cacheBoxDSL, "logBoxConfig" ) && !isNull( cacheBoxDSL.logBoxConfig ) ) {
97+
@@ -112 +112 @@
98+
- if ( !isNull( cacheBoxDSL.scopeRegistration ) ) {
99+
+ if ( structKeyExists( cacheBoxDSL, "scopeRegistration" ) && !isNull( cacheBoxDSL.scopeRegistration ) ) {
100+
@@ -117 +117 @@
101+
- if ( !isNull( cacheBoxDSL.caches ) ) {
102+
+ if ( structKeyExists( cacheBoxDSL, "caches" ) && !isNull( cacheBoxDSL.caches ) ) {
103+
@@ -125 +125 @@
104+
- if ( !isNull( cacheBoxDSL.listeners ) ) {
105+
+ if ( structKeyExists( cacheBoxDSL, "listeners" ) && !isNull( cacheBoxDSL.listeners ) ) {
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
diff --git a/tests/resources/app/coldbox/system/core/util/Util.cfc b/tests/resources/app/coldbox/system/core/util/Util.cfc
2+
--- a/tests/resources/app/coldbox/system/core/util/Util.cfc
3+
+++ b/tests/resources/app/coldbox/system/core/util/Util.cfc
4+
@@ -12 +12 @@
5+
- if ( isNull( variables.engineMappingHelper ) ) {
6+
+ if ( !variables.keyExists( "engineMappingHelper" ) || isNull( variables.engineMappingHelper ) ) {
7+
diff --git a/tests/resources/app/coldbox/system/logging/LogEvent.cfc b/tests/resources/app/coldbox/system/logging/LogEvent.cfc
8+
--- a/tests/resources/app/coldbox/system/logging/LogEvent.cfc
9+
+++ b/tests/resources/app/coldbox/system/logging/LogEvent.cfc
10+
@@ -61 +61 @@
11+
- if ( isNull( variables.xmlConverter ) ) {
12+
+ if ( !variables.keyExists( "xmlConverter" ) || isNull( variables.xmlConverter ) ) {
13+
@@ -68 +68 @@
14+
- if ( isNull( variables.util ) ) {
15+
+ if ( !variables.keyExists( "util" ) || isNull( variables.util ) ) {
16+
diff --git a/tests/resources/app/coldbox/system/cache/AbstractCacheBoxProvider.cfc b/tests/resources/app/coldbox/system/cache/AbstractCacheBoxProvider.cfc
17+
--- a/tests/resources/app/coldbox/system/cache/AbstractCacheBoxProvider.cfc
18+
+++ b/tests/resources/app/coldbox/system/cache/AbstractCacheBoxProvider.cfc
19+
@@ -115 +115 @@
20+
- if ( isNull( variables.utility ) ) {
21+
+ if ( !variables.keyExists( "utility" ) || isNull( variables.utility ) ) {
22+
@@ -428 +428 @@
23+
- if ( isNull( variables.uuidHelper ) ) {
24+
+ if ( !variables.keyExists( "uuidHelper" ) || isNull( variables.uuidHelper ) ) {
25+
diff --git a/tests/resources/app/coldbox/system/cache/CacheFactory.cfc b/tests/resources/app/coldbox/system/cache/CacheFactory.cfc
26+
--- a/tests/resources/app/coldbox/system/cache/CacheFactory.cfc
27+
+++ b/tests/resources/app/coldbox/system/cache/CacheFactory.cfc
28+
@@ -484 +484 @@
29+
- if ( isNull( variables.config ) ) {
30+
+ if ( !variables.keyExists( "config" ) || isNull( variables.config ) ) {
31+
diff --git a/tests/resources/app/coldbox/system/remote/ColdboxProxy.cfc b/tests/resources/app/coldbox/system/remote/ColdboxProxy.cfc
32+
--- a/tests/resources/app/coldbox/system/remote/ColdboxProxy.cfc
33+
+++ b/tests/resources/app/coldbox/system/remote/ColdboxProxy.cfc
34+
@@ -342 +342 @@
35+
- if ( isNull( variables.util ) ) {
36+
+ if ( !variables.keyExists( "util" ) || isNull( variables.util ) ) {
37+
@@ -354 +354 @@
38+
- if ( isNull( variables.remotingUtil ) ) {
39+
+ if ( !variables.keyExists( "remotingUtil" ) || isNull( variables.remotingUtil ) ) {
40+
diff --git a/tests/resources/app/coldbox/system/web/context/RequestContext.cfc b/tests/resources/app/coldbox/system/web/context/RequestContext.cfc
41+
--- a/tests/resources/app/coldbox/system/web/context/RequestContext.cfc
42+
+++ b/tests/resources/app/coldbox/system/web/context/RequestContext.cfc
43+
@@ -1576 +1576 @@
44+
- if ( isNull( variables.privateContext.response ) ) {
45+
+ if ( !variables.privateContext.keyExists( "response" ) || isNull( variables.privateContext.response ) ) {
46+
diff --git a/modules/str/modules/cbjavaloader/models/javaloader/JavaLoader.cfc b/modules/str/modules/cbjavaloader/models/javaloader/JavaLoader.cfc
47+
--- a/modules/str/modules/cbjavaloader/models/javaloader/JavaLoader.cfc
48+
+++ b/modules/str/modules/cbjavaloader/models/javaloader/JavaLoader.cfc
49+
@@ -570 +570 @@
50+
- returntype="string"
51+
+ returntype="void"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
diff --git a/modules/mementifier/interceptors/Mementifier.cfc b/modules/mementifier/interceptors/Mementifier.cfc
2+
--- a/modules/mementifier/interceptors/Mementifier.cfc
3+
+++ b/modules/mementifier/interceptors/Mementifier.cfc
4+
@@ -89,2 +89,3 @@
5+
- var dateMask = isNull( this.memento.dateMask ) ? variables.settings.dateMask : this.memento.dateMask;
6+
- var timeMask = isNull( this.memento.timeMask ) ? variables.settings.timeMask : this.memento.timeMask;
7+
+ var entityMemento = structKeyExists( arguments.entity, "memento" ) ? arguments.entity.memento : {};
8+
+ var dateMask = !entityMemento.keyExists( "dateMask" ) || isNull( entityMemento.dateMask ) ? variables.settings.dateMask : entityMemento.dateMask;
9+
+ var timeMask = !entityMemento.keyExists( "timeMask" ) || isNull( entityMemento.timeMask ) ? variables.settings.timeMask : entityMemento.timeMask;
10+
@@ -150,12 +151,12 @@
11+
- "autoCastBooleans" : isNull( this.memento.autoCastBooleans ) ? variables.$mementifierSettings.autoCastBooleans : this.memento.autoCastBooleans,
12+
- "dateMask" : isNull( this.memento.dateMask ) ? variables.$mementifierSettings.dateMask : this.memento.dateMask,
13+
- "defaults" : isNull( this.memento.defaults ) ? {} : this.memento.defaults,
14+
- "defaultIncludes" : isNull( this.memento.defaultIncludes ) ? [] : this.memento.defaultIncludes,
15+
- "defaultExcludes" : isNull( this.memento.defaultExcludes ) ? [] : this.memento.defaultExcludes,
16+
- "iso8601Format" : isNull( this.memento.iso8601Format ) ? variables.$mementifierSettings.iso8601Format : this.memento.iso8601Format,
17+
- "mappers" : isNull( this.memento.mappers ) ? {} : this.memento.mappers,
18+
- "neverInclude" : isNull( this.memento.neverInclude ) ? [] : this.memento.neverInclude,
19+
- "ormAutoIncludes" : isNull( this.memento.ormAutoIncludes ) ? variables.$mementifierSettings.ormAutoIncludes : this.memento.ormAutoIncludes,
20+
- "profiles" : isNull( this.memento.profiles ) ? {} : this.memento.profiles,
21+
- "timeMask" : isNull( this.memento.timeMask ) ? variables.$mementifierSettings.timeMask : this.memento.timeMask,
22+
- "trustedGetters" : isNull( this.memento.trustedGetters ) ? variables.$mementifierSettings.trustedGetters : this.memento.trustedGetters
23+
+ "autoCastBooleans" : !this.memento.keyExists( "autoCastBooleans" ) || isNull( this.memento.autoCastBooleans ) ? variables.$mementifierSettings.autoCastBooleans : this.memento.autoCastBooleans,
24+
+ "dateMask" : !this.memento.keyExists( "dateMask" ) || isNull( this.memento.dateMask ) ? variables.$mementifierSettings.dateMask : this.memento.dateMask,
25+
+ "defaults" : !this.memento.keyExists( "defaults" ) || isNull( this.memento.defaults ) ? {} : this.memento.defaults,
26+
+ "defaultIncludes" : !this.memento.keyExists( "defaultIncludes" ) || isNull( this.memento.defaultIncludes ) ? [] : this.memento.defaultIncludes,
27+
+ "defaultExcludes" : !this.memento.keyExists( "defaultExcludes" ) || isNull( this.memento.defaultExcludes ) ? [] : this.memento.defaultExcludes,
28+
+ "iso8601Format" : !this.memento.keyExists( "iso8601Format" ) || isNull( this.memento.iso8601Format ) ? variables.$mementifierSettings.iso8601Format : this.memento.iso8601Format,
29+
+ "mappers" : !this.memento.keyExists( "mappers" ) || isNull( this.memento.mappers ) ? {} : this.memento.mappers,
30+
+ "neverInclude" : !this.memento.keyExists( "neverInclude" ) || isNull( this.memento.neverInclude ) ? [] : this.memento.neverInclude,
31+
+ "ormAutoIncludes" : !this.memento.keyExists( "ormAutoIncludes" ) || isNull( this.memento.ormAutoIncludes ) ? variables.$mementifierSettings.ormAutoIncludes : this.memento.ormAutoIncludes,
32+
+ "profiles" : !this.memento.keyExists( "profiles" ) || isNull( this.memento.profiles ) ? {} : this.memento.profiles,
33+
+ "timeMask" : !this.memento.keyExists( "timeMask" ) || isNull( this.memento.timeMask ) ? variables.$mementifierSettings.timeMask : this.memento.timeMask,
34+
+ "trustedGetters" : !this.memento.keyExists( "trustedGetters" ) || isNull( this.memento.trustedGetters ) ? variables.$mementifierSettings.trustedGetters : this.memento.trustedGetters
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
diff --git a/testbox/system/coverage/CoverageService.cfc b/testbox/system/coverage/CoverageService.cfc
2+
--- a/testbox/system/coverage/CoverageService.cfc
3+
+++ b/testbox/system/coverage/CoverageService.cfc
4+
@@ -175 +175 @@
5+
- if ( isNull( opts.coverageTresholds ) ) {
6+
+ if ( !structKeyExists( opts, "coverageTresholds" ) || isNull( opts.coverageTresholds ) ) {
7+
@@ -178 +178 @@
8+
- if ( isNull( opts.coverageTresholds.good ) ) {
9+
+ if ( !structKeyExists( opts.coverageTresholds, "good" ) || isNull( opts.coverageTresholds.good ) ) {
10+
@@ -181 +181 @@
11+
- if ( isNull( opts.coverageTresholds.bad ) ) {
12+
+ if ( !structKeyExists( opts.coverageTresholds, "bad" ) || isNull( opts.coverageTresholds.bad ) ) {
13+
diff --git a/testbox/system/TestBox.cfc b/testbox/system/TestBox.cfc
14+
--- a/testbox/system/TestBox.cfc
15+
+++ b/testbox/system/TestBox.cfc
16+
@@ -408 +408 @@
17+
- if ( !isNull( url.testBundles ) ) {
18+
+ if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) {
19+
@@ -411 +411 @@
20+
- if ( !isNull( url.testSuites ) ) {
21+
+ if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) {
22+
@@ -414 +414 @@
23+
- if ( !isNull( url.testSpecs ) ) {
24+
+ if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) {
25+
@@ -417 +417 @@
26+
- if ( !isNull( url.testMethod ) ) {
27+
+ if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) {
28+
@@ -259 +259 @@
29+
- if ( isNull( variables.env ) ) {
30+
+ if ( !structKeyExists( variables, "env" ) || isNull( variables.env ) ) {
31+
diff --git a/testbox/system/util/Util.cfc b/testbox/system/util/Util.cfc
32+
--- a/testbox/system/util/Util.cfc
33+
+++ b/testbox/system/util/Util.cfc
34+
@@ -203 +203 @@
35+
- if ( isNull( variables.engineMappingHelper ) ) {
36+
+ if ( !structKeyExists( variables, "engineMappingHelper" ) || isNull( variables.engineMappingHelper ) ) {
37+
diff --git a/testbox/system/util/Env.cfc b/testbox/system/util/Env.cfc
38+
--- a/testbox/system/util/Env.cfc
39+
+++ b/testbox/system/util/Env.cfc
40+
@@ -87 +87 @@
41+
- if ( isNull( variables.javaSystem ) ) {
42+
+ if ( !structKeyExists( variables, "javaSystem" ) || isNull( variables.javaSystem ) ) {
43+
diff --git a/testbox/system/BaseSpec.cfc b/testbox/system/BaseSpec.cfc
44+
--- a/testbox/system/BaseSpec.cfc
45+
+++ b/testbox/system/BaseSpec.cfc
46+
@@ -1627 +1627 @@
47+
- if ( isNull( variables.$cbMockData ) ) {
48+
+ if ( !structKeyExists( variables, "$cbMockData" ) || isNull( variables.$cbMockData ) ) {
49+
@@ -1640 +1640 @@
50+
- if ( isNull( variables.$utility ) ) {
51+
+ if ( !structKeyExists( variables, "$utility" ) || isNull( variables.$utility ) ) {
52+
@@ -1653 +1653 @@
53+
- if ( isNull( variables.$env ) ) {
54+
+ if ( !structKeyExists( variables, "$env" ) || isNull( variables.$env ) ) {
55+
@@ -1668 +1668 @@
56+
- if ( isNull( this.$mockbox ) ) {
57+
+ if ( !structKeyExists( this, "$mockbox" ) || isNull( this.$mockbox ) ) {
58+
diff --git a/testbox/system/runners/BDDRunner.cfc b/testbox/system/runners/BDDRunner.cfc
59+
--- a/testbox/system/runners/BDDRunner.cfc
60+
+++ b/testbox/system/runners/BDDRunner.cfc
61+
@@ -159 +159 @@
62+
- isNull( thisSuite ) ? {} : thisSuite
63+
+ !structKeyExists( local, "thisSuite" ) || isNull( local.thisSuite ) ? {} : local.thisSuite

0 commit comments

Comments
 (0)