Skip to content

Commit b32e8ba

Browse files
committed
WIP: make private classes private
1 parent caa7b15 commit b32e8ba

22 files changed

+167
-167
lines changed

testing/Project/Sources/Classes/TestRunner.4dm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
property classStore : 4D:C1709.Object // Class store from the calling project
2-
property testSuites : Collection // Collection of cs.TestSuite
2+
property testSuites : Collection // Collection of cs._TestSuite
33
property results : Object // Test results summary
44
property outputFormat : Text // "human" or "json"
55
property verboseOutput : Boolean // Whether to include detailed information
@@ -32,7 +32,7 @@ Function run()
3232
This:C1470._logHeader()
3333
End if
3434

35-
var $testSuite : cs:C1710.TestSuite
35+
var $testSuite : cs:C1710._TestSuite
3636
For each ($testSuite; This:C1470.testSuites)
3737
$testSuite.run()
3838
This:C1470._collectSuiteResults($testSuite)
@@ -52,8 +52,8 @@ Function run()
5252
Function discoverTests()
5353
var $class : 4D:C1709.Class
5454
For each ($class; This:C1470._getTestClasses())
55-
var $testSuite : cs:C1710.TestSuite
56-
$testSuite:=cs:C1710.TestSuite.new($class; This:C1470.outputFormat; This:C1470.testPatterns; This:C1470)
55+
var $testSuite : cs:C1710._TestSuite
56+
$testSuite:=cs:C1710._TestSuite.new($class; This:C1470.outputFormat; This:C1470.testPatterns; This:C1470)
5757

5858
// Filter test suite based on patterns
5959
If (This:C1470._shouldIncludeTestSuite($testSuite))
@@ -114,7 +114,7 @@ Function _logHeader()
114114
LOG EVENT:C667(Into system standard outputs:K38:9; "Running tests...\r\n"; Information message:K38:1)
115115
LOG EVENT:C667(Into system standard outputs:K38:9; "\r\n"; Information message:K38:1)
116116

117-
Function _collectSuiteResults($testSuite : cs:C1710.TestSuite)
117+
Function _collectSuiteResults($testSuite : cs:C1710._TestSuite)
118118
var $suiteResult : Object
119119
$suiteResult:=New object:C1471(\
120120
"name"; $testSuite.class.name; \
@@ -123,7 +123,7 @@ Function _collectSuiteResults($testSuite : cs:C1710.TestSuite)
123123
"failed"; 0\
124124
)
125125

126-
var $testFunction : cs:C1710.TestFunction
126+
var $testFunction : cs:C1710._TestFunction
127127
For each ($testFunction; $testSuite.testFunctions)
128128
var $testResult : Object
129129
$testResult:=$testFunction.getResult()
@@ -319,7 +319,7 @@ Function _parseTestPatterns()
319319
End for each
320320
End if
321321

322-
Function _shouldIncludeTestSuite($testSuite : cs:C1710.TestSuite) : Boolean
322+
Function _shouldIncludeTestSuite($testSuite : cs:C1710._TestSuite) : Boolean
323323
// If no patterns specified, include all tests
324324
If (This:C1470.testPatterns.length=0)
325325
return True:C214
@@ -344,8 +344,8 @@ Function _shouldIncludeTestSuite($testSuite : cs:C1710.TestSuite) : Boolean
344344

345345
return False:C215
346346

347-
Function _patternMatchesAnyTestInSuite($testSuite : cs:C1710.TestSuite; $pattern : Text) : Boolean
348-
var $testFunction : cs:C1710.TestFunction
347+
Function _patternMatchesAnyTestInSuite($testSuite : cs:C1710._TestSuite; $pattern : Text) : Boolean
348+
var $testFunction : cs:C1710._TestFunction
349349
For each ($testFunction; $testSuite.testFunctions)
350350
var $fullTestName : Text
351351
$fullTestName:=$testSuite.class.name+"."+$testFunction.functionName
@@ -455,7 +455,7 @@ Function _parseTagList($tagString : Text) : Collection
455455

456456
return $tags
457457

