Faculty of Information Technology
Software Engineering Group

Ticket #108: Tools__NewSystemBrowserTests.st

File Tools__NewSystemBrowserTests.st, 2.7 KB (added by Jan Vrany, 6 years ago)
Line 
1'From Smalltalk/X jv-branch, Version:8.0.0.0 on 09-08-2017 at 09:23:29 PM'      !
2
3"{ Package: 'stx:libtool' }"
4
5"{ NameSpace: Tools }"
6
7TestCase subclass:#NewSystemBrowserTests
8        instanceVariableNames:'browser browserInteractor'
9        classVariableNames:''
10        poolDictionaries:''
11        category:'Interface-Browsers-New-Tests'
12!
13
14!NewSystemBrowserTests methodsFor:'mocks'!
15
16foo
17    ^ 1
18
19    "Created: / 07-08-2017 / 16:07:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
20! !
21
22!NewSystemBrowserTests methodsFor:'running'!
23
24setUp
25    self skipIf:Screen current isNil description:'No display connection'.
26    Smalltalk loadPackage:'stx:goodies/sunit/ext/ui'.
27    super setUp.
28
29    browser := Tools::NewSystemBrowser open.
30    browserInteractor := browser interactor.
31
32    "Add your own code here..."
33
34    "Modified: / 07-08-2017 / 16:31:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
35!
36
37tearDown
38    browser closeDownViews.
39    browser := browserInteractor := nil.
40    MessageTracer untraceMethod: (self class >> #foo
41
42
43    "Add your own code here..."
44
45    "Created: / 07-08-2017 / 16:25:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
46! !
47
48!NewSystemBrowserTests methodsFor:'tests'!
49
50test_issue_108_a
51
52    self assert: (self class >> #foo) mclass == self class.
53    self assert: (self class >> #foo) isWrapped not.
54
55    browserInteractor do:[ browser switchToClass: self class selector: #foo ].
56    self assert: browser theSingleSelectedMethod == (self class >> #foo).
57    "
58    browser selectedMethods onChangeEvaluate: [ self halt ]
59    "   
60    browserInteractor do:[ browser  debugMenuTrace ].
61    browserInteractor do:[ browser switchToClass: self class selector: #foo ]. 
62    self assert: (self class >> #foo) == (browser theSingleSelectedMethod).
63    self assert: (self class >> #foo) mclass == self class.
64    self assert: (self class >> #foo) isWrapped. 
65    self assert: (self class >> #foo) originalMethod isWrapped not.
66
67    browserInteractor do:[ browser  debugMenuTraceSender ].
68    browserInteractor do:[ browser switchToClass: self class selector: #foo ]. 
69    self assert: (self class >> #foo) == (browser theSingleSelectedMethod).
70    self assert: (self class >> #foo) mclass == self class.
71    self assert: (self class >> #foo) isWrapped. 
72    self assert: (self class >> #foo) originalMethod isWrapped not.
73
74    browserInteractor do:[ browser  debugMenuRemoveBreakOrTrace ].
75    browserInteractor do:[ browser switchToClass: self class selector: #foo ]. 
76    self assert: (self class >> #foo) == (browser theSingleSelectedMethod).
77    self assert: (self class >> #foo) mclass == self class.
78    self assert: (self class >> #foo) isWrapped not.
79
80    "Created: / 07-08-2017 / 16:07:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
81    "Modified: / 09-08-2017 / 21:19:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
82! !
83