mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-31 13:34:24 +02:00
Add optional rule UID to DSL Rule file syntax (#5449)
* add optional rule UID to DSL file syntax * avoid notifying the rule registry for isolated models * check other model files for rule with same name before rule removal Signed-off-by: Laurent Garnier <lg.hc@free.fr> Also-by: Ravi Nadahar <nadahar@rediffmail.com>
This commit is contained in:
+2
-2
@@ -103,7 +103,7 @@ public class DSLRuleProviderTest extends JavaOSGiTest {
|
||||
Collection<Rule> rules = dslRuleProvider.getAll();
|
||||
assertThat(rules.size(), is(0));
|
||||
|
||||
String model = "rule RuleNumberOne [ Test, \"my test\" ]\n" + //
|
||||
String model = "rule RuleNumberOne uid = rule1 [ Test, \"my test\" ]\n" + //
|
||||
"when\n" + //
|
||||
" System started\n" + //
|
||||
"then\n" + //
|
||||
@@ -125,7 +125,7 @@ public class DSLRuleProviderTest extends JavaOSGiTest {
|
||||
|
||||
Rule firstRule = it.next();
|
||||
|
||||
assertThat(firstRule.getUID(), is("dslruletest-1"));
|
||||
assertThat(firstRule.getUID(), is("rule1"));
|
||||
assertThat(firstRule.getName(), is("RuleNumberOne"));
|
||||
assertThat(firstRule.getTags(), hasSize(2));
|
||||
assertThat(firstRule.getTags(), hasItem("Test"));
|
||||
|
||||
Reference in New Issue
Block a user