kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | a5cf2157144a121c73c408ab9224d270ba496b4ca05eac952bb64c47b11b4299 |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-01-30 17:17 -06:00 |
| Committer | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-02-13 07:23 -06:00 |
| Parents | 988a52e52aee |
1 file changed
modified driver-core/src/test/java/com/datastax/driver/core/HostAssert.java +9 −0
| @@ -35,9 +35,18 @@ | ||
| 35 | 35 | public HostAssert comesUpWithin(long duration, TimeUnit unit) { |
| 36 | 36 | final CountDownLatch upSignal = new CountDownLatch(1); |
| 37 | 37 | StateListener upListener = new StateListenerBase() { |
| 38 | + | |
| 39 | + @Override | |
| 38 | 40 | public void onUp(Host host) { |
| 39 | 41 | upSignal.countDown(); |
| 40 | 42 | } |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public void onAdd(Host host) { | |
| 46 | + // Special case, cassandra will sometimes not send an 'UP' topology change event | |
| 47 | + // for a new node, because of this we also listen for add events. | |
| 48 | + upSignal.countDown(); | |
| 49 | + } | |
| 41 | 50 | }; |
| 42 | 51 | cluster.register(upListener); |
| 43 | 52 | try { |