File tree 5 files changed +73
-8
lines changed
main/java/com/ericsson/eiffel/remrem/semantics/validator
java/com/ericsson/eiffel/remrem/semantics
5 files changed +73
-8
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.0.13
2
+ - Removed the validation of REMReM should not accept both a CAUSE and a CONTEXT link types in the same event.
3
+
1
4
## 2.0.12
2
5
- Added link types PARTIALLY_RESOLVED_ISSUE, RESOLVED_ISSUE and DERESOLVED_ISSUE in EiffelSourceChangeCreatedEvent.
3
6
Original file line number Diff line number Diff line change 7
7
<version >2.0.4</version >
8
8
</parent >
9
9
<artifactId >eiffel-remrem-semantics</artifactId >
10
- <version >2.0.12 </version >
10
+ <version >2.0.13 </version >
11
11
<packaging >jar</packaging >
12
12
<properties >
13
13
<eclipse .jgit.version>5.0.1.201806211838-r</eclipse .jgit.version>
Original file line number Diff line number Diff line change @@ -116,8 +116,6 @@ private String getErrorsList(ProcessingReport report) {
116
116
public void customValidation (JsonObject jsonObjectInput ) throws EiffelValidationException {
117
117
// Links validation
118
118
Map <String , Integer > linksCountMapForEvent = new HashMap <String , Integer >();
119
- String CAUSE_LINK = "CAUSE" ;
120
- String CONTEXT_LINK = "CONTEXT" ;
121
119
try {
122
120
JsonArray links = jsonObjectInput .get ("links" ).getAsJsonArray ();
123
121
for (JsonElement link : links ) {
@@ -141,10 +139,6 @@ public void customValidation(JsonObject jsonObjectInput) throws EiffelValidation
141
139
}
142
140
linksSet .remove (requiredLinkType );
143
141
}
144
- if (linksCountMapForEvent .containsKey (CAUSE_LINK ) && linksCountMapForEvent .containsKey (CONTEXT_LINK )) {
145
- throw new EiffelValidationException (
146
- "Link types " + CAUSE_LINK + " and " + CONTEXT_LINK + " should not be in one event" );
147
- }
148
142
for (String optionalLinkType : optionalLinkTypes ) {
149
143
Integer count = linksCountMapForEvent .get (optionalLinkType );
150
144
if (count != null && (count > 1 && !LinkType .valueOf (optionalLinkType ).isMultipleAllowed ())) {
Original file line number Diff line number Diff line change @@ -63,5 +63,21 @@ public void TestInvalidActivityFinishedOutput() throws Exception {
63
63
64
64
}
65
65
66
-
66
+ @ Test
67
+ public void TestEventwithCauseAndContextLinkTypes () throws Exception {
68
+ try {
69
+ File file = new File ("output/TriggeredwithCauseAndContext.json" );
70
+ if (file .exists ()) {
71
+ JsonObject object = parser .parse (new FileReader (file )).getAsJsonObject ();
72
+ String msgType = object .get ("meta" ).getAsJsonObject ().get ("type" ).getAsString ();
73
+ EiffelValidator validator = EiffelOutputValidatorFactory
74
+ .getEiffelValidator (EiffelEventType .fromString (msgType ));
75
+ validator .validate (object );
76
+ validator .customValidation (object );
77
+ }
78
+ } catch (Exception e ) {
79
+ e .printStackTrace ();
80
+ Assert .assertFalse (true );
81
+ }
82
+ }
67
83
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "meta" : {
3
+ "id" : " 2dd2d13f-e3e5-4fac-80e3-ef4537985009" ,
4
+ "type" : " EiffelActivityTriggeredEvent" ,
5
+ "version" : " 4.0.0" ,
6
+ "time" : 1554389013770 ,
7
+ "tags" : [" product_development" ," product_feature1" ],
8
+ "source" : {
9
+ "domainId" : " eiffeltest" ,
10
+ "host" : " localhost" ,
11
+ "name" : " LOCALHOST" ,
12
+ "serializer" :
" pkg:maven/com.github.eiffel-community/[email protected] " ,
13
+ "uri" : " https://localhost:8080/jenkins/job"
14
+ }
15
+ },
16
+ "data" : {
17
+ "name" : " ActivityTrigger" ,
18
+ "categories" : [
19
+ " First" ,
20
+ " second"
21
+ ],
22
+ "triggers" : [
23
+ {
24
+ "type" : " MANUAL" ,
25
+ "description" : " Started by user anonymous"
26
+ },
27
+ {
28
+ "type" : " SOURCE_CHANGE" ,
29
+ "description" : " Change"
30
+ }
31
+ ],
32
+ "customData" : [
33
+ {
34
+ "key" : " EIFFERVERSION" ,
35
+ "value" : " eiffel2.0"
36
+ },
37
+ {
38
+ "key" : " FLOWCONTEXT" ,
39
+ "value" : " master"
40
+ }
41
+ ]
42
+ },
43
+ "links" : [
44
+ {
45
+ "type" : " CAUSE" ,
46
+ "target" : " e269b37d-17a1-4a10-aafb-c108735ee51f"
47
+ }, {
48
+ "type" : " CONTEXT" ,
49
+ "target" : " e269b37d-17a1-4a10-aafb-c108735ee52e"
50
+ }
51
+ ]
52
+ }
You can’t perform that action at this time.
0 commit comments