Skip to content

Commit 3f373f6

Browse files
committed
Add the start of the UI
1 parent 80a558b commit 3f373f6

10 files changed

Lines changed: 288 additions & 52 deletions

src/ExecutableRequirements-Examples/ExReqExampleTODOApplication.class.st

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,8 @@ ExReqExampleTODOApplication >> selectedTask [
9090

9191
^ listPresenter selectedItem
9292
]
93+
94+
{ #category : 'as yet unclassified' }
95+
ExReqExampleTODOApplication >> tasks [
96+
^ tasks
97+
]

src/ExecutableRequirements-Examples/ExReqExampleTODORequirements.class.st

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ Class {
66
#tag : 'Example-TODO'
77
}
88

9+
{ #category : 'as yet unclassified' }
10+
ExReqExampleTODORequirements >> inspectRepositoryReport [
11+
12+
<script: 'ExReqExampleTODORequirements new inspectRepositoryReport'>
13+
| repository |
14+
repository := ExReqRepository new
15+
pragmaSelector: #ExReqTODO;
16+
yourself.
17+
repository asReport inspect
18+
]
19+
920
{ #category : 'tests' }
1021
ExReqExampleTODORequirements >> todoReq1 [
1122

@@ -15,20 +26,17 @@ ExReqExampleTODORequirements >> todoReq1 [
1526
description: 'A task is composed of:
1627
- a text (String)
1728
- a state (Enum: TODO, DONE)';
18-
addVerification: [ :verify |
29+
addVerification: [ :verify |
1930
verify
20-
addStepOnAST:
21-
(ExReqExampleTODOTask >> #title:) ast
31+
addStepOnAST: (ExReqExampleTODOTask >> #text:) ast
2232
withPrecondition: [ :obj :arguments | arguments first isString ] ];
23-
addVerification: [ :verify |
33+
addVerification: [ :verify |
2434
verify
25-
addStepOnAST:
26-
(ExReqExampleTODOTask >> #state) ast
35+
addStepOnAST: (ExReqExampleTODOTask >> #state) ast
2736
withPrecondition: [ :obj | obj state = #DONE ] ];
28-
addVerification: [ :verify |
37+
addVerification: [ :verify |
2938
verify
30-
addStepOnAST:
31-
(ExReqExampleTODOTask >> #state) ast
39+
addStepOnAST: (ExReqExampleTODOTask >> #state) ast
3240
withPrecondition: [ :obj | obj state = #TODO ] ];
3341
yourself
3442
]
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,94 @@
11
Class {
22
#name : 'ExReqAbstractReport',
33
#superclass : 'Object',
4+
#instVars : [
5+
'isInstalled',
6+
'isRunning',
7+
'repositoryReport'
8+
],
49
#category : 'ExecutableRequirements-Model-Report',
510
#package : 'ExecutableRequirements',
611
#tag : 'Model-Report'
712
}
813

14+
{ #category : 'initialization' }
15+
ExReqAbstractReport >> initialize [
16+
17+
isInstalled := false.
18+
isRunning := false.
19+
]
20+
21+
{ #category : 'testing' }
22+
ExReqAbstractReport >> isInstalled [
23+
24+
^ isInstalled
25+
]
26+
27+
{ #category : 'testing' }
28+
ExReqAbstractReport >> isInstalled: aBoolean [
29+
30+
isInstalled := aBoolean.
31+
self subReports do: [ :each | each isInstalled: aBoolean ].
32+
]
33+
34+
{ #category : 'testing' }
35+
ExReqAbstractReport >> isRepositoryReport [
36+
37+
^ false
38+
]
39+
40+
{ #category : 'testing' }
41+
ExReqAbstractReport >> isRequirementReport [
42+
43+
^ false
44+
]
45+
46+
{ #category : 'testing' }
47+
ExReqAbstractReport >> isRunning [
48+
49+
^ isRunning
50+
]
51+
52+
{ #category : 'testing' }
53+
ExReqAbstractReport >> isRunning: aBoolean [
54+
55+
isRunning := aBoolean.
56+
self subReports do: [ :each | each isRunning: aBoolean ].
57+
]
58+
59+
{ #category : 'testing' }
60+
ExReqAbstractReport >> isStepReport [
61+
62+
^ false
63+
]
64+
965
{ #category : 'testing' }
1066
ExReqAbstractReport >> isValid [
1167

1268
^ self shouldBeImplemented
1369
]
70+
71+
{ #category : 'testing' }
72+
ExReqAbstractReport >> isVerificationReport [
73+
74+
^ false
75+
]
76+
77+
{ #category : 'accessing' }
78+
ExReqAbstractReport >> repositoryReport [
79+
80+
^ repositoryReport
81+
]
82+
83+
{ #category : 'accessing' }
84+
ExReqAbstractReport >> repositoryReport: aRepositoryReport [
85+
86+
repositoryReport := aRepositoryReport.
87+
self subReports do: [ :each | each repositoryReport: aRepositoryReport ].
88+
]
89+
90+
{ #category : 'as yet unclassified' }
91+
ExReqAbstractReport >> subReports [
92+
93+
^ self shouldBeImplemented
94+
]

src/ExecutableRequirements/ExReqPostconditionTracingPoint.class.st

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ Class {
66
#tag : 'Technical'
77
}
88

9-
{ #category : 'api' }
10-
ExReqPostconditionTracingPoint >> breakInContext: aContext node: aNode [
11-
12-
self stepReports
13-
reject: [ :each | each postconditionIsValid ]
14-
thenDo: [ :stepReport |
15-
stepReport verifyStepPostconditionWithContext: aContext ]
16-
]
17-
189
{ #category : 'links' }
1910
ExReqPostconditionTracingPoint >> breakLink [
2011

2112
^ super breakLink
2213
control: #after;
2314
yourself
2415
]
16+
17+
{ #category : 'api' }
18+
ExReqPostconditionTracingPoint >> verifyStepsConditionWithContext: aContext [
19+
20+
self stepReports do: [ :stepReport | stepReport verifyStepPostconditionWithContext: aContext ].
21+
22+
]

src/ExecutableRequirements/ExReqPreconditionTracingPoint.class.st

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ Class {
77
}
88

99
{ #category : 'api' }
10-
ExReqPreconditionTracingPoint >> breakInContext: aContext node: aNode [
10+
ExReqPreconditionTracingPoint >> verifyStepsConditionWithContext: aContext [
1111

12-
self stepReports
13-
reject: [ :each | each preconditionIsValid ]
14-
thenDo: [ :stepReport |
15-
stepReport verifyStepPreconditionWithContext: aContext ]
12+
self stepReports do: [ :stepReport |
13+
stepReport verifyStepPreconditionWithContext: aContext ]
1614
]

src/ExecutableRequirements/ExReqRepositoryReport.class.st

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ExReqRepositoryReport >> findRequirementReport: anExReqRequirement [
6060
ExReqRepositoryReport >> initialize [
6161

6262
super initialize.
63-
tracingPoints := OrderedCollection new
63+
tracingPoints := OrderedCollection new.
6464
]
6565

6666
{ #category : 'as yet unclassified' }
@@ -69,7 +69,15 @@ ExReqRepositoryReport >> installTracingPoints [
6969
self createTracingPoints.
7070
self tracingPoints do: [ :each |
7171
each preconditionTracingPoint install.
72-
each postconditionTracingPoint install ]
72+
each postconditionTracingPoint install ].
73+
self isInstalled: true.
74+
self isRunning: true.
75+
]
76+
77+
{ #category : 'testing' }
78+
ExReqRepositoryReport >> isRepositoryReport [
79+
80+
^ true
7381
]
7482

7583
{ #category : 'testing' }
@@ -81,9 +89,11 @@ ExReqRepositoryReport >> isValid [
8189
{ #category : 'as yet unclassified' }
8290
ExReqRepositoryReport >> removeTracingPoints [
8391

84-
self tracingPoints do: [ :each |
92+
self tracingPoints do: [ :each |
8593
each preconditionTracingPoint remove.
86-
each postconditionTracingPoint remove ]
94+
each postconditionTracingPoint remove ].
95+
self isRunning: false.
96+
8797
]
8898

8999
{ #category : 'accessing' }
@@ -97,7 +107,8 @@ ExReqRepositoryReport >> repository: anObject [
97107

98108
repository := anObject.
99109
requirementReports := repository requirements collect: [ :each |
100-
each asReport ]
110+
each asReport ].
111+
self repositoryReport: self.
101112
]
102113

103114
{ #category : 'accessing' }
@@ -106,6 +117,12 @@ ExReqRepositoryReport >> requirementReports [
106117
^ requirementReports
107118
]
108119

120+
{ #category : 'as yet unclassified' }
121+
ExReqRepositoryReport >> subReports [
122+
123+
^ self requirementReports
124+
]
125+
109126
{ #category : 'accessing' }
110127
ExReqRepositoryReport >> tracingPoints [
111128

src/ExecutableRequirements/ExReqRequirementReport.class.st

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Class {
1010
#tag : 'Model-Report'
1111
}
1212

13+
{ #category : 'testing' }
14+
ExReqRequirementReport >> isRequirementReport [
15+
16+
^ true
17+
]
18+
1319
{ #category : 'testing' }
1420
ExReqRequirementReport >> isValid [
1521

@@ -27,7 +33,14 @@ ExReqRequirementReport >> requirement: anObject [
2733

2834
requirement := anObject.
2935
verificationReports := requirement verifications collect: [ :each |
30-
each asReport requirement: anObject; yourself ]
36+
each asReport ].
37+
self subReports do: [ :each | each requirement: anObject ]
38+
]
39+
40+
{ #category : 'accessing' }
41+
ExReqRequirementReport >> subReports [
42+
43+
^ self verificationReports
3144
]
3245

3346
{ #category : 'accessing' }

0 commit comments

Comments
 (0)