use of org.opennms.netmgt.rrd.RrdException in project opennms by OpenNMS.
the class JRobinRrdStrategyTest method testCommandWithoutDrawing.
@Test
public void testCommandWithoutDrawing() throws Exception {
long end = System.currentTimeMillis();
long start = end - (24 * 60 * 60 * 1000);
String command = "--start=" + start + " --end=" + end;
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new RrdException(ThrowableAnticipator.IGNORE_MESSAGE));
try {
m_strategy.createGraph(command, new File(""));
} catch (Throwable t) {
ta.throwableReceived(t);
// We don't care about the exact message, just a few details
String problemText = "no graph was produced";
assertTrue("cause message should contain '" + problemText + "'", t.getMessage().contains(problemText));
String suggestionText = "Does the command have any drawing commands";
assertTrue("cause message should contain '" + suggestionText + "'", t.getMessage().contains(suggestionText));
}
ta.verifyAnticipated();
}
Aggregations