Package com.alibaba.dubbo.rpc

Examples of com.alibaba.dubbo.rpc.Result


        .addParameter("getSomething2.mock","force:return y");
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("something", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething2");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("y", ret.getValue());
       
      //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething3");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("something3", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("sayHello");
        ret = cluster.invoke(invocation);
        Assert.assertEquals(null, ret.getValue());
  }
View Full Code Here


        result.setValue("High");
        EasyMock.expect(invoker.invoke(invocation)).andReturn(result).anyTimes();
        URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1");
        EasyMock.expect(invoker.getUrl()).andReturn(url).anyTimes();
        EasyMock.replay(invoker);
        Result filterResult = eventFilter.invoke(invoker, invocation);
        assertEquals("High", filterResult.getValue());
    }
View Full Code Here

        .addParameter("invoke_return_error", "true" );
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("x", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething2");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("y", ret.getValue());
       
      //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething3");
    try {
View Full Code Here

        .addParameter("invoke_return_error", "true" );
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("x", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething2");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("y", ret.getValue());
       
      //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething3");
        ret = cluster.invoke(invocation);
        Assert.assertEquals(null, ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("sayHello");
        ret = cluster.invoke(invocation);
        Assert.assertEquals(null, ret.getValue());
  }
View Full Code Here

        .addParameter("invoke_return_error", "true" );
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("x", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething2");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("y", ret.getValue());
       
      //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething3");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("z", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("sayHello");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("z", ret.getValue());
  }
View Full Code Here

        .addParameter("invoke_return_error", "true" );
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("x", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething2");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("y", ret.getValue());
       
      //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething3");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("z", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("sayHello");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("z", ret.getValue());
  }
View Full Code Here

        .addParameter("invoke_return_error", "true" );
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("x", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething2");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("x", ret.getValue());
       
      //如d
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("sayHello");
        ret = cluster.invoke(invocation);
        Assert.assertEquals("x", ret.getValue());
  }
View Full Code Here

        .addParameter("invoke_return_error", "true" );
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("x", ret.getValue());
       
        //如果没有配置mock,则直接返回null
        invocation = new RpcInvocation();
    invocation.setMethodName("getSomething3");
    try{
View Full Code Here

        .addParameter("invoke_return_error", "true" );
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("somethingmock", ret.getValue());
  }
View Full Code Here

        .addParameter("invoke_return_error", "true" );
    Invoker<IHelloService> cluster = getClusterInvoker(url);       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
        Result ret = cluster.invoke(invocation);
        Assert.assertEquals("somethingmock", ret.getValue());
  }
View Full Code Here

TOP

Related Classes of com.alibaba.dubbo.rpc.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.