/** * Test method for {@link Monitor#getServicePerformance()}. * * @throws ConnectionException */ @Test public final void testGetServicePerformance1() throws ConnectionException { final Monitor conn = new Monitor(scalarisNode); try { final GetServicePerformanceResult nodePerformance = conn.getServicePerformance(); for (final Entry<Long, Double> latencyAvg : nodePerformance.latencyAvg.entrySet()) { assertTrue(latencyAvg.toString(), latencyAvg.getKey() >= 0); assertTrue(latencyAvg.toString(), latencyAvg.getValue() >= 0); } for (final Entry<Long, Double> latencyStddev : nodePerformance.latencyStddev.entrySet()) { assertTrue(latencyStddev.toString(), latencyStddev.getKey() >= 0); assertTrue(latencyStddev.toString(), latencyStddev.getValue() >= 0); } } finally { conn.closeConnection(); } }
/** * Test method for {@link Monitor#getServicePerformance()} with a closed connection. * * @throws ConnectionException */ @Test(expected = ConnectionException.class) public final void testGetServicePerformance_NotConnected() throws ConnectionException { final Monitor conn = new Monitor(scalarisNode); conn.closeConnection(); conn.getServicePerformance(); }