Repository: calcite-avatica
Updated Branches:
  refs/heads/master bba9ba773 -> 6afbfd52a


http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/6afbfd52/metrics-dropwizardmetrics3/src/test/java/org/apache/calcite/avatica/metrics/dropwizard3/DropwizardMetricsSystemTest.java
----------------------------------------------------------------------
diff --git 
a/metrics-dropwizardmetrics3/src/test/java/org/apache/calcite/avatica/metrics/dropwizard3/DropwizardMetricsSystemTest.java
 
b/metrics-dropwizardmetrics3/src/test/java/org/apache/calcite/avatica/metrics/dropwizard3/DropwizardMetricsSystemTest.java
deleted file mode 100644
index 7eeec3b..0000000
--- 
a/metrics-dropwizardmetrics3/src/test/java/org/apache/calcite/avatica/metrics/dropwizard3/DropwizardMetricsSystemTest.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.calcite.avatica.metrics.dropwizard3;
-
-import org.apache.calcite.avatica.metrics.Counter;
-import org.apache.calcite.avatica.metrics.Gauge;
-import org.apache.calcite.avatica.metrics.Histogram;
-import org.apache.calcite.avatica.metrics.Meter;
-import org.apache.calcite.avatica.metrics.Timer;
-import org.apache.calcite.avatica.metrics.Timer.Context;
-
-import com.codahale.metrics.MetricRegistry;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-/**
- * Tests for {@link DropwizardMetricsSystem}.
- */
-public class DropwizardMetricsSystemTest {
-
-  private MetricRegistry mockRegistry;
-  private DropwizardMetricsSystem metrics;
-
-  @Before public void setup() {
-    mockRegistry = mock(MetricRegistry.class);
-    metrics = new DropwizardMetricsSystem(mockRegistry);
-  }
-
-  @Test public void testGauge() {
-    final long gaugeValue = 42L;
-    final String name = "gauge";
-    metrics.register(name, new Gauge<Long>() {
-      @Override public Long getValue() {
-        return gaugeValue;
-      }
-    });
-
-    verify(mockRegistry, times(1)).register(eq(name), 
any(com.codahale.metrics.Gauge.class));
-  }
-
-  @Test public void testMeter() {
-    final String name = "meter";
-    final com.codahale.metrics.Meter mockMeter = 
mock(com.codahale.metrics.Meter.class);
-
-    when(mockRegistry.meter(name)).thenReturn(mockMeter);
-
-    Meter meter = metrics.getMeter(name);
-
-    final long count = 5;
-    meter.mark(count);
-
-    verify(mockMeter, times(1)).mark(count);
-
-    meter.mark();
-
-    verify(mockMeter, times(1)).mark();
-  }
-
-  @Test public void testHistogram() {
-    final String name = "histogram";
-    final com.codahale.metrics.Histogram mockHistogram = 
mock(com.codahale.metrics.Histogram.class);
-
-    when(mockRegistry.histogram(name)).thenReturn(mockHistogram);
-
-    Histogram histogram = metrics.getHistogram(name);
-
-    long[] long_values = new long[] {1L, 5L, 15L, 30L, 60L};
-    for (long value : long_values) {
-      histogram.update(value);
-    }
-
-    for (long value : long_values) {
-      verify(mockHistogram).update(value);
-    }
-
-    int[] int_values = new int[] {2, 6, 16, 31, 61};
-    for (int value : int_values) {
-      histogram.update(value);
-    }
-
-    for (int value : int_values) {
-      verify(mockHistogram).update(value);
-    }
-  }
-
-  @Test public void testCounter() {
-    final String name = "counter";
-    final com.codahale.metrics.Counter mockCounter = 
mock(com.codahale.metrics.Counter.class);
-
-    when(mockRegistry.counter(name)).thenReturn(mockCounter);
-
-    Counter counter = metrics.getCounter(name);
-
-    long[] updates = new long[] {1L, 5L, -2L, 4L, -8L, 0};
-    for (long update : updates) {
-      if (update < 0) {
-        counter.decrement(Math.abs(update));
-      } else {
-        counter.increment(update);
-      }
-    }
-
-    for (long update : updates) {
-      if (update < 0) {
-        verify(mockCounter).dec(Math.abs(update));
-      } else {
-        verify(mockCounter).inc(update);
-      }
-    }
-
-    int numSingleUpdates = 3;
-    for (int i = 0; i < numSingleUpdates; i++) {
-      counter.increment();
-      counter.decrement();
-    }
-
-    verify(mockCounter, times(numSingleUpdates)).inc();
-    verify(mockCounter, times(numSingleUpdates)).dec();
-  }
-
-  @Test public void testTimer() {
-    final String name = "timer";
-    final com.codahale.metrics.Timer mockTimer = 
mock(com.codahale.metrics.Timer.class);
-    final com.codahale.metrics.Timer.Context mockContext =
-        mock(com.codahale.metrics.Timer.Context.class);
-
-    when(mockRegistry.timer(name)).thenReturn(mockTimer);
-    when(mockTimer.time()).thenReturn(mockContext);
-
-    Timer timer = metrics.getTimer(name);
-    Context context = timer.start();
-    context.close();
-
-    verify(mockTimer).time();
-    verify(mockContext).stop();
-  }
-}
-
-// End DropwizardMetricsSystemTest.java

