Skip to content

Commit c9bb9e5

Browse files
committed
Formatting
1 parent a2f09f3 commit c9bb9e5

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

src/MethodProxies-Tests/MpMethodProxyTest.class.st

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -142,39 +142,19 @@ MpMethodProxyTest >> testCanRunConcurrently [
142142
sharedObject := MpTestConcurrentSharedObject new.
143143
testSemaphore := Semaphore new.
144144

145-
mp1 := MpMethodProxy
146-
onMethod:
147-
(MpTestConcurrentSharedObject lookupSelector: #methodProcess1)
148-
handler: MpWaitBeforeHandler new.
149-
mp2 := MpMethodProxy
150-
onMethod:
151-
(MpTestConcurrentSharedObject lookupSelector: #methodProcess2)
152-
handler: MpWaitAndTriggerBeforeHandler new.
153-
mpTrigger1 := MpMethodProxy
154-
onMethod:
155-
(MpTestConcurrentSharedObject lookupSelector:
156-
#trigger1)
157-
handler:
158-
(handlerTrigger1 := MpAfterCounterHandler new).
159-
mpTrigger2 := MpMethodProxy
160-
onMethod:
161-
(MpTestConcurrentSharedObject lookupSelector:
162-
#trigger2)
163-
handler:
164-
(handlerTrigger2 := MpAfterCounterHandler new).
145+
mp1 := MpMethodProxy onMethod: (MpTestConcurrentSharedObject >> #methodProcess1) handler: MpWaitBeforeHandler new.
146+
mp2 := MpMethodProxy onMethod: (MpTestConcurrentSharedObject >> #methodProcess2) handler: MpWaitAndTriggerBeforeHandler new.
147+
mpTrigger1 := MpMethodProxy onMethod: (MpTestConcurrentSharedObject >> #trigger1) handler: (handlerTrigger1 := MpAfterCounterHandler new).
148+
mpTrigger2 := MpMethodProxy onMethod: (MpTestConcurrentSharedObject >> #trigger2) handler: (handlerTrigger2 := MpAfterCounterHandler new).
165149

166150
self installMethodProxy: mp1.
167151
self installMethodProxy: mp2.
168152
self installMethodProxy: mpTrigger1.
169153
self installMethodProxy: mpTrigger2.
170154

171155
"Here the first process will run an instrumented trigger (trigger1) while the second process is not instrumenting, then the second process will run a non-instrumented trigger while the first process is still instrumenting."
172-
p1 := [
173-
sharedObject methodProcess1.
174-
testSemaphore signal ] fork.
175-
p2 := [
176-
sharedObject methodProcess2.
177-
testSemaphore signal ] fork.
156+
p1 := [ sharedObject methodProcess1. testSemaphore signal ] fork.
157+
p2 := [ sharedObject methodProcess2. testSemaphore signal ] fork.
178158
testSemaphore wait.
179159

180160
"Here the first trigger should have been captured, but not the second. If not concurrency is not correctly managed."

0 commit comments

Comments
 (0)