use of com.alibaba.dubbo.config.MethodConfig in project dubbo by alibaba.
the class InvokerSideConfigUrlTest method initRefConf.
// ======================================================
// private helper
// ======================================================
private void initRefConf() {
appConfForConsumer = new ApplicationConfig();
appConfForReference = new ApplicationConfig();
regConfForConsumer = new RegistryConfig();
regConfForReference = new RegistryConfig();
methodConfForReference = new MethodConfig();
refConf = new ReferenceConfig<DemoService>();
consumerConf = new ConsumerConfig();
methodConfForReference.setName("sayName");
regConfForReference.setAddress("127.0.0.1:9090");
regConfForReference.setProtocol("mockregistry");
appConfForReference.setName("ConfigTests");
refConf.setInterface("com.alibaba.dubbo.config.api.DemoService");
refConf.setApplication(appConfForReference);
consumerConf.setApplication(appConfForConsumer);
refConf.setRegistry(regConfForReference);
consumerConf.setRegistry(regConfForConsumer);
refConf.setConsumer(consumerConf);
refConf.setMethods(Arrays.asList(new MethodConfig[] { methodConfForReference }));
refConf.setScope(Constants.SCOPE_REMOTE);
}
use of com.alibaba.dubbo.config.MethodConfig in project dubbo by alibaba.
the class UrlTestBase method initServConf.
@SuppressWarnings("deprecation")
protected void initServConf() {
appConfForProvider = new ApplicationConfig();
appConfForService = new ApplicationConfig();
regConfForProvider = new RegistryConfig();
regConfForService = new RegistryConfig();
provConf = new ProviderConfig();
protoConfForProvider = new ProtocolConfig();
protoConfForService = new ProtocolConfig();
methodConfForService = new MethodConfig();
servConf = new ServiceConfig<DemoService>();
provConf.setApplication(appConfForProvider);
servConf.setApplication(appConfForService);
provConf.setRegistry(regConfForProvider);
servConf.setRegistry(regConfForService);
provConf.setProtocols(Arrays.asList(new ProtocolConfig[] { protoConfForProvider }));
servConf.setProtocols(Arrays.asList(new ProtocolConfig[] { protoConfForService }));
servConf.setMethods(Arrays.asList(new MethodConfig[] { methodConfForService }));
servConf.setProvider(provConf);
servConf.setRef(demoService);
servConf.setInterfaceClass(DemoService.class);
methodConfForService.setName("sayName");
regConfForService.setAddress("127.0.0.1:9090");
regConfForService.setProtocol("mockregistry");
appConfForService.setName("ConfigTests");
}
Aggregations