Package com.surftools.BeanstalkClient

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


    }

    // per pashields http://github.com/pashields/JavaBeanstalkClient.git
    // Names cannot start with hyphen
    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


    Object[] tubeNames = pushWatchedTubes(client);

    String srcString = "testReserve";

    // 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

    String srcString = "testReserveWithTimeout";

    int timeoutSeconds = 2;

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

    // consumer
View Full Code Here

    Object[] tubeNames = pushWatchedTubes(client);

    String srcString = "testDelete";

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

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

    String srcString = "testReserveWithTimeout";

    int timeoutSeconds = 2;

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

    // not found
    boolean ok = client.release(jobId, 65536, 0);
View Full Code Here

    boolean ok = false;
    ok = client.bury(0, 65536);
    assertFalse(ok);

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

    // we haven't reserved, so we can't bury
    ok = client.bury(jobId, 65536);
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.