458-
Function _shouldIncludeTestByTags($testFunction : cs:C1710.TestFunction) : Boolean
458+
Function _shouldIncludeTestByTags($testFunction : cs:C1710._TestFunction) : Boolean
459459
// Apply tag filtering logic to determine if test should be included
460460

461461
// If no tag filters specified, include all tests

testing/Project/Sources/Classes/UnitStatsTracker.4dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Function resetStatistics()
1414
If (This:C1470._statsMap=Null:C1517)
1515
return
1616
End if
17-
var $statistic : cs:C1710.UnitStatsDetail
17+
var $statistic : cs:C1710._UnitStatsDetail
1818
For each ($statistic; OB Values:C1718(This:C1470._statsMap))
1919
If (OB Instance of:C1731($statistic.reset; 4D:C1709.Function))
2020
$statistic.reset()
@@ -26,14 +26,14 @@ Function createStatistic($name : Text) : cs:C1710.UnitStatsTracker
2626
$name - text - the name of the statistic to create
2727
returns - cs.UnitStatsTracker - This object to chain call
2828
*/
29-
This:C1470._statsMap[$name]:=cs:C1710.UnitStatsDetail.new()
29+
This:C1470._statsMap[$name]:=cs:C1710._UnitStatsDetail.new()
3030
return This:C1470
3131

