use of org.apache.dubbo.config.MonitorConfig in project dubbo by alibaba.
the class AbstractInterfaceBuilderTest method monitor.
@Test
void monitor() {
InterfaceBuilder builder = new InterfaceBuilder();
builder.monitor("123");
MonitorConfig monitorConfig = new MonitorConfig("123");
Assertions.assertEquals(monitorConfig, builder.build().getMonitor());
}
use of org.apache.dubbo.config.MonitorConfig in project dubbo by alibaba.
the class ApplicationBuilderTest method monitor.
@Test
void monitor() {
MonitorConfig monitor = new MonitorConfig("monitor-addr");
ApplicationBuilder builder = new ApplicationBuilder();
builder.monitor(monitor);
Assertions.assertSame(monitor, builder.build().getMonitor());
Assertions.assertEquals("monitor-addr", builder.build().getMonitor().getAddress());
}
use of org.apache.dubbo.config.MonitorConfig in project dubbo by alibaba.
the class AnnotatedInterfaceConfigBeanBuilder method configureMonitorConfig.
private void configureMonitorConfig(C configBean) {
String monitorBeanName = resolveMonitorConfigBeanName(attributes);
MonitorConfig monitorConfig = getOptionalBean(applicationContext, monitorBeanName, MonitorConfig.class);
configBean.setMonitor(monitorConfig);
}
use of org.apache.dubbo.config.MonitorConfig in project dubbo by alibaba.
the class EnableDubboConfigTest method testSingle.
@Test
public void testSingle() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.register(TestConfig.class);
context.refresh();
// application
ApplicationConfig applicationConfig = context.getBean("applicationBean", ApplicationConfig.class);
Assertions.assertEquals("dubbo-demo-application", applicationConfig.getName());
// module
ModuleConfig moduleConfig = context.getBean("moduleBean", ModuleConfig.class);
Assertions.assertEquals("dubbo-demo-module", moduleConfig.getName());
// registry
RegistryConfig registryConfig = context.getBean(RegistryConfig.class);
Assertions.assertEquals("zookeeper://192.168.99.100:32770", registryConfig.getAddress());
// protocol
ProtocolConfig protocolConfig = context.getBean(ProtocolConfig.class);
Assertions.assertEquals("dubbo", protocolConfig.getName());
Assertions.assertEquals(Integer.valueOf(20880), protocolConfig.getPort());
// monitor
MonitorConfig monitorConfig = context.getBean(MonitorConfig.class);
Assertions.assertEquals("zookeeper://127.0.0.1:32770", monitorConfig.getAddress());
// provider
ProviderConfig providerConfig = context.getBean(ProviderConfig.class);
Assertions.assertEquals("127.0.0.1", providerConfig.getHost());
// consumer
ConsumerConfig consumerConfig = context.getBean(ConsumerConfig.class);
Assertions.assertEquals("netty", consumerConfig.getClient());
// asserts aliases
assertFalse(hasAlias(context, "org.apache.dubbo.config.RegistryConfig#0", "zookeeper"));
assertFalse(hasAlias(context, "org.apache.dubbo.config.MonitorConfig#0", "zookeeper"));
context.close();
}
use of org.apache.dubbo.config.MonitorConfig in project dubbo by alibaba.
the class MonitorBuilder method build.
public MonitorConfig build() {
MonitorConfig monitorConfig = new MonitorConfig();
super.build(monitorConfig);
monitorConfig.setProtocol(protocol);
monitorConfig.setAddress(address);
monitorConfig.setUsername(username);
monitorConfig.setPassword(password);
monitorConfig.setGroup(group);
monitorConfig.setVersion(version);
monitorConfig.setInterval(interval);
monitorConfig.setParameters(parameters);
monitorConfig.setDefault(isDefault);
return monitorConfig;
}
Aggregations