Skip to content

Commit 49540d3

Browse files
committed
test
1 parent f4d806b commit 49540d3

17 files changed

Lines changed: 457 additions & 65 deletions

src/BaselineOfExecutableRequirements/BaselineOfExecutableRequirements.class.st

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ BaselineOfExecutableRequirements >> baselineForCommon: spec [
2929

3030
{ #category : 'baselines' }
3131
BaselineOfExecutableRequirements >> coreDependencies: spec [
32-
3332
"No dependencies"
33+
spec
34+
baseline: 'MethodProxies'
35+
with: [ spec repository: 'github://Nyan11/MethodProxies/src' ]
36+
3437
]
3538

3639
{ #category : 'baselines' }

src/ExecutableRequirements-Toplo-Example/ExReqToploLoginRequirements.class.st

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,9 +1006,14 @@ ExReqToploLoginRequirements >> capella_requirement_3 [
10061006
(ExReqToploLoginSimulation >> #authenticateUsername:password:)
10071007
ast
10081008
withPrecondition: [ :obj :args |
1009-
(obj
1010-
perform: #authenticateUsername:password:
1011-
withArguments: args) not ].
1009+
[
1010+
obj
1011+
perform: #authenticateUsername:password:
1012+
withArguments: args.
1013+
false ]
1014+
on: Exception
1015+
do: [ true ] ]
1016+
withPostcondition: [ true ].
10121017
verif
10131018
addStepOnAST: (ExReqToploLoginWidget >> #loginAction) ast
10141019
withPostcondition: [ :obj :args |

src/ExecutableRequirements-Toplo-Example/ExReqToploLoginSimulation.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ExReqToploLoginSimulation >> authenticateUsername: aUsernameString password: aPa
5757
self database
5858
at: aUsernameString
5959
ifPresent: [ :value | ^ aPasswordString = value ]
60-
ifAbsent: [ ^ false ]
60+
ifAbsent: [ Exception signal: 'Wrong credentials' ]
6161
]
6262

6363
{ #category : 'as yet unclassified' }

src/ExecutableRequirements-Toplo-Example/ExReqToploLoginWidget.class.st

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ ExReqToploLoginWidget >> initialize [
367367
{ #category : 'as yet unclassified' }
368368
ExReqToploLoginWidget >> loginAction [
369369

370-
(self authenticationBlock
371-
value: self usernameValue
372-
value: self passwordValue)
373-
ifTrue: [ self loginBlock value ]
374-
ifFalse: [
370+
[ self authenticationBlock
371+
value: self usernameValue
372+
value: self passwordValue.
373+
self loginBlock value ]
374+
on: Exception do: [ :error |
375375
self loginStatusContainer visibility: BlVisibility visible.
376376
self passwordInput text: '' ]
377377
]

src/ExecutableRequirements/ExReqRepositoryReport.class.st

Lines changed: 15 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Class {
44
#instVars : [
55
'requirementReports',
66
'repository',
7-
'tracingPoints',
8-
'announcer'
7+
'announcer',
8+
'builder'
99
],
1010
#category : 'ExecutableRequirements-Model-Report',
1111
#package : 'ExecutableRequirements',
@@ -73,6 +73,12 @@ ExReqRepositoryReport >> associatedPackages [
7373
^ self repository associatedPackages.
7474
]
7575

76+
{ #category : 'as yet unclassified' }
77+
ExReqRepositoryReport >> builder [
78+
79+
^ builder
80+
]
81+
7682
{ #category : 'as yet unclassified' }
7783
ExReqRepositoryReport >> closeReport [
7884

@@ -81,40 +87,6 @@ ExReqRepositoryReport >> closeReport [
8187
requirementReports := { }
8288
]
8389

84-
{ #category : 'as yet unclassified' }
85-
ExReqRepositoryReport >> createTracingPoints [
86-
87-
| stepReports preconditionNodeDictionary postconditionNodeDictionary|
88-
"
89-
- Step1: Get all step reports.
90-
- Step2: Create a dictionary with all ast -> step reports.
91-
- Step3: Create all PreconditionTracingPoint.
92-
- Step4: Create a dictionary with all ast & ast methodNode -> step reports.
93-
- Step5: Create all PostconditionTracingPoint.
94-
"
95-
stepReports := self requirementReports flatCollect: [ :req |
96-
req verificationReports flatCollect: #stepReports ].
97-
preconditionNodeDictionary := Dictionary new.
98-
postconditionNodeDictionary := Dictionary new.
99-
stepReports do: [ :stepReport |
100-
preconditionNodeDictionary
101-
at: stepReport step node
102-
ifPresent: [ :col | col add: stepReport ]
103-
ifAbsentPut: [ OrderedCollection with: stepReport ].
104-
postconditionNodeDictionary
105-
at: stepReport step node
106-
ifPresent: [ :col | col add: stepReport ]
107-
ifAbsentPut: [ Set with: stepReport ].
108-
postconditionNodeDictionary
109-
at: stepReport step node methodNode
110-
ifPresent: [ :col | col add: stepReport ]
111-
ifAbsentPut: [ Set with: stepReport ].
112-
].
113-
self tracingPoints: OrderedCollection new.
114-
self tracingPoints addAll: (preconditionNodeDictionary associations collect: [ :asso | ExReqTracingPoint installPreconditionOn: asso key withStepReports: asso value ]).
115-
self tracingPoints addAll: (postconditionNodeDictionary associations collect: [ :asso | ExReqTracingPoint installPostconditionOn: asso key withStepReports: asso value ]).
116-
]
117-
11890
{ #category : 'as yet unclassified' }
11991
ExReqRepositoryReport >> findRequirementReport: anExReqRequirement [
12092
| result |
@@ -128,15 +100,17 @@ ExReqRepositoryReport >> findRequirementReport: anExReqRequirement [
128100
ExReqRepositoryReport >> initialize [
129101

130102
super initialize.
131-
tracingPoints := OrderedCollection new.
132-
announcer := Announcer new
103+
announcer := Announcer new.
104+
builder := NeoExReqInstrumentationBuilder new.
133105
]
134106

135107
{ #category : 'as yet unclassified' }
136108
ExReqRepositoryReport >> installTracingPoints [
137109

138-
self createTracingPoints.
139-
self tracingPoints do: [ :each | each install ].
110+
| stepReports |
111+
stepReports := self requirementReports flatCollect: [ :req |
112+
req verificationReports flatCollect: #stepReports ].
113+
self builder installAllStepReports: stepReports.
140114
self isInstalled: true.
141115
self isRunning: true.
142116
self annouceTracingPointInstalled
@@ -157,8 +131,7 @@ ExReqRepositoryReport >> isValid [
157131
{ #category : 'as yet unclassified' }
158132
ExReqRepositoryReport >> removeTracingPoints [
159133

160-
self tracingPoints do: [ :each | each remove ].
161-
self tracingPoints: { }.
134+
self builder uninstallAllStepReports.
162135
self isRunning: false.
163136
self annouceTracingPointRemoved
164137
]
@@ -189,15 +162,3 @@ ExReqRepositoryReport >> subReports [
189162

190163
^ self requirementReports
191164
]
192-
193-
{ #category : 'accessing' }
194-
ExReqRepositoryReport >> tracingPoints [
195-
196-
^ tracingPoints
197-
]
198-
199-
{ #category : 'accessing' }
200-
ExReqRepositoryReport >> tracingPoints: aCollection [
201-
202-
tracingPoints := aCollection
203-
]

src/ExecutableRequirements/ExReqStepReport.class.st

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,47 @@ ExReqStepReport >> subReports [
177177
^ { }
178178
]
179179

180+
{ #category : 'as yet unclassified' }
181+
ExReqStepReport >> verifyPostconditionWithReceiver: anObject withArguments: aCollection [
182+
183+
self step ifNil: [ ^ self ].
184+
postconditionValidity ifTrue: [ ^ self ].
185+
self preconditionIsValid ifFalse: [ ^ self ].
186+
self step postcondition ifNil: [
187+
postconditionValidity := true.
188+
self announceValidity.
189+
^ self ].
190+
postconditionValidity := self hasPostcondition
191+
ifTrue: [
192+
self step postcondition
193+
valueWithEnoughArguments: {
194+
anObject.
195+
aCollection.
196+
self requirement } ]
197+
ifFalse: [ true ].
198+
199+
self isValid ifTrue: [ self announceValidity ]
200+
]
201+
202+
{ #category : 'as yet unclassified' }
203+
ExReqStepReport >> verifyPreconditionWithReceiver: anObject withArguments: aCollection [
204+
trigger := true.
205+
preconditionValidity ifTrue: [ ^ self ].
206+
self isPreviousStepValid ifFalse: [
207+
preconditionValidity := false.
208+
postconditionValidity := false.
209+
^ self ].
210+
preconditionValidity := self hasPrecondition
211+
ifTrue: [
212+
self step precondition
213+
valueWithEnoughArguments: {
214+
anObject.
215+
aCollection.
216+
self requirement } ]
217+
ifFalse: [ true ].
218+
self isValid ifTrue: [ self announceValidity ]
219+
]
220+
180221
{ #category : 'as yet unclassified' }
181222
ExReqStepReport >> verifyStepPostconditionWithContext: aContext [
182223
"

src/ExecutableRequirements/ExReqTracingPoint.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ ExReqTracingPoint >> metaLink [
127127
{ #category : 'accessing' }
128128
ExReqTracingPoint >> name [
129129

130-
^ name ifNil: [ #TracingPoint ]
130+
^ name ifNil: [ name := #TracingPoint ]
131131
]
132132

133133
{ #category : 'default values' }

0 commit comments

Comments
 (0)