@@ -0,0 +1,2230 @@
+/*%0A* Copyright 2013 the original author or authors.%0A*%0A* Licensed under the Apache License, Version 2.0 (the %22License%22);%0A* you may not use this file except in compliance with the License.%0A* You may obtain a copy of the License at%0A*%0A* http://www.apache.org/licenses/LICENSE-2.0%0A*%0A* Unless required by applicable law or agreed to in writing, software%0A* distributed under the License is distributed on an %22AS IS%22 BASIS,%0A* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A* See the License for the specific language governing permissions and%0A* limitations under the License.%0A*/%0Apackage com.blankstyle.vine.test.integration.heartbeat;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.vertx.java.core.Handler;%0Aimport org.vertx.testtools.TestVerticle;%0A%0Aimport com.blankstyle.vine.heartbeat.DefaultHeartBeatEmitter;%0Aimport com.blankstyle.vine.heartbeat.DefaultHeartBeatMonitor;%0Aimport com.blankstyle.vine.heartbeat.HeartBeatEmitter;%0Aimport com.blankstyle.vine.heartbeat.HeartBeatMonitor;%0A%0Aimport static org.vertx.testtools.VertxAssert.assertTrue;%0Aimport static org.vertx.testtools.VertxAssert.testComplete;%0A%0A/**%0A * A heartbeat monitor/emitter test.%0A *%0A * @author Jordan Halterman%0A */%0Apublic class HeartbeatTest extends TestVerticle %7B%0A%0A  private boolean isDead;%0A%0A  @Before%0A  public void setUp() %7B%0A    isDead = false;%0A  %7D%0A%0A  @Test%0A  public void testHeartbeat() %7B%0A    // Monitor heartbeats at at least two second intervals.%0A    HeartBeatMonitor monitor = new DefaultHeartBeatMonitor(vertx, vertx.eventBus()).setInterval(2000);%0A%0A    // Emit heartbeats at one second intervals.%0A    final HeartBeatEmitter emitter = new DefaultHeartBeatEmitter(%22test.a%22, vertx, vertx.eventBus()).setInterval(1000);%0A    emitter.start();%0A%0A    monitor.monitor(%22test.a%22, new Handler%3CString%3E() %7B%0A      @Override%0A      public void handle(String event) %7B%0A        if (!isDead) %7B%0A          assertTrue(false);%0A        %7D%0A        else %7B%0A          assertTrue(true);%0A        %7D%0A        testComplete();%0A      %7D%0A    %7D);%0A%0A    // Allow the heartbeat to die in five seconds.%0A    vertx.setTimer(5000, new Handler%3CLong%3E() %7B%0A      @Override%0A      public void handle(Long event) %7B%0A        emitter.stop();%0A        isDead = true;%0A      %7D%0A    %7D);%0A  %7D%0A%0A%7D%0A

Add heartbeat monitor tests.