Search in sources :

Example 1 with ModuleConfig

use of com.alibaba.dubbo.config.ModuleConfig in project dubbo by alibaba.

the class DubboConfigConfigurationTest method testSingle.

@Test
public void testSingle() throws IOException {
    context.register(DubboConfigConfiguration.Single.class);
    context.refresh();
    // application
    ApplicationConfig applicationConfig = context.getBean("applicationBean", ApplicationConfig.class);
    Assert.assertEquals("dubbo-demo-application", applicationConfig.getName());
    // module
    ModuleConfig moduleConfig = context.getBean("moduleBean", ModuleConfig.class);
    Assert.assertEquals("dubbo-demo-module", moduleConfig.getName());
    // registry
    RegistryConfig registryConfig = context.getBean(RegistryConfig.class);
    Assert.assertEquals("zookeeper://192.168.99.100:32770", registryConfig.getAddress());
    // protocol
    ProtocolConfig protocolConfig = context.getBean(ProtocolConfig.class);
    Assert.assertEquals("dubbo", protocolConfig.getName());
    Assert.assertEquals(Integer.valueOf(20880), protocolConfig.getPort());
}
Also used : RegistryConfig(com.alibaba.dubbo.config.RegistryConfig) ApplicationConfig(com.alibaba.dubbo.config.ApplicationConfig) ModuleConfig(com.alibaba.dubbo.config.ModuleConfig) ProtocolConfig(com.alibaba.dubbo.config.ProtocolConfig) Test(org.junit.Test)

Aggregations

ApplicationConfig (com.alibaba.dubbo.config.ApplicationConfig)1 ModuleConfig (com.alibaba.dubbo.config.ModuleConfig)1 ProtocolConfig (com.alibaba.dubbo.config.ProtocolConfig)1 RegistryConfig (com.alibaba.dubbo.config.RegistryConfig)1 Test (org.junit.Test)1