Examples of useTube()


Examples of com.surftools.BeanstalkClient.Client.useTube()

  public void testReady() {

    Client client = new ClientImpl(TEST_HOST, TEST_PORT);

    Object[] tubeNames = pushWatchedTubes(client);
    client.useTube((String) tubeNames[1]);

    String srcString = "testPeekReady-";

    int nJobs = 3;
    long[] jobIds = new long[nJobs];
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

    int nJobs = 3;
    long[] jobIds = new long[nJobs];

    // producer
    for (int i = 0; i < nJobs; ++i) {
      client.useTube((String) tubeNames[1]);
      long jobId = client.put(65536, 0, 120, (srcString + i).getBytes());
      assertTrue(jobId > 0);
      jobIds[i] = jobId;
    }
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

  public void testDelayed() {

    Client client = new ClientImpl(TEST_HOST, TEST_PORT);

    Object[] tubeNames = pushWatchedTubes(client);
    client.useTube((String) tubeNames[1]);

    String srcString = "testPeekDelay";
    int delaySeconds = 2;

    // producer
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

    String srcString = "testPeekDelay";
    int delaySeconds = 2;

    // producer
    client.useTube((String) tubeNames[1]);
    // note we adjust delay
    long jobId = client.put(65536, delaySeconds, 120, srcString.getBytes());
    assertTrue(jobId > 0);

    // peekDelayed
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

  public void testBuried() {

    Client client = new ClientImpl(TEST_HOST, TEST_PORT);

    Object[] tubeNames = pushWatchedTubes(client);
    client.useTube((String) tubeNames[1]);

    String srcString = "testPeekBuried";

    // peekBuried
    Job job = client.peekBuried();
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

        Object[] tubeNames = pushWatchedTubes(client);

        String srcString = "testUseBlockIO";

        // producer
        client.useTube((String) tubeNames[1]);
        long jobId = client.put(65536, 0, 120, srcString.getBytes());
        assertTrue(jobId > 0);

        // consumer
        Job job = client.reserve(null);
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

      for (int i = 0; i < srcBytes.length; ++i) {
        srcBytes[i] = (byte) i;
      }

      // producer
      client.useTube((String) tubeNames[1]);
      long jobId = client.put(65536, 0, 120, srcBytes);
      assertTrue(jobId > 0);

      // consumer
      Job job = client.reserve(null);
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

    }
  }

  public void testUseTube() {
    Client client = new ClientImpl(TEST_HOST, TEST_PORT);
    client.useTube("foobar");

    // hashes are not valid in tube names
    try {
      client.useTube("foobar#");
      fail("no BAD_FORMAT thrown");
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

    Client client = new ClientImpl(TEST_HOST, TEST_PORT);
    client.useTube("foobar");

    // hashes are not valid in tube names
    try {
      client.useTube("foobar#");
      fail("no BAD_FORMAT thrown");
    } catch (BeanstalkException be) {
      assertEquals("BAD_FORMAT", be.getMessage());
    } catch (Exception e) {
      fail(e.getMessage());
View Full Code Here

Examples of com.surftools.BeanstalkClient.Client.useTube()

    }

    // underscores are valid in tube names >= beanstalk 1.4.4.
    if (serverSupportsUnderscoreInTubeName(client)) {
      try {
        client.useTube("foobar_");
      } catch (Exception e) {
        fail(e.getMessage());
      }
    }
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.