Package org.apache.flume.api.RpcTestUtils

Examples of org.apache.flume.api.RpcTestUtils.OKAvroHandler


   */
  @Test(expected=EventDeliveryException.class)
  public void testServerDisconnect() throws FlumeException,
      EventDeliveryException {
    NettyAvroRpcClient client = null;
    Server server = RpcTestUtils.startServer(new OKAvroHandler());
    try {
      client = RpcTestUtils.getStockLocalClient(server.getPort());
      server.close();
      try {
        server.join();
View Full Code Here


   */
  @Test(expected=EventDeliveryException.class)
  public void testClientClosedRequest() throws FlumeException,
      EventDeliveryException {
    NettyAvroRpcClient client = null;
    Server server = RpcTestUtils.startServer(new OKAvroHandler());
    try {
      client = RpcTestUtils.getStockLocalClient(server.getPort());
      client.close();
      Assert.assertFalse("Client should not be active", client.isActive());
      System.out.println("Yaya! I am not active after client close!");
View Full Code Here

  // testing deprecated API
  @Test
  public void testTwoParamDeprecatedAppend() throws FlumeException,
      EventDeliveryException {
    RpcClient client = null;
    Server server = RpcTestUtils.startServer(new OKAvroHandler());
    try {
      client = RpcClientFactory.getInstance(localhost, server.getPort());
      client.append(EventBuilder.withBody("wheee!!!", Charset.forName("UTF8")));
    } finally {
      RpcTestUtils.stopServer(server);
View Full Code Here

  // testing deprecated API
  @Test
  public void testThreeParamDeprecatedAppend() throws FlumeException,
      EventDeliveryException {
    RpcClient client = null;
    Server server = RpcTestUtils.startServer(new OKAvroHandler());
    try {
      client = RpcClientFactory.getInstance(localhost, server.getPort(), 3);
      Assert.assertEquals("Batch size was specified", 3, client.getBatchSize());
      client.append(EventBuilder.withBody("wheee!!!", Charset.forName("UTF8")));
    } finally {
View Full Code Here

  @Test
  public void testThreeParamBatchAppend() throws FlumeException,
      EventDeliveryException {
    int batchSize = 7;
    RpcClient client = null;
    Server server = RpcTestUtils.startServer(new OKAvroHandler());
    try {
      client = RpcClientFactory.getDefaultInstance(localhost, server.getPort(),
          batchSize);

      List<Event> events = new ArrayList<Event>();
View Full Code Here

  @Test
  public void testPropertiesBatchAppend() throws FlumeException,
      EventDeliveryException {
    int batchSize = 7;
    RpcClient client = null;
    Server server = RpcTestUtils.startServer(new OKAvroHandler());
    try {
      Properties p = new Properties();
      p.put("hosts", "host1");
      p.put("hosts.host1", localhost + ":" + String.valueOf(server.getPort()));
      p.put("batch-size", String.valueOf(batchSize));
View Full Code Here

  // we are supposed to handle this gracefully
  @Test
  public void testTwoParamBatchAppendOverflow() throws FlumeException,
      EventDeliveryException {
    RpcClient client = null;
    Server server = RpcTestUtils.startServer(new OKAvroHandler());
    try {
      client = RpcClientFactory.getDefaultInstance(localhost, server.getPort());
      int batchSize = client.getBatchSize();
      int moreThanBatch = batchSize + 1;
      List<Event> events = new ArrayList<Event>();
View Full Code Here

   * @throws EventDeliveryException
   */
  @Test
  public void testOKServerSimple() throws FlumeException,
      EventDeliveryException {
    RpcTestUtils.handlerSimpleAppendTest(new OKAvroHandler());
  }
View Full Code Here

   * @throws EventDeliveryException
   */
  @Test
  public void testOKServerBatch() throws FlumeException,
      EventDeliveryException {
    RpcTestUtils.handlerBatchAppendTest(new OKAvroHandler());
  }
View Full Code Here

  public void testBatchOverrun() throws FlumeException, EventDeliveryException {

    int batchSize = 10;
    int moreThanBatchSize = batchSize + 1;
    NettyAvroRpcClient client = null;
    Server server = RpcTestUtils.startServer(new OKAvroHandler());
    try {
      client = new NettyAvroRpcClient(
          new InetSocketAddress(localhost, server.getPort()), batchSize);

      // send one more than the batch size
View Full Code Here

TOP

Related Classes of org.apache.flume.api.RpcTestUtils.OKAvroHandler

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.