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

Merge branch...

Merge branch '58-error-variable-handler-is-already-defined-when-using-multiple-protocols' into 'dev'

Resolve ""error: variable handler is already defined" when using multiple protocols"

Closes #58

See merge request !36
parents 0bf5ae33 4bac5407
Branches
No related tags found
2 merge requests!39Version 1.1.0,!36Resolve ""error: variable handler is already defined" when using multiple protocols"
Pipeline #15481 passed
# 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
### Changes
......
......@@ -7,23 +7,24 @@ public boolean {{parentTypeName}}.{{connectMethodName}}(String {{connectParamete
switch (scheme) {
{{#javaHandler}}
{{#InUse}}
case "java":
final JavaHandler handler = {{attributeName}}();
case "java": {
final JavaHandler handler = {{attributeName}}();
{{senderName}}.add(() -> {
handler.push(path, {{lastValueGetterCall}});
}{{#IndexBasedListAccess}}, index{{/IndexBasedListAccess}}, connectToken);
{{updateMethodName}}();
if (writeCurrentValue) {
{{writeMethodName}}({{#IndexBasedListAccess}}index, {{/IndexBasedListAccess}}connectToken);
{{senderName}}.add(() -> {
handler.push(path, {{lastValueGetterCall}});
}{{#IndexBasedListAccess}}, index{{/IndexBasedListAccess}}, connectToken);
{{updateMethodName}}();
if (writeCurrentValue) {
{{writeMethodName}}({{#IndexBasedListAccess}}index, {{/IndexBasedListAccess}}connectToken);
}
success = true;
break;
}
success = true;
break;
{{/InUse}}
{{/javaHandler}}
{{#mqttHandler}}
{{#InUse}}
case "mqtt":
case "mqtt": {
final MqttHandler handler = {{attributeName}}().resolveHandler(uri);
final String topic = {{attributeName}}().extractTopic(uri);
{{senderName}}.add(() -> {
......@@ -45,16 +46,18 @@ public boolean {{parentTypeName}}.{{connectMethodName}}(String {{connectParamete
}
success = true;
break;
}
{{/InUse}}
{{/mqttHandler}}
{{#restHandler}}
{{#InUse}}
case "rest":
case "rest": {
success = {{attributeName}}().newGETConnection(connectToken, () -> {
{{updateMethodName}}({{#IndexBasedListAccess}}index{{/IndexBasedListAccess}});
return new String({{lastValueGetterCall}});
});
break;
}
{{/InUse}}
{{/restHandler}}
default:
......
......@@ -244,7 +244,7 @@ task compileVia(type: RagConnectTest) {
inputFiles = [file('src/test/01-input/via/Test.relast'),
file('src/test/01-input/via/Test.connect')]
rootNode = 'A'
protocols = ['mqtt', 'rest']
protocols = ['mqtt', 'rest', 'java']
extraOptions = defaultRagConnectOptionsAnd()
}
relast {
......
......@@ -26,7 +26,6 @@ import static org.junit.jupiter.api.Assertions.*;
* @author rschoene - Initial contribution
*/
@Tag("Incremental")
@Tag("New")
public class AttributeTest extends AbstractMqttTest {
private static final String TOPIC_WILDCARD = "attr/#";
......
......@@ -16,7 +16,6 @@ import static org.junit.jupiter.api.Assertions.*;
* @author rschoene - Initial contribution
*/
@Tag("Tree")
@Tag("New")
public abstract class AbstractTreeTest extends AbstractMqttTest {
protected static final String TOPIC_ALFA = "alfa";
protected ReceiverData data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment