Package com.twitter.hbc.test

Examples of com.twitter.hbc.test.SimpleStreamProvider


  /**
   * StringDelimitedProcessor properly processes streams
   */
  @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);
View Full Code Here


    assertEquals(messages.length, count);
  }

  @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);
View Full Code Here

    return count;
  }

  @Test
  public void testIdleProbe() throws Exception {
    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) {
View Full Code Here

    }
  }

  @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);
View Full Code Here

    return count;
  }

  @Test
  public void testIdleProbe() throws Exception {
    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) {
View Full Code Here

TOP

Related Classes of com.twitter.hbc.test.SimpleStreamProvider

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.