Skip to content

Commit

Permalink
Merge pull request #69 from badetitou/development
Browse files Browse the repository at this point in the history
Last Update P6
  • Loading branch information
badetitou authored Apr 12, 2018
2 parents f5169ed + 3369470 commit 2951198
Show file tree
Hide file tree
Showing 77 changed files with 376 additions and 171 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*SmartTest
asTestCase
^ self methodClass selector: self selector
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*SmartTest
isInitializer
^ self selector = #initialize
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*SmartTest
senders
^ SystemNavigation default allSendersOf: self selector
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "RGMethodDefinition"
}
3 changes: 3 additions & 0 deletions SmartTest.package/SmTAnnouncer.class/class/shouldAnnounce.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
shouldAnnounce
^ SmTTestListener activated
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accessing
methodModified: anAnnouncement
| listOfTest |
listOfTest := (SmTRules finder new methodsFor: anAnnouncement newMethod).
listOfTest := (SmTRules testFinder findTestsForMethod: anAnnouncement newMethod) collect: #methodReference.
self collector
addAll: listOfTest.
self updateUIAfterAddingMethod: listOfTest.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ testRunningTestMethod1ToBuildCache
SmTClassTest run: #testMethod1.
"Running the test fill the cache that is then no more empty but contains only the association between SmTClass>>method1 and SmTClassTest>>testMethod1"
self assert: smartFinder cacheValues isNotEmpty.
self assert: smartFinder cacheValues size equals: 1.
self assert: smartFinder cacheValues size equals: 2.

