Skip to content

Commit 76ed889

Browse files
author
socadk
committed
Apache Camel template simplified, test cases adjusted
1 parent 08ac3e9 commit 76ed889

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

dsl-core/io.mdsl.cli/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Once you built the project with Gradle by calling `./gradlew clean build` in the
77

88
You can also download the CLI binaries here:
99

10-
* [mdsl-cli-5.4.6.tar](https://github.com/Microservice-API-Patterns/MDSL-Specification/releases/download/v5.4.6/mdsl-cli-mdsl-5.4.6.tar)
11-
* [mdsl-cli-5.4.6.zip](https://github.com/Microservice-API-Patterns/MDSL-Specification/releases/download/v5.4.6/mdsl-cli-mdsl-5.4.6.zip)
10+
* [mdsl-cli-5.4.6.tar](https://github.com/socadk/MDSL/releases/download/v5.4.6/mdsl-cli-mdsl-5.4.6.tar)
11+
* [mdsl-cli-5.4.6.zip](https://github.com/socadk/MDSL/releases/download/v5.4.6/mdsl-cli-mdsl-5.4.6.zip)
1212

1313
1. Uncompress the ZIP or TAR file into a directory of your choice.
1414
2. Run the CLI by using the executable in the `bin` folder:

dsl-core/io.mdsl.tests/test-data/flowgenmodel-tests/apache-camel-configuration.java.ftl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,16 @@ public class ${oflow.name} extends RouteBuilder {
8888
// create a producer to send all initial events to the process flow
8989
ProducerTemplate template = camelContext.createProducerTemplate();
9090
String testMessage = "Test message for flow ${oflow.name} in ${genModel.apiName}";
91-
<#if oflow.initEvents()??>
92-
<#assign iecount=0>
9391
<#list oflow.initEvents() as ename, event>
94-
<#assign iecount=iecount+1>
9592
template.sendBody("direct:${ename}", testMessage);
9693
// TODO add header to message if flow contains a choice, example (replace "choice-nn" with names from flow):
9794
// template.sendBodyAndHeader("direct:${ename}", testMessage, "ChoiceCondition", "choiceValue");
9895
</#list>
99-
<#if iecount==0>
100-
// flow might start with command (the ones coming from miro via CML do):
10196
<#list oflow.initCommands() as command>
10297
template.sendBody("direct:${command.name}", testMessage);
98+
// TODO add header to testMessage if flow contains a choice, example (replace "choice-nn" with names from flow):
99+
// template.sendBodyAndHeader("direct:${command.name}", testMessage, "ChoiceCondition", "choiceValue");
103100
</#list>
104-
<#assign firstEndpoint=oflow.commands[0]>
105-
<#else><#assign firstEndpoint=oflow.initEvents()?values[0]></#if></#if>
106101
camelContext.stop();
107102
camelContext.close();
108103
}

dsl-core/io.mdsl.tests/test-data/flowgenmodel-tests/esoad-blog-post.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,9 @@ public void runWrite_Paper_WithInitCommand() throws Exception {
333333
// create a producer to send all initial events to the process flow
334334
ProducerTemplate template = camelContext.createProducerTemplate();
335335
String testMessage = "Test message for flow Write_Paper_WithInitCommand in EventStormingBoardContextAPI";
336-
// flow might start with command (the ones coming from miro via CML do):
337336
template.sendBody("direct:Conduct_Research_Command", testMessage);
337+
// TODO add header to testMessage if flow contains a choice, example (replace "choice-nn" with names from flow):
338+
// template.sendBodyAndHeader("direct:Conduct_Research_Command", testMessage, "ChoiceCondition", "choiceValue");
338339
camelContext.stop();
339340
camelContext.close();
340341
}
@@ -495,7 +496,6 @@ public void runWrite_Paper_NoInitEventOrCommand() throws Exception {
495496
// create a producer to send all initial events to the process flow
496497
ProducerTemplate template = camelContext.createProducerTemplate();
497498
String testMessage = "Test message for flow Write_Paper_NoInitEventOrCommand in EventStormingBoardContextAPI";
498-
// flow might start with command (the ones coming from miro via CML do):
499499
camelContext.stop();
500500
camelContext.close();
501501
}

dsl-core/io.mdsl.tests/test-data/flowgenmodel-tests/flowtest1-sequence.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@ public void runSequentialFlowStartingWithCommand() throws Exception {
218218
// create a producer to send all initial events to the process flow
219219
ProducerTemplate template = camelContext.createProducerTemplate();
220220
String testMessage = "Test message for flow SequentialFlowStartingWithCommand in FlowTest1";
221-
// flow might start with command (the ones coming from miro via CML do):
222221
template.sendBody("direct:FlowStep1", testMessage);
222+
// TODO add header to testMessage if flow contains a choice, example (replace "choice-nn" with names from flow):
223+
// template.sendBodyAndHeader("direct:FlowStep1", testMessage, "ChoiceCondition", "choiceValue");
223224
camelContext.stop();
224225
camelContext.close();
225226
}

dsl-core/io.mdsl.tests/test-data/flowgenmodel-tests/test-combinedsteps-and-alloperators.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ public void runTestFlowWithCombinedSteps() throws Exception {
110110
// create a producer to send all initial events to the process flow
111111
ProducerTemplate template = camelContext.createProducerTemplate();
112112
String testMessage = "Test message for flow TestFlowWithCombinedSteps in TestCombinedStepsAndAllOptionsBrief";
113-
// flow might start with command (the ones coming from miro via CML do):
114113
template.sendBody("direct:c0", testMessage);
114+
// TODO add header to testMessage if flow contains a choice, example (replace "choice-nn" with names from flow):
115+
// template.sendBodyAndHeader("direct:c0", testMessage, "ChoiceCondition", "choiceValue");
115116
camelContext.stop();
116117
camelContext.close();
117118
}

dsl-core/io.mdsl/src/io/mdsl/validation/ChannelContractValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private void checkMissingParameterInChannelPathError(String channelName, Channel
181181
@Check
182182
public void checkDeliveryGuaranteeConsistency(ChannelContract channel){
183183

184-
// https://github.com/Microservice-API-Patterns/MDSL-Specification/issues/65
184+
// https://github.com/socadk/MDSL/issues/65
185185
// GUARANTEED_DELIVERY is only used in combination with the delivery guarantee set to AT_LEAST_ONCE or EXACTLY_ONCE
186186

187187
List<ChannelType> channelTypes = channel.getTypes();

0 commit comments

Comments
 (0)