Package org.beangle.commons.property

Examples of org.beangle.commons.property.PropertyConfig


@Test
public class UrlConfigProviderTest {

  public void testConfig() {
    PropertyConfig config = new PropertyConfigBean();
    UrlPropertyConfigProvider provider = new UrlPropertyConfigProvider();
    ConfigResource location = new ConfigResource();
    // META-INF/system.properties
    location.setGlobal(UrlPropertyConfigProvider.class.getResource("/system-default.properties"));
    location.setUser(UrlPropertyConfigProvider.class.getResource("/system.properties"));
    provider.setResource(location);
    Properties properties = provider.getConfig();
    config.set(properties);
    assertEquals(Integer.valueOf(1), config.get(Integer.class, "testInt"));
    assertEquals("beangle.org", config.get("system.vendor"));
    assertEquals("http://localhost", config.get("system.url"));
  }
View Full Code Here

TOP

Related Classes of org.beangle.commons.property.PropertyConfig

Copyright © 2018 www.massapicom. 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.