@@ -0,0 +1,1754 @@
+package com.codahale.metrics.jetty9;%0A%0Aimport static org.hamcrest.CoreMatchers.startsWith;%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.atLeastOnce;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0A%0Aimport com.codahale.metrics.Metric;%0Aimport com.codahale.metrics.MetricRegistry;%0Aimport org.eclipse.jetty.util.thread.QueuedThreadPool;%0Aimport org.junit.After;%0Aimport org.junit.Test;%0Aimport org.mockito.ArgumentCaptor;%0A%0Apublic class InstrumentedQueuedThreadPoolTest %7B%0A    private static final String PREFIX = %22prefix%22;%0A%0A    private final MetricRegistry metricRegistry = mock(MetricRegistry.class);%0A    private final InstrumentedQueuedThreadPool iqtp = new InstrumentedQueuedThreadPool(metricRegistry);%0A    private final ArgumentCaptor%3CString%3E metricNameCaptor = ArgumentCaptor.forClass(String.class);%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        iqtp.stop();%0A    %7D%0A%0A    @Test%0A    public void customMetricsPrefix() throws Exception%7B%0A        iqtp.setPrefix(PREFIX);%0A        iqtp.doStart();%0A%0A        verify(metricRegistry, atLeastOnce()).register(metricNameCaptor.capture(), any(Metric.class));%0A        String metricName = metricNameCaptor.getValue();%0A        assertThat(%22Custom metric's prefix doesn't match%22, metricName, startsWith(PREFIX));%0A%0A    %7D%0A%0A    @Test%0A    public void metricsPrefixBackwardCompatible() throws Exception%7B%0A        iqtp.doStart();%0A%0A        verify(metricRegistry, atLeastOnce()).register(metricNameCaptor.capture(), any(Metric.class));%0A        String metricName = metricNameCaptor.getValue();%0A        assertThat(%22The default metrics prefix was changed%22, metricName, startsWith(QueuedThreadPool.class.getName()));%0A    %7D%0A%0A%7D%0A

Allow set custom prefix Jetty QueuedThreadPool's metrics (#908)