Package java.util.concurrent

Examples of java.util.concurrent.CountDownLatch.await()


                    }
                    return null;
                }
            });

            suspended.await(20, TimeUnit.SECONDS);
            c.prepareGet(urlTarget).execute().get();
            c.prepareGet(urlTarget).execute().get();
            Response r = c.prepareGet(urlTarget).execute().get();

            try {
View Full Code Here


                    }
                }
            }).get();

            try {
                latch.await(20, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                fail(e.getMessage());
            }

            assertNotNull(r);
View Full Code Here

        AsyncHttpClient c = new AsyncHttpClient();
        try {
            Response r = c.prepareGet(urlTarget).execute().get();

            try {
                latch.await(20, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                fail(e.getMessage());
            }
            assertNotNull(r);
            assertEquals(r.getStatusCode(), 200);
View Full Code Here

                        latch.countDown();
                    }
                    return null;
                }
            });
            suspended.await(20, TimeUnit.SECONDS);

            Response r = c.prepareGet(urlTarget).execute().get();
            assertNotNull(r);
            assertEquals(r.getStatusCode(), 200);
        } catch (Exception e) {
View Full Code Here

                        latch.countDown();
                    }
                    return null;
                }
            });
            suspended.await(10, TimeUnit.SECONDS);

            Response r = c.prepareGet(urlTarget).execute().get();
            assertNotNull(r);
            assertEquals(r.getStatusCode(), 200);
        } catch (Exception e) {
View Full Code Here

        AsyncHttpClient c = new AsyncHttpClient();
        try {
            Future<Response> f = c.prepareGet(urlTarget).execute();

            try {
                latch.await(20, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                fail(e.getMessage());
            }
            Response r = f.get();
            assertNotNull(r);
View Full Code Here

                    return null;
                }
            });

            c.prepareGet(urlTarget).execute();
            latch.await(10, TimeUnit.SECONDS);

            assertNotNull(response.get());
            assertEquals(response.get().getStatusCode(), 200);
            assertEquals(response.get().getResponseBody(),"Message-1 Message-2 Message-3 Message-4");
        } catch (Exception e) {
View Full Code Here

        }
      };
      t.setDaemon(true);
      t.start();
    }
    Assert.assertTrue(stopLatch.await(30, TimeUnit.SECONDS));
    Assert.assertEquals(Collections.EMPTY_LIST, errors);
    wal.close();
    wal = new WAL<Text>(dataDir, Text.class);
    WALReplayResult<Text> result = wal.replay();
    Assert.assertEquals(1000, result.getSequenceID());
View Full Code Here

          // row already locked
          if (!waitForLock) {
            return null;
          }
          try {
            if (!existingLatch.await(this.rowLockWaitDuration,
                            TimeUnit.MILLISECONDS)) {
              throw new IOException("Timed out on getting lock for row="
                  + Bytes.toStringBinary(row));
            }
          } catch (InterruptedException ie) {
View Full Code Here

    // create the commit node so we update the operation to enter the commit phase
    String commit = ZKProcedureUtil.getReachedBarrierNode(controller.getZkController(), operationName);
    LOG.debug("Found prepared, posting commit node:" + commit);
    ZKUtil.createAndFailSilent(watcher, commit);
    LOG.debug("Commit node:" + commit + ", exists:" + ZKUtil.checkExists(watcher, commit));
    committed.await();

    verify(monitor, never()).receive(Mockito.any(ForeignException.class));
    // XXX: broken due to composition.
//    verify(member, never()).getManager().controllerConnectionFailure(Mockito.anyString(),
//      Mockito.any(IOException.class));
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.