コード例 #1
0
  @Test
  public void testProbeInjectExplicitlyNamedProbeToField() {
    ProbeTest test = new ProbeTest();
    probesConfiguration.addConfig("explicitProbeInjectedToField", ProbesType.THROUGHPUT.getName());
    testContainer = createTestContainer(test);

    assertNotNull(test.fooProbe);
    assertTrue(testContainer.hasProbe("explicitProbeInjectedToField"));
  }
コード例 #2
0
  @Test
  public void testProbeInjectIntervalProbeToField() throws Exception {
    ProbeTest test = new ProbeTest();
    probesConfiguration.addConfig("latencyProbe", ProbesType.LATENCY.getName());
    testContainer = createTestContainer(test);

    assertNotNull(test.latencyProbe);
    assertTrue(testContainer.hasProbe("latencyProbe"));

    testContainer.invoke(TestPhase.RUN);
    Map<String, Result<?>> resultMap = testContainer.getProbeResults();
    assertNotNull(resultMap);
    assertTrue(resultMap.keySet().contains("latencyProbe"));
  }