Package com.aphyr.riemann.client

Examples of com.aphyr.riemann.client.RiemannClient.connect()


  public void sendEventsTest() throws IOException, InterruptedException, ServerError {
    final Server server = new OkServer();
    RiemannClient client = null;
    try {
      client = RiemannClient.tcp(server.start());
      client.connect();
      for (int i = 0; i < 10; i++) {
        final Event e = Util.createEvent();
        assertEquals(true, client.sendEventsWithAck(e));
        assertEquals(e, Util.soleEvent(server.received.poll()));
      }
View Full Code Here


  public void queryTest() throws IOException, InterruptedException, ServerError {
    final Server server = new EchoServer();
    RiemannClient client = null;
    try {
      client = RiemannClient.tcp(server.start());
      client.connect();
      for (int i = 0; i < 10; i++) {
        final List<Event> events = client.query("hi");
        assertEquals(0, events.size());
        final Msg m = server.received.poll();
        assertEquals("hi", m.getQuery().getString());
View Full Code Here

  public void sendEventsTest() throws IOException, InterruptedException, ServerError {
    final DatagramSocket serverSocket = new DatagramSocket();
    try {
      final RiemannClient client = new RiemannClient(new SimpleUdpTransport(serverSocket.getLocalPort()));
      try {
        client.connect();
        sendTestMessages(serverSocket, client);
      } finally {
        client.disconnect();
      }
    } finally {
View Full Code Here

    DatagramSocket serverSocket = new DatagramSocket();
    final int port = serverSocket.getLocalPort();
    try {
      final RiemannClient client = new RiemannClient(new SimpleUdpTransport(serverSocket.getLocalPort()));
      try {
        client.connect();
        assertTrue(client.isConnected());
        sendTestMessages(serverSocket, client);

        // Close listening socket
        serverSocket.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.