Exemplo n.º 1
0
 /**
  * Test method for {@link Monitor#getNodePerformance()}.
  *
  * @throws ConnectionException
  */
 @Test
 public final void testGetNodePerformance1() throws ConnectionException {
   final Monitor conn = new Monitor(scalarisNode);
   try {
     final GetNodePerformanceResult nodePerformance = conn.getNodePerformance();
     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();
   }
 }
Exemplo n.º 2
0
 /**
  * Test method for {@link Monitor#getNodePerformance()} with a closed connection.
  *
  * @throws ConnectionException
  */
 @Test(expected = ConnectionException.class)
 public final void testGetNodePerformance_NotConnected() throws ConnectionException {
   final Monitor conn = new Monitor(scalarisNode);
   conn.closeConnection();
   conn.getNodePerformance();
 }