Package com.linkedin.r2.testutils.filter

Examples of com.linkedin.r2.testutils.filter.RpcRestCountFilter


  {
    return new TransportDispatcherBuilder()
            .addRpcHandler(ECHO_URI, new RpcEchoServer(new EchoServiceImpl()))
            .addRpcHandler(ON_EXCEPTION_ECHO_URI, new RpcEchoServer(new OnExceptionEchoService()))
            .addRpcHandler(THROWING_ECHO_URI, new RpcEchoServer(new ThrowingEchoService()))
            .addRestHandler(ECHO_URI, new RestEchoServer(new EchoServiceImpl()))
            .addRestHandler(ON_EXCEPTION_ECHO_URI, new RestEchoServer(new OnExceptionEchoService()))
            .addRestHandler(THROWING_ECHO_URI, new RestEchoServer(new ThrowingEchoService()))
            .build();
  }
View Full Code Here


  @SuppressWarnings("deprecation")
  private static TransportDispatcher createDispatcher()
  {
    return new TransportDispatcherBuilder()
            .addRpcHandler(ECHO_URI, new RpcEchoServer(new EchoServiceImpl()))
            .addRpcHandler(ON_EXCEPTION_ECHO_URI, new RpcEchoServer(new OnExceptionEchoService()))
            .addRpcHandler(THROWING_ECHO_URI, new RpcEchoServer(new ThrowingEchoService()))
            .addRestHandler(ECHO_URI, new RestEchoServer(new EchoServiceImpl()))
            .addRestHandler(ON_EXCEPTION_ECHO_URI, new RestEchoServer(new OnExceptionEchoService()))
            .addRestHandler(THROWING_ECHO_URI, new RestEchoServer(new ThrowingEchoService()))
            .build();
  }
View Full Code Here

  }

  @Test
  public void testRestRequestFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRestRequest(fc);

    assertRpcCounts    (0, 0, 0, filter);
View Full Code Here

  }

  @Test
  public void testRestResponseFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRestResponse(fc);

    assertRpcCounts    (0, 0, 0, filter);
View Full Code Here

  }

  @Test
  public void testRestErrorFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRestError(fc);

    assertRpcCounts    (0, 0, 0, filter);
View Full Code Here

    @Override
    @BeforeMethod
    public void setUp() throws Exception
    {
        _filter = getFilter();
        _beforeFilter = new RpcRestCountFilter();
        _afterFilter = new RpcRestCountFilter();
        _fc = FilterChains.create(_beforeFilter, _filter, _afterFilter);
    }
View Full Code Here

public class TestFilterChainImpl
{
  @Test
  public void testRpcRequestFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRpcRequest(fc);

    assertRpcCounts    (1, 0, 0, filter);
View Full Code Here

  }

  @Test
  public void testRpcResponseFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRpcResponse(fc);

    assertRpcCounts    (0, 1, 0, filter);
View Full Code Here

  }

  @Test
  public void testRpcErrorFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRpcError(fc);

    assertRpcCounts    (0, 0, 1, filter);
View Full Code Here

                        .setMaxR2ConnectionPoolSize(100);
        clientFactory = new HttpClientFactory();
        Map<String, String> properties = new HashMap<String, String>();
        properties.put(HttpClientFactory.HTTP_POOL_SIZE,
                       Integer.toString(restClientConfig.getMaxR2ConnectionPoolSize()));
        TransportClient transportClient = clientFactory.getClient(properties);
        R2Store r2Store = new R2Store(STORE_NAME,
                                      restClientConfig.getHttpBootstrapURL(),
                                      "0",
                                      transportClient,
                                      restClientConfig,
View Full Code Here

TOP

Related Classes of com.linkedin.r2.testutils.filter.RpcRestCountFilter

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.