Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jump to counterpart Integration test () support
- Loading branch information
h.noppe
committed
Mar 14, 2020
1 parent
7db5f4d
commit 3e3b6d7
Showing
14 changed files
with
182 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
startup/ | ||
startup/ | ||
.DS_Store |
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
src/omnistap/OmnisTAP/ogTAPMenuController/$_doesLibraryUseSeparateTestLibrary.omh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
src/omnistap/OmnisTAP/ogTAPMenuController/$_getTestMethodNameForMethod.omh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
Calculate lcTrimmedMethod as trim(pcMethodName,kTrue,kFalse,"$") | ||
Calculate lcTrimmedMethod as trim(lcTrimmedMethod,kTrue,kFalse,"_") | ||
|
||
Quit method con("$u_",lcTrimmedMethod) | ||
Calculate lcUnitTestMethod as con("$u_",lcTrimmedMethod) | ||
Do pirClass.$methods.$findname(lcUnitTestMethod) Returns lirFoundTestMethod | ||
If isclear(lirFoundTestMethod) | ||
Calculate lcIntegrationTestMethod as con("$i_",lcTrimmedMethod) | ||
Do pirClass.$methods.$findname(lcIntegrationTestMethod) Returns lirFoundTestMethod | ||
End If | ||
|
||
Quit method pick(isclear(lirFoundTestMethod),lirFoundTestMethod.$name(),lcUnitTestMethod) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Do inherited | ||
|
||
Do $cinst.$mock($objects.ogTAPMenuController) Returns iorMock |
24 changes: 24 additions & 0 deletions
24
src/omnistap/_ogTAPMenuController/$u_getTestMethodNameForMethod.omh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Calculate lcUnitTestMethodName as con("$u_",lcMethodToTestName) | ||
Calculate lcIntegrationTestMethodName as con("$i_",lcMethodToTestName) | ||
Do $objects.$add("TestClass") Returns lirTestClass | ||
|
||
Do lirTestClass.$methods.$add(lcUnitTestMethodName) Returns lirUnitTestMethod | ||
Do iorMock.$_getTestMethodNameForMethod(lcMethodToTestName,lirTestClass) Returns lcTestMethod | ||
Do ioTAP.$is_char(lcTestMethod,lcUnitTestMethodName,"Unit test method name is returned") | ||
|
||
Do lirTestClass.$methods.$remove(lirUnitTestMethod) | ||
Do lirTestClass.$methods.$add(lcIntegrationTestMethodName) Returns lirIntegrationTestMethod | ||
Do iorMock.$_getTestMethodNameForMethod(lcMethodToTestName,lirTestClass) Returns lcTestMethod | ||
Do ioTAP.$is_char(lcTestMethod,lcIntegrationTestMethodName,"Integration test method name is returned") | ||
|
||
Do $cinst.$when("unit test and integration methods do not exist in test class") | ||
Do lirTestClass.$methods.$remove(lirIntegrationTestMethod) | ||
Do iorMock.$_getTestMethodNameForMethod(lcMethodToTestName,lirTestClass) Returns lcTestMethod | ||
Do ioTAP.$is_char(lcTestMethod,lcUnitTestMethodName,"Both test methods do not exist in test class. Unit test is returned") | ||
|
||
Do $cinst.$when("unit test and integration methods both exist in test class") | ||
Do lirTestClass.$methods.$add(lcUnitTestMethodName) Returns lirUnitTestMethod | ||
Do lirTestClass.$methods.$add(lcIntegrationTestMethodName) Returns lirIntegrationTestMethod | ||
Do ioTAP.$is_char(lcTestMethod,lcUnitTestMethodName,"Unit test method name is returned if both test methods exist") | ||
|
||
Do $objects.$remove(lirTestClass) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"classtype": "kObjectclass", | ||
"omnisversion": "10.1", | ||
"internalversion": 12, | ||
"superclass": "omnistap.ogTAPSuper", | ||
"designtaskname": "Startup_Task", | ||
"cvardefs": [ | ||
|
||
], | ||
"ivardefs": [ | ||
{ | ||
"name": "iorMock", | ||
"order": 1, | ||
"type": "kObjectref", | ||
"subtype": "ogTAPMenuController", | ||
"sublen": 0 | ||
} | ||
], | ||
"properties": { | ||
"canremotedebugwhenlocked": false, | ||
"collectperformancedata": false, | ||
"componenticon": 0, | ||
"componenttype": "kCompStoreHidden", | ||
"createdate": "2020-03-14 23:19:43", | ||
"desc": "", | ||
"editor": "", | ||
"editordata": "", | ||
"external": true, | ||
"issupercomponent": false, | ||
"moddate": "2020-03-14 23:43:34", | ||
"selfcontained": false, | ||
"showascheckedout": true, | ||
"userinfo": "", | ||
"version": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
[ | ||
{ | ||
"name": "$setup", | ||
"order": 1, | ||
"pvardefs": [ | ||
|
||
], | ||
"lvardefs": [ | ||
|
||
] | ||
}, | ||
{ | ||
"name": "$u_getTestMethodNameForMethod", | ||
"order": 3, | ||
"pvardefs": [ | ||
|
||
], | ||
"lvardefs": [ | ||
{ | ||
"name": "lcIntegrationTestMethodName", | ||
"order": 3, | ||
"type": "kCharacter", | ||
"subtype": "kSimplechar", | ||
"sublen": 100000000 | ||
}, | ||
{ | ||
"name": "lcMethodToTestName", | ||
"order": 2, | ||
"type": "kCharacter", | ||
"subtype": "kSimplechar", | ||
"sublen": 100000000, | ||
"initval": "'someMethodToTest'" | ||
}, | ||
{ | ||
"name": "lcTestMethod", | ||
"order": 6, | ||
"type": "kCharacter", | ||
"subtype": "kSimplechar", | ||
"sublen": 100000000 | ||
}, | ||
{ | ||
"name": "lcUnitTestMethodName", | ||
"order": 1, | ||
"type": "kCharacter", | ||
"subtype": "kSimplechar", | ||
"sublen": 100000000 | ||
}, | ||
{ | ||
"name": "lirIntegrationTestMethod", | ||
"order": 7, | ||
"type": "kItemref", | ||
"subtype": "", | ||
"sublen": 0 | ||
}, | ||
{ | ||
"name": "lirTestClass", | ||
"order": 4, | ||
"type": "kItemref", | ||
"subtype": "", | ||
"sublen": 0 | ||
}, | ||
{ | ||
"name": "lirUnitTestMethod", | ||
"order": 5, | ||
"type": "kItemref", | ||
"subtype": "", | ||
"sublen": 0 | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters