use of org.openhab.binding.knx.internal.config.KNXGenericBindingProvider.KNXBindingConfigItem in project openhab1-addons by openhab.
the class KNXGenericBindingProviderTest method testParseBindingConfig.
@Test
public void testParseBindingConfig() throws BindingConfigParseException, KNXFormatException {
// method under Test
KNXBindingConfig bindingConfigs = provider.parseBindingConfigString(item1, "<4/2/10+0/2/10, 5.005:4/2/11+0/2/11, +4/2/12, 4/2/13");
// Assertions
assertEquals(4, bindingConfigs.size());
for (KNXBindingConfigItem bindingConfig : bindingConfigs) {
assertEquals("item1", bindingConfig.itemName);
}
assertNotNull(bindingConfigs.get(0).readableDataPoint);
assertNull(bindingConfigs.get(1).readableDataPoint);
assertNull(bindingConfigs.get(2).readableDataPoint);
assertNull(bindingConfigs.get(3).readableDataPoint);
assertTrue(bindingConfigs.get(0).allDataPoints.contains(new GroupAddress("4/2/10")));
assertTrue(bindingConfigs.get(0).allDataPoints.contains(new GroupAddress("0/2/10")));
assertTrue(bindingConfigs.get(1).allDataPoints.contains(new GroupAddress("4/2/11")));
assertTrue(bindingConfigs.get(1).allDataPoints.contains(new GroupAddress("0/2/11")));
assertTrue(bindingConfigs.get(2).allDataPoints.contains(new GroupAddress("4/2/12")));
assertTrue(bindingConfigs.get(3).allDataPoints.contains(new GroupAddress("4/2/13")));
assertEquals(true, bindingConfigs.get(0).mainDataPoint instanceof CommandDP);
assertEquals(true, bindingConfigs.get(1).mainDataPoint instanceof CommandDP);
assertEquals(true, bindingConfigs.get(2).mainDataPoint instanceof StateDP);
assertEquals(true, bindingConfigs.get(3).mainDataPoint instanceof CommandDP);
}
Aggregations