Java Code Examples for com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils#refer()

The following examples show how to use com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils#refer() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DubboLazyConnectTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Test
public void testSticky4() {
    int port = NetUtils.getAvailablePort();
    URL url = URL.valueOf("dubbo://127.0.0.1:"+port+"/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    
    ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
    
    IDemoService service = (IDemoService)ProtocolUtils.refer(IDemoService.class, url);
    Assert.assertEquals("ok", service.get());
}
 
Example 2
Source File: DubboLazyConnectTest.java    From dubbo-2.6.5 with Apache License 2.0 5 votes vote down vote up
@Test
public void testSticky4() {
    int port = NetUtils.getAvailablePort();
    URL url = URL.valueOf("dubbo://127.0.0.1:" + port + "/hi?" + Constants.LAZY_CONNECT_KEY + "=true");

    ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);

    IDemoService service = (IDemoService) ProtocolUtils.refer(IDemoService.class, url);
    Assert.assertEquals("ok", service.get());
}
 
Example 3
Source File: DubboLazyConnectTest.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
@Test
public void testSticky4() {
    int port = NetUtils.getAvailablePort();
    URL url = URL.valueOf("dubbo://127.0.0.1:"+port+"/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    
    ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
    
    IDemoService service = (IDemoService)ProtocolUtils.refer(IDemoService.class, url);
    Assert.assertEquals("ok", service.get());
}
 
Example 4
Source File: DubboLazyConnectTest.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
@Test
public void testSticky4() {
    int port = NetUtils.getAvailablePort();
    URL url = URL.valueOf("dubbo://127.0.0.1:"+port+"/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    
    ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
    
    IDemoService service = (IDemoService)ProtocolUtils.refer(IDemoService.class, url);
    Assert.assertEquals("ok", service.get());
}
 
Example 5
Source File: ExplicitCallbackTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
void referService() {
    demoProxy = (IDemoService)ProtocolUtils.refer(IDemoService.class, consumerUrl);
}
 
Example 6
Source File: DubboLazyConnectTest.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
@Test
public void testSticky2(){
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    ProtocolUtils.refer(IDemoService.class, url);
}
 
Example 7
Source File: ImplicitCallBackTest.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
void referService() {
    demoProxy = (IDemoService)ProtocolUtils.refer(IDemoService.class, consumerUrl);
}
 
Example 8
Source File: ImplicitCallBackTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
void referService() {
    demoProxy = (IDemoService)ProtocolUtils.refer(IDemoService.class, consumerUrl);
}
 
Example 9
Source File: DubboLazyConnectTest.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
@Test(expected = RpcException.class)
public void testSticky3() {
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    IDemoService service = (IDemoService)ProtocolUtils.refer(IDemoService.class, url);
    service.get();
}
 
Example 10
Source File: DubboLazyConnectTest.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
@Test(expected = RpcException.class)
public void testSticky3() {
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    IDemoService service = (IDemoService)ProtocolUtils.refer(IDemoService.class, url);
    service.get();
}
 
Example 11
Source File: DubboLazyConnectTest.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
@Test(expected = RpcException.class)
public void testSticky1(){
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi");
    ProtocolUtils.refer(IDemoService.class, url);
}
 
Example 12
Source File: DubboLazyConnectTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Test(expected = RpcException.class)
public void testSticky1(){
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi");
    ProtocolUtils.refer(IDemoService.class, url);
}
 
Example 13
Source File: ExplicitCallbackTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
void referService() {
    demoProxy = (IDemoService)ProtocolUtils.refer(IDemoService.class, consumerUrl);
}
 
Example 14
Source File: DubboLazyConnectTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Test(expected = RpcException.class)
public void testSticky3() {
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    IDemoService service = (IDemoService)ProtocolUtils.refer(IDemoService.class, url);
    service.get();
}
 
Example 15
Source File: DubboLazyConnectTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Test
public void testSticky2(){
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    ProtocolUtils.refer(IDemoService.class, url);
}
 
Example 16
Source File: DubboLazyConnectTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Test
public void testSticky2(){
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
    ProtocolUtils.refer(IDemoService.class, url);
}
 
Example 17
Source File: DubboLazyConnectTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Test(expected = RpcException.class)
public void testSticky1(){
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi");
    ProtocolUtils.refer(IDemoService.class, url);
}
 
Example 18
Source File: ExplicitCallbackTest.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
void referService() {
    demoProxy = (IDemoService)ProtocolUtils.refer(IDemoService.class, consumerUrl);
}
 
Example 19
Source File: DubboLazyConnectTest.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
@Test(expected = RpcException.class)
public void testSticky3() {
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?" + Constants.LAZY_CONNECT_KEY + "=true");
    IDemoService service = (IDemoService) ProtocolUtils.refer(IDemoService.class, url);
    service.get();
}
 
Example 20
Source File: DubboLazyConnectTest.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
@Test
public void testSticky2() {
    URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?" + Constants.LAZY_CONNECT_KEY + "=true");
    ProtocolUtils.refer(IDemoService.class, url);
}