Skip to content
Snippets Groups Projects
Commit 511e4cf9 authored by René Schöne's avatar René Schöne
Browse files

Add scope around handler block for sendDefinition.mustache

- begin changelog for 1.0.1
- remove New Tag from tests
- add unused java protocol to via test to make sure compilation does not fail
parent 0bf5ae33
No related branches found
No related tags found
1 merge request!36Resolve ""error: variable handler is already defined" when using multiple protocols"
Pipeline #15371 passed
# Changelog # Changelog
## 1.0.1 (dev)
### Changes
### Development Changes
- Bugfix: "error: variable handler is already defined" when using multiple protocols [#58](https://git-st.inf.tu-dresden.de/jastadd/ragconnect/-/issues/58)
## 1.0.0 ## 1.0.0
### Changes ### Changes
......
...@@ -7,7 +7,7 @@ public boolean {{parentTypeName}}.{{connectMethodName}}(String {{connectParamete ...@@ -7,7 +7,7 @@ public boolean {{parentTypeName}}.{{connectMethodName}}(String {{connectParamete
switch (scheme) { switch (scheme) {
{{#javaHandler}} {{#javaHandler}}
{{#InUse}} {{#InUse}}
case "java": case "java": {
final JavaHandler handler = {{attributeName}}(); final JavaHandler handler = {{attributeName}}();
{{senderName}}.add(() -> { {{senderName}}.add(() -> {
...@@ -19,11 +19,12 @@ public boolean {{parentTypeName}}.{{connectMethodName}}(String {{connectParamete ...@@ -19,11 +19,12 @@ public boolean {{parentTypeName}}.{{connectMethodName}}(String {{connectParamete
} }
success = true; success = true;
break; break;
}
{{/InUse}} {{/InUse}}
{{/javaHandler}} {{/javaHandler}}
{{#mqttHandler}} {{#mqttHandler}}
{{#InUse}} {{#InUse}}
case "mqtt": case "mqtt": {
final MqttHandler handler = {{attributeName}}().resolveHandler(uri); final MqttHandler handler = {{attributeName}}().resolveHandler(uri);
final String topic = {{attributeName}}().extractTopic(uri); final String topic = {{attributeName}}().extractTopic(uri);
{{senderName}}.add(() -> { {{senderName}}.add(() -> {
...@@ -45,16 +46,18 @@ public boolean {{parentTypeName}}.{{connectMethodName}}(String {{connectParamete ...@@ -45,16 +46,18 @@ public boolean {{parentTypeName}}.{{connectMethodName}}(String {{connectParamete
} }
success = true; success = true;
break; break;
}
{{/InUse}} {{/InUse}}
{{/mqttHandler}} {{/mqttHandler}}
{{#restHandler}} {{#restHandler}}
{{#InUse}} {{#InUse}}
case "rest": case "rest": {
success = {{attributeName}}().newGETConnection(connectToken, () -> { success = {{attributeName}}().newGETConnection(connectToken, () -> {
{{updateMethodName}}({{#IndexBasedListAccess}}index{{/IndexBasedListAccess}}); {{updateMethodName}}({{#IndexBasedListAccess}}index{{/IndexBasedListAccess}});
return new String({{lastValueGetterCall}}); return new String({{lastValueGetterCall}});
}); });
break; break;
}
{{/InUse}} {{/InUse}}
{{/restHandler}} {{/restHandler}}
default: default:
......
...@@ -244,7 +244,7 @@ task compileVia(type: RagConnectTest) { ...@@ -244,7 +244,7 @@ task compileVia(type: RagConnectTest) {
inputFiles = [file('src/test/01-input/via/Test.relast'), inputFiles = [file('src/test/01-input/via/Test.relast'),
file('src/test/01-input/via/Test.connect')] file('src/test/01-input/via/Test.connect')]
rootNode = 'A' rootNode = 'A'
protocols = ['mqtt', 'rest'] protocols = ['mqtt', 'rest', 'java']
extraOptions = defaultRagConnectOptionsAnd() extraOptions = defaultRagConnectOptionsAnd()
} }
relast { relast {
......
...@@ -26,7 +26,6 @@ import static org.junit.jupiter.api.Assertions.*; ...@@ -26,7 +26,6 @@ import static org.junit.jupiter.api.Assertions.*;
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
@Tag("Incremental") @Tag("Incremental")
@Tag("New")
public class AttributeTest extends AbstractMqttTest { public class AttributeTest extends AbstractMqttTest {
private static final String TOPIC_WILDCARD = "attr/#"; private static final String TOPIC_WILDCARD = "attr/#";
......
...@@ -16,7 +16,6 @@ import static org.junit.jupiter.api.Assertions.*; ...@@ -16,7 +16,6 @@ import static org.junit.jupiter.api.Assertions.*;
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
@Tag("Tree") @Tag("Tree")
@Tag("New")
public abstract class AbstractTreeTest extends AbstractMqttTest { public abstract class AbstractTreeTest extends AbstractMqttTest {
protected static final String TOPIC_ALFA = "alfa"; protected static final String TOPIC_ALFA = "alfa";
protected ReceiverData data; protected ReceiverData data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment