Examples of ConfigResource


Examples of org.beangle.commons.config.ConfigResource

public class UrlConfigProviderTest {

  public void testConfig() {
    Config config = new ConfigBean();
    UrlConfigProvider provider = new UrlConfigProvider();
    ConfigResource location = new ConfigResource();
    // META-INF/system.properties
    location.setGlobal(UrlConfigProvider.class.getResource("/system-default.properties"));
    location.setUser(UrlConfigProvider.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"));
View Full Code Here

Examples of org.beangle.commons.config.ConfigResource

public class TableNameConfigTest {

  @Test
  public void testGetSchemaName() {
    DefaultTableNameConfig config = new DefaultTableNameConfig();
    ConfigResource resource = new ConfigResource();
    resource.setGlobal(TableNameConfigTest.class.getClassLoader().getResource(
        "table.properties"));
    config.setResource(resource);
    Assert.assertEquals("security_online", config
        .getSchema("org.beangle.security.online.model"));
    Assert.assertEquals("sys_", config.getPrefix("org.beangle.security"));
View Full Code Here

Examples of org.beangle.spring.config.ConfigResource

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"));
View Full Code Here

Examples of org.beangle.spring.config.ConfigResource

  }

  // FIXME
  private ConfigResource getDefaultResource() {
    try {
      ConfigResource resource = new ConfigResource();
      resource.setGlobal(ProfileServiceImpl.class.getClassLoader().getResource(
          "META-INF/beangle/convention-default.properties"));
      Enumeration<URL> em = ProfileServiceImpl.class.getClassLoader().getResources(
          "META-INF/beangle/convention-route.properties");
      while (em.hasMoreElements()) {
        resource.getLocals().add(em.nextElement());
      }
      return resource;
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

Examples of org.beangle.spring.config.ConfigResource

public class TableNameConfigTest {

  @Test
  public void testGetSchemaName() {
    DefaultTableNameConfig config = new DefaultTableNameConfig();
    ConfigResource resource = new ConfigResource();
    resource.setGlobal(TableNameConfigTest.class.getClassLoader().getResource("META-INF/beangle/table.properties"));
    config.setResource(resource);
    Assert.assertEquals("security_online", config.getSchema("org.beangle.security.online.model"));
    Assert.assertEquals("sys_", config.getPrefix("org.beangle.security"));
  }
View Full Code Here

Examples of org.beangle.spring.config.ConfigResource

  }

  // FIXME
  private ConfigResource getDefaultResource() {
    try {
      ConfigResource resource = new ConfigResource();
      resource.setGlobal(ProfileServiceImpl.class.getClassLoader().getResource(
          "META-INF/beangle/convention-default.properties"));
      Enumeration<URL> em = ProfileServiceImpl.class.getClassLoader().getResources(
          "META-INF/beangle/convention-route.properties");
      while (em.hasMoreElements()) {
        resource.getLocals().add(em.nextElement());
      }
      return resource;
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

Examples of org.mule.config.ConfigResource

    private static Resource[] convert(ConfigResource[] resources)
    {
        Resource[] configResources = new Resource[resources.length];
        for (int i = 0; i < resources.length; i++)
        {
            ConfigResource resource = resources[i];
            if(resource.getUrl()!=null)
            {
                configResources[i] = new UrlResource(resource.getUrl());
            }
            else
            {
                try
                {
                    configResources[i] = new ByteArrayResource(IOUtils.toByteArray(resource.getInputStream()), resource.getResourceName());
                }
                catch (IOException e)
                {
                    throw new RuntimeException(e);
                }
View Full Code Here

Examples of org.mule.config.ConfigResource

    {
        ConfigResource[] allResources;
        if (useDefaultConfigResource)
        {
            allResources = new ConfigResource[configResources.length + 2];
            allResources[0] = new ConfigResource(MULE_SPRING_CONFIG);
            allResources[1] = new ConfigResource(MULE_DEFAULTS_CONFIG);
            System.arraycopy(configResources, 0, allResources, 2, configResources.length);
        }
        else
        {
            allResources = new ConfigResource[configResources.length + 1];
            allResources[0] = new ConfigResource(MULE_SPRING_CONFIG);
            System.arraycopy(configResources, 0, allResources, 1, configResources.length);
        }
        createSpringRegistry(muleContext, createApplicationContext(muleContext, allResources));
    }
View Full Code Here

Examples of org.mule.config.ConfigResource

        try
        {
            configResources = new ConfigResource[configs.length];
            for (int i = 0; i < configs.length; i++)
            {
                configResources[i] = new ConfigResource(configs[i]);
            }
            return configResources;
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.mule.config.ConfigResource

        scriptComponent = new Scriptable(muleContext);
        scriptComponent.setScriptEngineName(scriptEngineName);
           
        for (int i = 0; i < configResources.length; i++)
        {
            ConfigResource configResource = configResources[i];
            scriptComponent.setScriptFile(configResource.getResourceName());
            scriptComponent.initialise();
            // Set up initial script variables.
            Bindings bindings = scriptComponent.getScriptEngine().createBindings();
            scriptComponent.populateDefaultBindings(bindings);
            scriptComponent.runScript(bindings);
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.