Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Tests should be less depending on running inventory now.
Browse files Browse the repository at this point in the history
  • Loading branch information
pilhuhn committed Feb 25, 2015
1 parent f25e1d2 commit 02dcc07
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
import org.hawkular.component.pinger.PingManager;
import org.hawkular.component.pinger.PingStatus;
import org.hawkular.component.pinger.Pinger;
import org.hawkular.metrics.client.common.SingleMetric;
import org.junit.Test;

import java.util.List;
import java.util.Map;

/**
* Simple test for the pinger
Expand All @@ -49,6 +51,7 @@ public void testPingManagerSimple() throws Exception {

PingManager manager = new PingManager();
manager.pinger = new Pinger();
manager.metricPublisher = new NoOpMetricPublisher();
PingDestination destination = new PingDestination("123","http://hawkular.github.io");
manager.addDestination(destination);
manager.metricPublisher = new MetricPublisher();
Expand All @@ -65,14 +68,31 @@ public void testPingManagerSimple() throws Exception {
* running inventory instance
* @throws Exception
*/
// @Test
@Test
public void testPingManagerStartup() throws Exception {

PingManager manager = new PingManager();
manager.startUp();
try {
manager.startUp();
} catch (javax.ws.rs.ProcessingException e) {
// It's ok, as we may not have the full Jax-RS client stack available
}
List<PingDestination> destinations = manager.getDestinations();
manager.pinger = new Pinger();
manager.scheduleWork();

}


private class NoOpMetricPublisher extends MetricPublisher {
@Override
public void sendToMetricsViaRest(String tenantId, List<Map<String, Object>> metrics) {

}

@Override
public void publishToTopic(String tenantId, List<SingleMetric> metrics) {

}
}
}

0 comments on commit 02dcc07

Please sign in to comment.