"Not sure about the format of the dictionnary."
self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ testRunningTestMethod2ToBuildCache
self assert: smartFinder cacheValues isNotEmpty.
self
assert: smartFinder cacheValues size
equals: 4.
equals: 5.
self
assert:
(smartFinder cacheValues
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
tests
testRunningTestMethod5ToBuildCache
"This test if SmTTestCoverage find the initialize call"

<CORATestBlacklisted>
self assert: smartFinder cacheValues isEmpty.
SmTClassTest run: #testMethod5.
"Running the test fill the cache that is then no more empty but contains only the association between SmTClass>>method1 and SmTClassTest>>testMethod1"
self assert: smartFinder cacheValues isNotEmpty.
self assert: smartFinder cacheValues size equals: 2.

self
assert: (smartFinder cacheValues at: (RGMethodDefinition className: 'SmTClass2' selector: #initialize isMetaSide: false))
equals: {(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod5 isMetaSide: false)} asSet.
self
assert: (smartFinder cacheValues at: (RGMethodDefinition className: 'SmTClassTest' selector: #testMethod5 isMetaSide: false))
equals: {(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod5 isMetaSide: false)} asSet
Empty file.
3 changes: 3 additions & 0 deletions SmartTest.package/SmTClass2.class/instance/initialize.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
initialization
initialize
instVar1 := nil.
14 changes: 14 additions & 0 deletions SmartTest.package/SmTClass2.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"commentStamp" : "",
"super" : "Object",
"category" : "SmartTest-Tests-Data",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"instVar1",
"instVar2"
],
"name" : "SmTClass2",
"type" : "normal"
}
3 changes: 3 additions & 0 deletions SmartTest.package/SmTClassTest.class/instance/testMethod5.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test data
testMethod5
^ SmTClass2 new.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ setUp
testMethod1 := RGMethodDefinition className: 'SmTClassTest' selector: #testMethod1 isMetaSide: false.
testMethod2 := RGMethodDefinition className: 'SmTClassTest' selector: #testMethod2 isMetaSide: false.
testMethod3 := RGMethodDefinition className: 'SmTClassTest' selector: #testMethod3 isMetaSide: false.
testMethod4 := RGMethodDefinition className: 'SmTClassTest' selector: #testMethod4 isMetaSide: false.
testMethod4 := RGMethodDefinition className: 'SmTClassTest' selector: #testMethod4 isMetaSide: false.
testMethod5 := RGMethodDefinition className: 'SmTClassTest' selector: #testMethod5 isMetaSide: false.
testInheritedMethod1 := RGMethodDefinition className: 'SmTInheritClassTest' selector: #testMethod1 isMetaSide: false.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
helpers
running
tearDown
"rest the cache"
"reset the cache"
smartFinder resetCache.
super tearDown
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tests
testModificationOnInitialize
<CORATestBlacklisted>
| testsFound |
testsFound := self searchTestMethodsFor: SmTClass2 >> #initialize.

self deny: (testsFound includes: testMethod1).
self deny: (testsFound includes: testMethod2).
self deny: (testsFound includes: testMethod3).
self deny: (testsFound includes: testMethod4).
self assert: (testsFound includes: testMethod5).
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tests
testModificationOnTest
<CORATestBlacklisted>
| testsFound |
testsFound := self searchTestMethodsFor: SmTClassTest >> #testMethod4.

self deny: (testsFound includes: testMethod1).
self deny: (testsFound includes: testMethod2).
self deny: (testsFound includes: testMethod3).
self assert: (testsFound includes: testMethod4).
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ testStandardMethodSecondLevelSenders

self assert: (testsFound includes: testMethod1).
self assert: (testsFound includes: testMethod2).
self assert: (testsFound includes: testInheritedMethod1).
self deny: (testsFound includes: testMethod3).
self deny: (testsFound includes: testMethod4).
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"testMethod2",
"testMethod1",
"testMethod3",
"testMethod4"
"testMethod4",
"testMethod5",
"testInheritedMethod1"
],
"name" : "SmTFinderAbstractTest",
"type" : "normal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,23 @@
initialization
initCache
^ {((RGMethodDefinition
className: 'SmTClass'
selector: #method1
isMetaSide: false)
^ {((RGMethodDefinition className: 'SmTClass' selector: #method1 isMetaSide: false)
->
{(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod1
isMetaSide: false).
(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod2
isMetaSide: false)} asSet).
((RGMethodDefinition
className: 'SmTClass'
selector: #method2
isMetaSide: false)
{(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod1 isMetaSide: false).
(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod2 isMetaSide: false).
(RGMethodDefinition className: 'SmTInheritClassTest' selector: #testMethod1 isMetaSide: false)} asSet).
((RGMethodDefinition className: 'SmTClass' selector: #method2 isMetaSide: false)
-> {(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod2 isMetaSide: false)} asSet).
((RGMethodDefinition className: 'SmTClass' selector: #method3: isMetaSide: false)
->
{(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod2
isMetaSide: false)} asSet).
((RGMethodDefinition
className: 'SmTClass'
selector: #method3:
isMetaSide: false)
{(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod1 isMetaSide: false).
(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod2 isMetaSide: false).
(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod3 isMetaSide: false)} asSet).
((RGMethodDefinition className: 'SmTClass' selector: #method4 isMetaSide: false)
->
{(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod1
isMetaSide: false).
(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod2
isMetaSide: false).
(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod3
isMetaSide: false)} asSet).
((RGMethodDefinition
className: 'SmTClass'
selector: #method4
isMetaSide: false)
->
{(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod2
isMetaSide: false).
(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod3
isMetaSide: false).
(RGMethodDefinition
className: 'SmTClassTest'
selector: #testMethod4
isMetaSide: false)} asSet)} asDictionary
{(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod2 isMetaSide: false).
(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod3 isMetaSide: false).
(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod4 isMetaSide: false)} asSet).
((RGMethodDefinition className: 'SmTClass2' selector: #initialize isMetaSide: false)
-> {(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod5 isMetaSide: false)} asSet).
((RGMethodDefinition className: 'SmTClassTest' selector: #testMethod4 isMetaSide: false)
-> {(RGMethodDefinition className: 'SmTClassTest' selector: #testMethod4 isMetaSide: false)} asSet)} asDictionary
Empty file.
3 changes: 3 additions & 0 deletions SmartTest.package/SmTInheritClassTest.class/instance/setUp.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
initialization
setUp
smTtestClass := SmTClass new
11 changes: 11 additions & 0 deletions SmartTest.package/SmTInheritClassTest.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "SmTSuperClassTest",
"category" : "SmartTest-Tests-Data",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "SmTInheritClassTest",
"type" : "normal"
}
3 changes: 1 addition & 2 deletions SmartTest.package/SmTListener.class/class/initialize.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
initialization
initialize
self disable.
self enable
self disable
4 changes: 0 additions & 4 deletions SmartTest.package/SmTListener.class/instance/enable.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
protocol
enable
SystemAnnouncer uniqueInstance unsubscribe: self.
{(MethodModified -> #methodModified:).
(MethodAdded -> #methodAdded:)}
do: [ :pair | SystemAnnouncer uniqueInstance weak when: pair key send: pair value to: self ].
3 changes: 0 additions & 3 deletions SmartTest.package/SmTListener.class/instance/methodAdded..st

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
api
buildCacheFromTestSuite: aTestSuite
aTestSuite flatCollectTests do: [ :aTestCase | self installProxyFor: aTestCase. aTestCase run ].
MetaLink uninstallAll
5 changes: 5 additions & 0 deletions SmartTest.package/SmTRules.class/class/fillCache.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
fillCache
SmTSelectPackageBrowser openWithSmartFinder: self testFinder


13 changes: 12 additions & 1 deletion SmartTest.package/SmTRules.class/class/settingsOn..st
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,15 @@ settingsOn: aBuilder
label: 'Try to find for Dynamic ';
description:
'When you click in a method, and have selected a Dynamix finder, we''''are updating the cache for it execution
(BETA)' ]
(BETA)'.
(aBuilder group: #reset)
label: 'Fill cache';
target: self;
parent: #SmartTest;
dialog: [ SimpleButtonMorph new
target: self;
label: 'Fill cache';
actionSelector: #fillCache;
themeChanged;
yourself ];
description: 'Fill the cache with selected package' ]
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
as yet unclassified
openWithSmartFinder: aSmartFinder
self new
smartFinder: aSmartFinder;
items: RPackageOrganizer default packages;
openWithSpec
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
api
addAllItems
| tmp |
tmp := self sort: selectedModel listItems withAll: toSelectModel listItems.
selectedModel items: tmp.
toSelectModel items: #().
toSelectModel updateList.
selectedModel updateList
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
addItems
toSelectModel selectedItems
ifNotNil: [ :items |
selectedModel items: (self sort: selectedModel listItems withAll: items).
toSelectModel items: (self sort: toSelectModel listItems withoutAll: items) ].
toSelectModel updateList.
selectedModel updateList
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
api
createTestSuiteFrom: listItem
| testSuite |
testSuite := TestSuite new.
testSuite addTests: ((listItem flatCollect: #methods) select: #isTestMethod thenCollect: #asTestCase).
^ testSuite
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
initialization
initialize
| wrappingBlock testPackage |
super initialize.
toSelectModel := self instantiate: ListPresenter.
selectedModel := self instantiate: ListPresenter.
selectedModel beMultipleSelection.
toSelectModel beMultipleSelection.
wrappingBlock := [ :package | package packageName ].
toSelectModel displayBlock: wrappingBlock.
selectedModel displayBlock: wrappingBlock.
testPackage := MCWorkingCopy allManagers reject: [ :package | '*Test*' match: package packageName ].
toSelectModel items: (self sort: (toSelectModel listItems \ testPackage))
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
api
nextAction
| past testSuite |
testSuite := self createTestSuiteFrom: selectedModel listItems.
past := smartFinder smtFinder.
smartFinder smtFinder: SmTReflectivityTestFinderStrategy new.
smartFinder buildCacheFromTestSuite: testSuite.
smartFinder smtFinder: past.
self delete
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
removeAllItems
| tmp |
tmp := self sort: toSelectModel listItems withAll: selectedModel listItems.
toSelectModel items: tmp.
selectedModel items: #().
toSelectModel updateList.
selectedModel updateList
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
removeItems
selectedModel selectedItems
ifNotNil: [ :items |
toSelectModel items: (self sort: toSelectModel listItems withAll: items).
selectedModel items: (self sort: selectedModel listItems withoutAll: items) ].
toSelectModel updateList.
selectedModel updateList
Loading

0 comments on commit 2951198

Please sign in to comment.