Package org.openhab.binding.http.internal.HttpGenericBindingProvider

Examples of org.openhab.binding.http.internal.HttpGenericBindingProvider.HttpBindingConfig.containsKey()


   
    // method under test
    HttpBindingConfig config = provider.parseBindingConfig(testItem, bindingConfig);
   
    // asserts
    Assert.assertEquals(true, config.containsKey(DecimalType.valueOf("1")));
    Assert.assertEquals("POST", config.get(DecimalType.valueOf("1")).httpMethod);
    Assert.assertEquals("http://www.domain.org:1234/home/lights/23871/?status=on&type=\"text\"", config.get(DecimalType.valueOf("1")).url);
   
    Assert.assertEquals(true, config.containsKey(DecimalType.valueOf("0")));
    Assert.assertEquals("GET", config.get(DecimalType.valueOf("0")).httpMethod);
View Full Code Here


    // asserts
    Assert.assertEquals(true, config.containsKey(DecimalType.valueOf("1")));
    Assert.assertEquals("POST", config.get(DecimalType.valueOf("1")).httpMethod);
    Assert.assertEquals("http://www.domain.org:1234/home/lights/23871/?status=on&type=\"text\"", config.get(DecimalType.valueOf("1")).url);
   
    Assert.assertEquals(true, config.containsKey(DecimalType.valueOf("0")));
    Assert.assertEquals("GET", config.get(DecimalType.valueOf("0")).httpMethod);
    Assert.assertEquals("http://www.domain.org:1234/home/lights/23871/?status=off", config.get(DecimalType.valueOf("0")).url);
  }
 
  @Test
View Full Code Here

   
    // method under test
    HttpBindingConfig config = provider.parseBindingConfig(testItem, bindingConfig);
   
    // asserts
    Assert.assertEquals(true, config.containsKey(HttpGenericBindingProvider.IN_BINDING_KEY));
    Assert.assertEquals(null, config.get(HttpGenericBindingProvider.IN_BINDING_KEY).httpMethod);
    Assert.assertEquals("http://www.wetter-vista.de:7970/api/xml.php?q=Berlin", config.get(HttpGenericBindingProvider.IN_BINDING_KEY).url);
    Assert.assertEquals(60000, config.get(HttpGenericBindingProvider.IN_BINDING_KEY).refreshInterval);
    Assert.assertEquals("XPATH(/wettervorhersage/tag[1]/tmax)", config.get(HttpGenericBindingProvider.IN_BINDING_KEY).transformation);
  }
View Full Code Here

   
    // method under test
    HttpBindingConfig config = provider.parseBindingConfig(testItem, bindingConfig);
   
    // asserts
    Assert.assertEquals(true, config.containsKey(HttpGenericBindingProvider.IN_BINDING_KEY));
    Assert.assertEquals(null, config.get(HttpGenericBindingProvider.IN_BINDING_KEY).httpMethod);
    Assert.assertEquals("http://www.wetter-vista.de/api/xml.php?q=Berlin", config.get(HttpGenericBindingProvider.IN_BINDING_KEY).url);
    Assert.assertEquals(60000, config.get(HttpGenericBindingProvider.IN_BINDING_KEY).refreshInterval);
    Assert.assertEquals("XPATH(/wettervorhersage/tag[1]/tmax)", config.get(HttpGenericBindingProvider.IN_BINDING_KEY).transformation);
    Assert.assertNotNull(config.get(HttpGenericBindingProvider.IN_BINDING_KEY).headers);
View Full Code Here

   
    // method under test
    HttpBindingConfig config = provider.parseBindingConfig(testItem, bindingConfig);
   
    // asserts
    Assert.assertEquals(true, config.containsKey(HttpGenericBindingProvider.IN_BINDING_KEY));
    Assert.assertEquals(null, config.get(HttpGenericBindingProvider.IN_BINDING_KEY).httpMethod);
    Assert.assertEquals("http://localhost:42111/valueget.html?q=4-SWITCHMULTILEVEL-user-byte-1-0", config.get(HttpGenericBindingProvider.IN_BINDING_KEY).url);
    Assert.assertEquals(60000, config.get(HttpGenericBindingProvider.IN_BINDING_KEY).refreshInterval);
    Assert.assertEquals("XSLT(value.xsl)", config.get(HttpGenericBindingProvider.IN_BINDING_KEY).transformation);
   
View Full Code Here

    Assert.assertEquals(null, config.get(HttpGenericBindingProvider.IN_BINDING_KEY).httpMethod);
    Assert.assertEquals("http://localhost:42111/valueget.html?q=4-SWITCHMULTILEVEL-user-byte-1-0", config.get(HttpGenericBindingProvider.IN_BINDING_KEY).url);
    Assert.assertEquals(60000, config.get(HttpGenericBindingProvider.IN_BINDING_KEY).refreshInterval);
    Assert.assertEquals("XSLT(value.xsl)", config.get(HttpGenericBindingProvider.IN_BINDING_KEY).transformation);
   
    Assert.assertEquals(true, config.containsKey(HttpGenericBindingProvider.CHANGED_COMMAND_KEY));
    Assert.assertEquals("POST", config.get(HttpGenericBindingProvider.CHANGED_COMMAND_KEY).httpMethod);
    Assert.assertEquals("http://localhost:42111/valuepost.html?id=4-SWITCHMULTILEVEL-user-byte-1-0&v=39", config.get(HttpGenericBindingProvider.CHANGED_COMMAND_KEY).url);
  }
 
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.