Search in sources :

Example 6 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.

the class ConfigCenterDefaultDeploymentProvider method getSystemBootStrapInfo.

@Override
public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
    if (!systemKey.equals(SYSTEM_KEY_CONFIG_CENTER)) {
        return null;
    }
    List<String> ccAddresses = ConfigUtil.parseArrayValue(configuration.getString("servicecomb.config.client.serverUri"));
    if (ccAddresses.isEmpty()) {
        return null;
    }
    SystemBootstrapInfo cc = new SystemBootstrapInfo();
    cc.setAccessURL(ccAddresses);
    return cc;
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo)

Example 7 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.

the class TestConfigCenterDefaultDeploymentProvider method testConfigurationEnvTwo.

@Test
public void testConfigurationEnvTwo() {
    System.setProperty("servicecomb.config.client.serverUri", "https://localhost:9988,https://localhost:9987");
    ConfigCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
    Assert.assertEquals(info.getAccessURL().size(), 2);
    Assert.assertEquals(info.getAccessURL().get(0), "https://localhost:9988");
    Assert.assertEquals(info.getAccessURL().get(1), "https://localhost:9987");
    System.getProperties().remove("servicecomb.config.client.serverUri");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 8 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.

the class TestConfigCenterDefaultDeploymentProvider method testConfigurationEnv.

@Test
public void testConfigurationEnv() {
    System.setProperty("servicecomb.config.client.serverUri", "https://localhost:9988");
    ConfigCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
    Assert.assertEquals(info.getAccessURL().get(0), "https://localhost:9988");
    System.getProperties().remove("servicecomb.config.client.serverUri");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 9 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.

the class TestKieCenterDefaultDeploymentProvider method testConfigurationEnv.

@Test
public void testConfigurationEnv() {
    System.setProperty("servicecomb.kie.serverUri", "https://localhost:30110");
    KieCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(KieCenterDefaultDeploymentProvider.SYSTEM_KEY_KIE_CENTER);
    Assert.assertEquals(info.getAccessURL().get(0), "https://localhost:30110");
    System.getProperties().remove("servicecomb.kie.serverUri");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 10 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.

the class TestKieCenterDefaultDeploymentProvider method testConfigurationEnvTwo.

@Test
public void testConfigurationEnvTwo() {
    System.setProperty("servicecomb.kie.serverUri", "http://127.0.0.1:30110,http://127.0.0.2:30110");
    KieCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(KieCenterDefaultDeploymentProvider.SYSTEM_KEY_KIE_CENTER);
    Assert.assertEquals(info.getAccessURL().size(), 2);
    Assert.assertEquals(info.getAccessURL().get(0), "http://127.0.0.1:30110");
    Assert.assertEquals(info.getAccessURL().get(1), "http://127.0.0.2:30110");
    System.getProperties().remove("servicecomb.kie.serverUri");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Aggregations

SystemBootstrapInfo (org.apache.servicecomb.deployment.SystemBootstrapInfo)30 Test (org.junit.Test)18 ArrayList (java.util.ArrayList)2