Examples of HosebirdMessageProcessor


Examples of com.twitter.hbc.core.processor.HosebirdMessageProcessor

  @Test
  public void testDelimitedStreamProcessing() throws Exception {
    SimpleStreamProvider simpleStream = new SimpleStreamProvider(messages, true, false);

    BlockingQueue<String> queue = new ArrayBlockingQueue<String>(10);
    HosebirdMessageProcessor processor = new StringDelimitedProcessor(queue);

    int count = processStream(simpleStream, processor, queue);

    assertEquals(messages.length, count);
  }
View Full Code Here

Examples of com.twitter.hbc.core.processor.HosebirdMessageProcessor

  @Test
  public void testSimpleStreamProcessing() throws Exception {
    SimpleStreamProvider simpleStream = new SimpleStreamProvider(messages, false, false);

    BlockingQueue<String> queue = new ArrayBlockingQueue<String>(10);
    HosebirdMessageProcessor processor = new LineStringProcessor(queue);

    int count = processStream(simpleStream, processor, queue);

    assertEquals(messages.length, count);
  }
View Full Code Here

Examples of com.twitter.hbc.core.processor.HosebirdMessageProcessor

    SimpleStreamProvider simpleStream = new SimpleStreamProvider(messages, true, true);
    int count = 0;
    try {
      InputStream stream = simpleStream.createInputStream();
      BlockingQueue<String> queue = new ArrayBlockingQueue<String>(10);
      HosebirdMessageProcessor processor = new StringDelimitedProcessor(queue);
      processor.setup(stream);
      // read until we hit the IOException
      while (count < messages.length * 2) {
        processor.process();
        // trimming to get rid of the CRLF
        assertTrue(messages[count].equals(queue.take().trim()));
        count++;
      }
      fail();
View Full Code Here

Examples of com.twitter.hbc.core.processor.HosebirdMessageProcessor

  @Test
  public void testLineStringProcessing() throws Exception {
    SimpleStreamProvider simpleStream = new SimpleStreamProvider(messages, false, false);

    BlockingQueue<String> queue = new ArrayBlockingQueue<String>(10);
    HosebirdMessageProcessor processor = new LineStringProcessor(queue);

    int count = processStream(simpleStream, processor, queue);

    assertEquals(messages.length, count);
View Full Code Here

Examples of com.twitter.hbc.core.processor.HosebirdMessageProcessor

    SimpleStreamProvider simpleStream = new SimpleStreamProvider(messages, true, true);
    int count = 0;
    try {
      InputStream stream = simpleStream.createInputStream();
      BlockingQueue<String> queue = new ArrayBlockingQueue<String>(10);
      HosebirdMessageProcessor processor = new StringDelimitedProcessor(queue);
      processor.setup(stream);
      // read until we hit the IOException
      while (count < messages.length * 2) {
        processor.process();
        // trimming to get rid of the CRLF
        assertTrue(messages[count].equals(queue.take().trim()));
        count++;
      }
      fail();
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.