http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/6afbfd52/metrics-dropwizardmetrics3/src/test/java/org/apache/calcite/avatica/metrics/dropwizard3/DropwizardTimerTest.java
----------------------------------------------------------------------
diff --git 
a/metrics-dropwizardmetrics3/src/test/java/org/apache/calcite/avatica/metrics/dropwizard3/DropwizardTimerTest.java
 
b/metrics-dropwizardmetrics3/src/test/java/org/apache/calcite/avatica/metrics/dropwizard3/DropwizardTimerTest.java
deleted file mode 100644
index 536d935..0000000
--- 
a/metrics-dropwizardmetrics3/src/test/java/org/apache/calcite/avatica/metrics/dropwizard3/DropwizardTimerTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to you under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.calcite.avatica.metrics.dropwizard3;
-
-import 
org.apache.calcite.avatica.metrics.dropwizard3.DropwizardTimer.DropwizardContext;
-
-import com.codahale.metrics.Timer;
-import com.codahale.metrics.Timer.Context;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-/**
- * Test class for {@link DropwizardTimer}
- */
-public class DropwizardTimerTest {
-
-  private Timer timer;
-  private Context context;
-
-  @Before public void setup() {
-    this.timer = Mockito.mock(Timer.class);
-    this.context = Mockito.mock(Context.class);
-  }
-
-  @Test public void test() {
-    DropwizardTimer dwTimer = new DropwizardTimer(timer);
-
-    Mockito.when(timer.time()).thenReturn(context);
-
-    DropwizardContext dwContext = dwTimer.start();
-
-    dwContext.close();
-
-    Mockito.verify(timer).time();
-    Mockito.verify(context).stop();
-  }
-
-}
-
-// End DropwizardTimerTest.java

http://git-wip-us.apache.org/repos/asf/calcite-avatica/blob/6afbfd52/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e60e33c..1d6c9ac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,7 +62,7 @@ limitations under the License.
     <!-- Needed for JDK 10 javadoc for [LANG-1365] -->
     <commons-lang3.version>3.8</commons-lang3.version>
     <docker-maven-plugin.version>1.1.1</docker-maven-plugin.version>
-    <dropwizard-metrics3.version>3.1.2</dropwizard-metrics3.version>
+    <dropwizard-metrics.version>4.0.3</dropwizard-metrics.version>
     <forbiddenapis.version>2.6</forbiddenapis.version>
     <groovy-maven-plugin.version>2.1</groovy-maven-plugin.version>
     <!-- We support guava versions as old as 14.0.1 (the version used by Hive)
@@ -114,7 +114,7 @@ limitations under the License.
     <module>core</module>
     <module>docker</module>
     <module>metrics</module>
-    <module>metrics-dropwizardmetrics3</module>
+    <module>metrics-dropwizardmetrics</module>
     <module>noop-driver</module>
     <module>server</module>
     <module>tck</module>

Reply via email to