32-
Function getStat($name : Text) : cs:C1710.UnitStatsDetail
32+
Function getStat($name : Text) : cs:C1710._UnitStatsDetail
3333
/* Gets a statistic. If one does not exist, a new statistic will
3434
be created an returned.
3535
$name - text - the name of the statistic to return
36-
returns - cs.UnitStatsDetail - a statistic
36+
returns - cs._UnitStatsDetail - a statistic
3737
*/
3838
If (Not:C34(This:C1470._doesStatisticExist($name)))
3939
This:C1470.createStatistic($name)
@@ -47,7 +47,7 @@ $functionName - text - the name of the statistic to update
4747
$parameters - collection - the collection of parameters to push onto the related statistic
4848
$returnValue - variant - value this method will return
4949
*/
50-
var $statistic : cs:C1710.UnitStatsDetail
50+
var $statistic : cs:C1710._UnitStatsDetail
5151
$statistic:=This:C1470.getStat($functionName)
5252
If ($statistic#Null:C1517)
5353
$statistic.appendCalledParameters((($parameters#Null:C1517) ? $parameters : []))
File renamed without changes.

testing/Project/Sources/Classes/ComprehensiveErrorTest.4dm renamed to testing/Project/Sources/Classes/_ComprehensiveErrorTest.4dm

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Function test_null_class_handling($t : cs:C1710.Testing)
99
// We can't easily test with actual null class without causing errors,
1010
// but we can test with valid classes to ensure the structure works
1111
var $validClass : 4D:C1709.Class
12-
$validClass:=cs:C1710.ExampleTest
12+
$validClass:=cs:C1710._ExampleTest
1313

1414
$t.assert.isNotNull($t; $validClass; "Valid class should not be null")
1515

16-
var $suite : cs:C1710.TestSuite
17-
$suite:=cs:C1710.TestSuite.new($validClass; "human"; []; Null:C1517)
16+
var $suite : cs:C1710._TestSuite
17+
$suite:=cs:C1710._TestSuite.new($validClass; "human"; []; Null:C1517)
1818

1919
$t.assert.isNotNull($t; $suite; "TestSuite should handle valid class")
20-
$t.assert.areEqual($t; "ExampleTest"; $suite.class.name; "Should store class correctly")
20+
$t.assert.areEqual($t; "_ExampleTest"; $suite.class.name; "Should store class correctly")
2121

2222
Function test_empty_test_class($t : cs:C1710.Testing)
2323

@@ -29,19 +29,19 @@ Function test_empty_test_class($t : cs:C1710.Testing)
2929
$runner:=cs:C1710.TestRunner.new()
3030
$runner.testPatterns:=["nonexistent_pattern"]
3131

32-
var $suite : cs:C1710.TestSuite
33-
$suite:=cs:C1710.TestSuite.new(cs:C1710.ExampleTest; "human"; ["nonexistent_pattern"]; Null:C1517)
32+
var $suite : cs:C1710._TestSuite
33+
$suite:=cs:C1710._TestSuite.new(cs:C1710._ExampleTest; "human"; ["nonexistent_pattern"]; Null:C1517)
3434

3535
$t.assert.areEqual($t; 0; $suite.testFunctions.length; "Should have no test functions when pattern doesn't match")
3636

3737
Function test_malformed_test_methods($t : cs:C1710.Testing)
3838

3939
// Test that test discovery handles methods that don't follow the pattern
40-
var $suite : cs:C1710.TestSuite
41-
$suite:=cs:C1710.TestSuite.new(cs:C1710.ExampleTest; "human"; []; Null:C1517)
40+
var $suite : cs:C1710._TestSuite
41+
$suite:=cs:C1710._TestSuite.new(cs:C1710._ExampleTest; "human"; []; Null:C1517)
4242

4343
// All discovered methods should start with "test_"
44-
var $testFunction : cs:C1710.TestFunction
44+
var $testFunction : cs:C1710._TestFunction
4545
For each ($testFunction; $suite.testFunctions)
4646
$t.assert.isTrue($t; $testFunction.functionName="test_@"; "All discovered methods should start with test_, found: "+$testFunction.functionName)
4747
End for each
@@ -152,14 +152,14 @@ Function test_timing_precision($t : cs:C1710.Testing)
152152

153153
// Test that timing works correctly even for very fast tests
154154
var $exampleClass : 4D:C1709.Class
155-
$exampleClass:=cs:C1710.ExampleTest
156-
var $classInstance : cs:C1710.ExampleTest
157-
$classInstance:=cs:C1710.ExampleTest.new()
155+
$exampleClass:=cs:C1710._ExampleTest
156+
var $classInstance : cs:C1710._ExampleTest
157+
$classInstance:=cs:C1710._ExampleTest.new()
158158
var $testMethod : 4D:C1709.Function
159159
$testMethod:=$classInstance.test_areEqual_pass
160160

161-
var $testFunction : cs:C1710.TestFunction
162-
$testFunction:=cs:C1710.TestFunction.new($exampleClass; $classInstance; $testMethod; "test_areEqual_pass"; "")
161+
var $testFunction : cs:C1710._TestFunction
162+
$testFunction:=cs:C1710._TestFunction.new($exampleClass; $classInstance; $testMethod; "test_areEqual_pass"; "")
163163
$testFunction.run()
164164

165165
var $result : Object
@@ -202,7 +202,7 @@ Function test_memory_and_cleanup($t : cs:C1710.Testing)
202202
$t.assert.isTrue($t; $runner.testSuites.length>$initialSuites; "Should discover test suites")
203203

204204
// Verify each suite has proper structure
205-
var $suite : cs:C1710.TestSuite
205+
var $suite : cs:C1710._TestSuite
206206
For each ($suite; $runner.testSuites)
207207
$t.assert.isNotNull($t; $suite.class; "Suite should have class reference")
208208
$t.assert.isNotNull($t; $suite.classInstance; "Suite should have class instance")

testing/Project/Sources/Classes/ErrorHandlingTest.4dm renamed to testing/Project/Sources/Classes/_ErrorHandlingTest.4dm

File renamed without changes.
File renamed without changes.

testing/Project/Sources/Classes/JSONOutputTest.4dm renamed to testing/Project/Sources/Classes/_JSONOutputTest.4dm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ Function test_test_result_object_structure($t : cs:C1710.Testing)
6262

6363
// Create a test function result to examine its structure
6464
var $exampleClass : 4D:C1709.Class
65-
$exampleClass:=cs:C1710.ExampleTest
66-
var $classInstance : cs:C1710.ExampleTest
67-
$classInstance:=cs:C1710.ExampleTest.new()
65+
$exampleClass:=cs:C1710._ExampleTest
66+
var $classInstance : cs:C1710._ExampleTest
67+
$classInstance:=cs:C1710._ExampleTest.new()
6868
var $testMethod : 4D:C1709.Function
6969
$testMethod:=$classInstance.test_areEqual_pass
7070

71-
var $testFunction : cs:C1710.TestFunction
72-
$testFunction:=cs:C1710.TestFunction.new($exampleClass; $classInstance; $testMethod; "test_areEqual_pass")
71+
var $testFunction : cs:C1710._TestFunction
72+
$testFunction:=cs:C1710._TestFunction.new($exampleClass; $classInstance; $testMethod; "test_areEqual_pass")
7373
$testFunction.run()
7474

7575
var $result : Object
@@ -181,14 +181,14 @@ Function test_timing_data_integrity($t : cs:C1710.Testing)
181181

182182
// Test that timing data makes sense
183183
var $exampleClass : 4D:C1709.Class
184-
$exampleClass:=cs:C1710.ExampleTest
185-
var $classInstance : cs:C1710.ExampleTest
186-
$classInstance:=cs:C1710.ExampleTest.new()
184+
$exampleClass:=cs:C1710._ExampleTest
185+
var $classInstance : cs:C1710._ExampleTest
186+
$classInstance:=cs:C1710._ExampleTest.new()
187187
var $testMethod : 4D:C1709.Function
188188
$testMethod:=$classInstance.test_areEqual_pass
189189

190-
var $testFunction : cs:C1710.TestFunction
191-
$testFunction:=cs:C1710.TestFunction.new($exampleClass; $classInstance; $testMethod; "test_areEqual_pass")
190+
var $testFunction : cs:C1710._TestFunction
191+
$testFunction:=cs:C1710._TestFunction.new($exampleClass; $classInstance; $testMethod; "test_areEqual_pass")
192192

193193
var $beforeRun : Integer
194194
$beforeRun:=Milliseconds:C459

testing/Project/Sources/Classes/MockingExampleTest.4dm renamed to testing/Project/Sources/Classes/_MockingExampleTest.4dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Function test_mock_basic_functionality($t : cs:C1710.Testing)
99
$result:=$t.stats.mock("testFunction"; ["param1"; "param2"]; "mock_result")
1010

1111
// Verify the mock was called correctly
12-
var $stat : cs:C1710.UnitStatsDetail
12+
var $stat : cs:C1710._UnitStatsDetail
1313
$stat:=$t.stats.getStat("testFunction")
1414

1515
$t.assert.areEqual($t; 1; $stat.getNumberOfCalls(); "Mock should be called once")
@@ -23,7 +23,7 @@ Function test_mock_multiple_calls($t : cs:C1710.Testing)
2323
$t.stats.mock("validateUser"; ["guest"]; False:C215)
2424

2525
// Verify both calls were tracked
26-
var $stat : cs:C1710.UnitStatsDetail
26+
var $stat : cs:C1710._UnitStatsDetail
2727
$stat:=$t.stats.getStat("validateUser")
2828

2929
$t.assert.areEqual($t; 2; $stat.getNumberOfCalls(); "Should be called twice")
@@ -38,7 +38,7 @@ Function test_mock_with_collections($t : cs:C1710.Testing)
3838
$t.stats.mock("processCollection"; [$testCollection]; "processed")
3939

4040
// Verify collection parameter was captured
41-
var $stat : cs:C1710.UnitStatsDetail
41+
var $stat : cs:C1710._UnitStatsDetail
4242
$stat:=$t.stats.getStat("processCollection")
4343

4444
$t.assert.areEqual($t; 1; $stat.getNumberOfCalls(); "Should be called once")
@@ -53,7 +53,7 @@ Function test_mock_statistics_reset($t : cs:C1710.Testing)
5353
$t.stats.mock("testMethod"; ["param"]; "result")
5454
$t.stats.mock("testMethod"; ["param2"]; "result2")
5555

56-
var $stat : cs:C1710.UnitStatsDetail
56+
var $stat : cs:C1710._UnitStatsDetail
5757
$stat:=$t.stats.getStat("testMethod")
5858
$t.assert.areEqual($t; 2; $stat.getNumberOfCalls(); "Should have 2 calls before reset")
5959

@@ -72,7 +72,7 @@ Function test_mock_parameter_details($t : cs:C1710.Testing)
7272
$t.stats.mock("apiCall"; $params; New object:C1471("status"; 200; "data"; "success"))
7373

7474
// Verify parameter details
75-
var $stat : cs:C1710.UnitStatsDetail
75+
var $stat : cs:C1710._UnitStatsDetail
7676
$stat:=$t.stats.getStat("apiCall")
7777

7878
$t.assert.areEqual($t; 1; $stat.getNumberOfCalls(); "Should be called once")

testing/Project/Sources/Classes/ParameterParsingTest.4dm renamed to testing/Project/Sources/Classes/_ParameterParsingTest.4dm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Function test_parameter_validation($t : cs:C1710.Testing)
8787
$t.assert.isNotNull($t; $runner.testPatterns; "Test patterns should be initialized")
8888

8989
// Should handle empty test patterns gracefully
90-
var $exampleSuite : cs:C1710.TestSuite
91-
$exampleSuite:=cs:C1710.TestSuite.new(cs:C1710.ExampleTest; "human"; []; Null:C1517)
90+
var $exampleSuite : cs:C1710._TestSuite
91+
$exampleSuite:=cs:C1710._TestSuite.new(cs:C1710._ExampleTest; "human"; []; Null:C1517)
9292

9393
$t.assert.isTrue($t; $runner._shouldIncludeTestSuite($exampleSuite); "Should include suite when no patterns specified")
9494

@@ -98,13 +98,13 @@ Function test_suite_filtering_logic($t : cs:C1710.Testing)
9898
$runner:=cs:C1710.TestRunner.new()
9999

100100
// Manually set test patterns to test filtering logic
101-
$runner.testPatterns:=["ExampleTest"]
101+
$runner.testPatterns:=["_ExampleTest"]
102102

103-
var $exampleSuite : cs:C1710.TestSuite
104-
$exampleSuite:=cs:C1710.TestSuite.new(cs:C1710.ExampleTest; "human"; ["ExampleTest"]; Null:C1517)
103+
var $exampleSuite : cs:C1710._TestSuite
104+
$exampleSuite:=cs:C1710._TestSuite.new(cs:C1710._ExampleTest; "human"; ["_ExampleTest"]; Null:C1517)
105105

106-
var $errorSuite : cs:C1710.TestSuite
107-
$errorSuite:=cs:C1710.TestSuite.new(cs:C1710.ErrorHandlingTest; "human"; ["ExampleTest"]; Null:C1517)
106+
var $errorSuite : cs:C1710._TestSuite
107+
$errorSuite:=cs:C1710._TestSuite.new(cs:C1710._ErrorHandlingTest; "human"; ["_ExampleTest"]; Null:C1517)
108108

109109
$t.assert.isTrue($t; $runner._shouldIncludeTestSuite($exampleSuite); "Should include matching suite")
110110
$t.assert.isFalse($t; $runner._shouldIncludeTestSuite($errorSuite); "Should exclude non-matching suite")
@@ -117,11 +117,11 @@ Function test_wildcard_suite_filtering($t : cs:C1710.Testing)
117117
// Test wildcard filtering
118118
$runner.testPatterns:=["*Error*"]
119119

120-
var $errorSuite : cs:C1710.TestSuite
121-
$errorSuite:=cs:C1710.TestSuite.new(cs:C1710.ErrorHandlingTest; "human"; ["*Error*"]; Null:C1517)
120+
var $errorSuite : cs:C1710._TestSuite
121+
$errorSuite:=cs:C1710._TestSuite.new(cs:C1710._ErrorHandlingTest; "human"; ["*Error*"]; Null:C1517)
122122

123-
var $exampleSuite : cs:C1710.TestSuite
124-
$exampleSuite:=cs:C1710.TestSuite.new(cs:C1710.ExampleTest; "human"; ["*Error*"]; Null:C1517)
123+
var $exampleSuite : cs:C1710._TestSuite
124+
$exampleSuite:=cs:C1710._TestSuite.new(cs:C1710._ExampleTest; "human"; ["*Error*"]; Null:C1517)
125125

126126
$t.assert.isTrue($t; $runner._shouldIncludeTestSuite($errorSuite); "Should include suite matching wildcard")
127127
$t.assert.isFalse($t; $runner._shouldIncludeTestSuite($exampleSuite); "Should exclude suite not matching wildcard")

testing/Project/Sources/Classes/SetupTeardownTest.4dm renamed to testing/Project/Sources/Classes/_SetupTeardownTest.4dm

File renamed without changes.

0 commit comments

Comments
 (0)