Java Code Examples for com.alibaba.dubbo.rpc.RpcInvocation#setParameterTypes()

The following examples show how to use com.alibaba.dubbo.rpc.RpcInvocation#setParameterTypes() . 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: FutureFilterTest.java    From dubbo-2.6.5 with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() {
    invocation = new RpcInvocation();
    invocation.setMethodName("echo");
    invocation.setParameterTypes(new Class<?>[]{Enum.class});
    invocation.setArguments(new Object[]{"hello"});
}
 
Example 2
Source File: FutureFilterTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() {
    invocation = new RpcInvocation();
    invocation.setMethodName("echo");
    invocation.setParameterTypes(new Class<?>[] { Enum.class });
    invocation.setArguments(new Object[] { "hello" });
}
 
Example 3
Source File: FutureFilterTest.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() {
    invocation = new RpcInvocation();
    invocation.setMethodName("echo");
    invocation.setParameterTypes(new Class<?>[] { Enum.class });
    invocation.setArguments(new Object[] { "hello" });
}
 
Example 4
Source File: FutureFilterTest.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() {
    invocation = new RpcInvocation();
    invocation.setMethodName("echo");
    invocation.setParameterTypes(new Class<?>[] { Enum.class });
    invocation.setArguments(new Object[] { "hello" });
}
 
Example 5
Source File: FutureFilterTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() {
    invocation = new RpcInvocation();
    invocation.setMethodName("echo");
    invocation.setParameterTypes(new Class<?>[] { Enum.class });
    invocation.setArguments(new Object[] { "hello" });
}
 
Example 6
Source File: FutureFilterTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() {
    invocation = new RpcInvocation();
    invocation.setMethodName("echo");
    invocation.setParameterTypes(new Class<?>[] { Enum.class });
    invocation.setArguments(new Object[] { "hello" });
}
 
Example 7
Source File: ServerExceptionTest.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
@Test(expected = RpcException.class)
public void testServerException() throws Exception {

    Assert.assertNotNull(invoker);

    RpcInvocation invocation = new RpcInvocation();

    invocation.setMethodName("echoString");

    invocation.setParameterTypes(new Class<?>[]{String.class});

    String arg = "Hello, World!";

    invocation.setArguments(new Object[]{arg});

    Result result = invoker.invoke(invocation);

    System.out.println(result);

}
 
Example 8
Source File: ThriftCodecTest.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
private Request createRequest() {

        RpcInvocation invocation = new RpcInvocation();

        invocation.setMethodName("echoString");

        invocation.setArguments(new Object[]{"Hello, World!"});

        invocation.setParameterTypes(new Class<?>[]{String.class});

        invocation.setAttachment(Constants.INTERFACE_KEY, Demo.Iface.class.getName());

        Request request = new Request(1L);

        request.setData(invocation);

        return request;

    }
 
Example 9
Source File: ServerExceptionTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Test( expected = RpcException.class )
public void testServerException() throws Exception {

    Assert.assertNotNull( invoker );

    RpcInvocation invocation = new RpcInvocation();

    invocation.setMethodName( "echoString" );

    invocation.setParameterTypes( new Class<?>[]{ String.class } );

    String arg = "Hello, World!";

    invocation.setArguments( new Object[] { arg } );

    Result result = invoker.invoke( invocation );

    System.out.println( result );

}
 
Example 10
Source File: ThriftCodecTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
private Request createRequest() {

        RpcInvocation invocation = new RpcInvocation();

        invocation.setMethodName( "echoString" );

        invocation.setArguments( new Object[]{ "Hello, World!" } );

        invocation.setParameterTypes( new Class<?>[]{ String.class } );

        invocation.setAttachment( Constants.INTERFACE_KEY, Demo.Iface.class.getName() );

        Request request = new Request( 1L );

        request.setData( invocation );

        return request;

    }
 
Example 11
Source File: ServerExceptionTest.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
@Test( expected = RpcException.class )
public void testServerException() throws Exception {

    Assert.assertNotNull( invoker );

    RpcInvocation invocation = new RpcInvocation();

    invocation.setMethodName( "echoString" );

    invocation.setParameterTypes( new Class<?>[]{ String.class } );

    String arg = "Hello, World!";

    invocation.setArguments( new Object[] { arg } );

    Result result = invoker.invoke( invocation );

    System.out.println( result );

}
 
Example 12
Source File: ThriftCodecTest.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
private Request createRequest() {

        RpcInvocation invocation = new RpcInvocation();

        invocation.setMethodName( "echoString" );

        invocation.setArguments( new Object[]{ "Hello, World!" } );

        invocation.setParameterTypes( new Class<?>[]{ String.class } );

        invocation.setAttachment( Constants.INTERFACE_KEY, Demo.Iface.class.getName() );

        Request request = new Request( 1L );

        request.setData( invocation );

        return request;

    }
 
Example 13
Source File: ServerExceptionTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Test( expected = RpcException.class )
public void testServerException() throws Exception {

    Assert.assertNotNull( invoker );

    RpcInvocation invocation = new RpcInvocation();

    invocation.setMethodName( "echoString" );

    invocation.setParameterTypes( new Class<?>[]{ String.class } );

    String arg = "Hello, World!";

    invocation.setArguments( new Object[] { arg } );

    Result result = invoker.invoke( invocation );

    System.out.println( result );

}
 
Example 14
Source File: ThriftCodecTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
private Request createRequest() {

        RpcInvocation invocation = new RpcInvocation();

        invocation.setMethodName( "echoString" );

        invocation.setArguments( new Object[]{ "Hello, World!" } );

        invocation.setParameterTypes( new Class<?>[]{ String.class } );

        invocation.setAttachment( Constants.INTERFACE_KEY, Demo.Iface.class.getName() );

        Request request = new Request( 1L );

        request.setData( invocation );

        return request;

    }
 
Example 15
Source File: ServerExceptionTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Test( expected = RpcException.class )
public void testServerException() throws Exception {

    Assert.assertNotNull( invoker );

    RpcInvocation invocation = new RpcInvocation();

    invocation.setMethodName( "echoString" );

    invocation.setParameterTypes( new Class<?>[]{ String.class } );

    String arg = "Hello, World!";

    invocation.setArguments( new Object[] { arg } );

    Result result = invoker.invoke( invocation );

    System.out.println( result );

}
 
Example 16
Source File: ThriftCodecTest.java    From dubbox with Apache License 2.0 4 votes vote down vote up
private Request createRequest() {

        RpcInvocation invocation = new RpcInvocation();

        invocation.setMethodName( "echoString" );

        invocation.setArguments( new Object[]{ "Hello, World!" } );

        invocation.setParameterTypes( new Class<?>[]{ String.class } );

        invocation.setAttachment( Constants.INTERFACE_KEY, Demo.Iface.class.getName() );

        Request request = new Request( 1L );

        request.setData( invocation );

        return request;

    }