public void testMethodCallInterceptor() throws Throwable { EtmManager.reset(); BasicEtmConfigurator.configure(); EtmMonitor monitor = EtmManager.getEtmMonitor(); monitor.start(); try { EtmMethodCallInterceptor interceptor = new EtmMethodCallInterceptor(monitor); interceptor.invoke(new DummyMethodInvocation()); try { interceptor.invoke(new DummyMethodInvocation()); fail("An exception should have been thrown."); } catch (Exception e) { // ignored since expected } monitor.render(new MeasurementRenderer() { public void render(Map points) { assertTrue(!points.isEmpty()); assertNotNull(points.get("FooService::doFoo")); assertNotNull(points.get("FooService::doFoo [Exception]")); } }); } finally { monitor.stop(); } }