Package com.cloudera.flume.util

Examples of com.cloudera.flume.util.AdminRPCAvro


  @Test
  public void testMasterAdminServer() throws IOException {
    MyAvroServer server = new MyAvroServer();
    server.serve();
    AdminRPC client = new AdminRPCAvro("localhost", 56789);
    LOG.info("Connected to test master");

    long submit = client.submit(new Command(""));
    Assert.assertEquals("Expected response was 42, got " + submit, submit, 42);

    boolean succ = client.isSuccess(42);
    Assert
        .assertEquals("Expected response was false, got " + succ, succ, false);

    boolean fail = client.isFailure(42);
    Assert.assertEquals("Expected response was true, got " + fail, fail, true);

    Map<String, FlumeConfigData> cfgs = client.getConfigs();
    Assert.assertEquals("Expected response was 0, got " + cfgs.size(), cfgs
        .size(), 0);

    CommandStatus cs = client.getCommandStatus(1337);
    Assert.assertEquals(1337, cs.getCmdID());
    Assert.assertEquals("message", cs.getMessage());
    Command cmd = cs.getCommand();
    Assert.assertEquals("cmd", cmd.getCommand());
    Assert.assertEquals("arg1", cmd.getArgs()[0]);
View Full Code Here


  }

  public void testMasterAdminServerBad() throws IOException {
    MyAvroServer server = new MyAvroServer();
    server.serve();
    AdminRPC client = new AdminRPCAvro("localhost", 56789);
    LOG.info("Connected to test master");

    try {
      CommandStatus bad = client.getCommandStatus(1234);
    } catch (AvroRuntimeException are) {
      // success!
      return;
    } finally {
      server.stop();
View Full Code Here

  @Test
  public void testMasterAdminServer() throws IOException {
    MyAvroServer server = new MyAvroServer();
    server.serve();
    AdminRPC client = new AdminRPCAvro("localhost", 56789);
    LOG.info("Connected to test master");

    long submit = client.submit(new Command(""));
    Assert.assertEquals("Expected response was 42, got " + submit, submit, 42);

    boolean succ = client.isSuccess(42);
    Assert
        .assertEquals("Expected response was false, got " + succ, succ, false);

    boolean fail = client.isFailure(42);
    Assert.assertEquals("Expected response was true, got " + fail, fail, true);

    Map<String, FlumeConfigData> cfgs = client.getConfigs();
    Assert.assertEquals("Expected response was 0, got " + cfgs.size(), cfgs
        .size(), 0);

    CommandStatus cs = client.getCommandStatus(1337);
    Assert.assertEquals(1337, cs.getCmdID());
    Assert.assertEquals("message", cs.getMessage());
    Command cmd = cs.getCommand();
    Assert.assertEquals("cmd", cmd.getCommand());
    Assert.assertEquals("arg1", cmd.getArgs()[0]);
View Full Code Here

  }

  public void testMasterAdminServerBad() throws IOException {
    MyAvroServer server = new MyAvroServer();
    server.serve();
    AdminRPC client = new AdminRPCAvro("localhost", 56789);
    LOG.info("Connected to test master");

    try {
      CommandStatus bad = client.getCommandStatus(1234);
    } catch (AvroRuntimeException are) {
      // success!
      return;
    } finally {
      server.stop();
View Full Code Here

TOP

Related Classes of com.cloudera.flume.util.AdminRPCAvro

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.