Examples of ExecBindingConfig


Examples of org.openhab.binding.exec.internal.ExecGenericBindingProvider.ExecBindingConfig

    provider = new ExecGenericBindingProvider();
  }

  @Test
  public void testParseBindingConfig() throws BindingConfigParseException {
    ExecBindingConfig config = new ExecGenericBindingProvider.ExecBindingConfig();
    String bindingConfig = "ON:some command to execute, OFF: 'other command with comma\\, and \\'quotes\\' and slashes \\\\ ', *:and a fallback";
    SwitchItem item = new SwitchItem("");
   
    provider.parseLegacyOutBindingConfig(item, bindingConfig, config);
   
    Assert.assertEquals(3, config.size());
    Assert.assertEquals("some command to execute", config.get(OnOffType.ON).commandLine);
    Assert.assertEquals("other command with comma, and 'quotes' and slashes \\ ", config.get(OnOffType.OFF).commandLine);
    Assert.assertEquals("and a fallback", config.get(StringType.valueOf("*")).commandLine);
  }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.