Example #1
0
 @Ignore
 @Test
 public void testAsynPut() throws IOException, InterruptedException, ExecutionException {
   client.use("kk");
   for (int i = 0; i < 3; i++) {
     Job job = new Job("haha".getBytes());
     Assert.assertEquals(0, client.asynput(job));
   }
 }
Example #2
0
 @Test
 public void testAsynReserve() throws IOException, InterruptedException, ExecutionException {
   client.watch("kk");
   for (int i = 0; i < 3; i++) {
     client.asynreserve();
   }
   List<Job> jobs = client.getJobs(3);
   Assert.assertEquals("haha", new String(jobs.get(0).getData()));
   client.stop();
 }
Example #3
0
 @Ignore
 @Test
 public void testReserve() throws IOException, InterruptedException, ExecutionException {
   client.watch("kk");
   for (int i = 0; i < 6; i++) {
     Job job = client.reserve();
     Assert.assertEquals("haha", new String(job.getData()));
     client.delete(job);
   }
 }
Example #4
0
 @Test
 public void testPut() throws IOException {
   client.use("kk");
   for (int i = 0; i < 3; i++) {
     Job job = new Job("haha".getBytes());
     int res = client.put(job);
     Assert.assertEquals(0, res);
     ;
   }
 }
Example #5
0
 @Test
 public void testStats() throws IOException, InterruptedException, ExecutionException {
   Assert.assertNotNull(client.stats(servers.get(0)).get("cmd-reserve"));
 }