diff --git a/hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/MetricsTests.java b/hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/MetricsTests.java new file mode 100644 index 00000000000..c16d64e3cb1 --- /dev/null +++ b/hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/MetricsTests.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +/** + * Tag a test that covers our metrics handling + */ +package org.apache.hadoop.hbase.testclassification; + +public interface MetricsTests { +} diff --git a/hbase-hadoop-compat/pom.xml b/hbase-hadoop-compat/pom.xml index bd88de329c6..b529fe2b35f 100644 --- a/hbase-hadoop-compat/pom.xml +++ b/hbase-hadoop-compat/pom.xml @@ -107,6 +107,12 @@ + + org.apache.hbase + hbase-annotations + test-jar + test + commons-logging diff --git a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/TestCompatibilitySingletonFactory.java b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/TestCompatibilitySingletonFactory.java index db5a1a35dfc..f94205921d2 100644 --- a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/TestCompatibilitySingletonFactory.java +++ b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/TestCompatibilitySingletonFactory.java @@ -26,11 +26,16 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; + import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; +@Category({MetricsTests.class, SmallTests.class}) public class TestCompatibilitySingletonFactory { private static final int ITERATIONS = 100000; diff --git a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java index 3d83975c10e..91efd393ad4 100644 --- a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java +++ b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java @@ -20,11 +20,15 @@ package org.apache.hadoop.hbase.master; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.master.MetricsMasterSource; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * Test for the CompatibilitySingletonFactory and building MetricsMasterSource */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsMasterSourceFactory { @Test(expected=RuntimeException.class) diff --git a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java index 1326b858e3b..fbf1994f7d4 100644 --- a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java +++ b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java @@ -20,11 +20,15 @@ package org.apache.hadoop.hbase.regionserver; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.regionserver.MetricsRegionServerSourceFactory; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * Test for the CompatibilitySingletonFactory and building MetricsRegionServerSource */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsRegionServerSourceFactory { @Test(expected=RuntimeException.class) diff --git a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSource.java b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSource.java index 52541982143..aabfdfe1634 100644 --- a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSource.java +++ b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSource.java @@ -19,8 +19,12 @@ package org.apache.hadoop.hbase.regionserver.wal; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsWALSource { @Test(expected=RuntimeException.class) diff --git a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java index 637b6f79f2e..3a8bb8910d6 100644 --- a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java +++ b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java @@ -20,11 +20,15 @@ package org.apache.hadoop.hbase.replication.regionserver; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationSource; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * Test for the CompatibilitySingletonFactory and building MetricsReplicationSource */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsReplicationSourceFactory { @Test(expected=RuntimeException.class) diff --git a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java index 0691fa12962..ee2f164e20a 100644 --- a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java +++ b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java @@ -20,11 +20,15 @@ package org.apache.hadoop.hbase.rest; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.rest.MetricsRESTSource; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * Test of Rest Metrics Source interface. */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsRESTSource { diff --git a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactory.java b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactory.java index bd132bbf760..f33135eb5aa 100644 --- a/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactory.java +++ b/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactory.java @@ -19,12 +19,16 @@ package org.apache.hadoop.hbase.thrift; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.apache.hadoop.hbase.thrift.MetricsThriftServerSourceFactory; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * Test for the interface of MetricsThriftServerSourceFactory */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsThriftServerSourceFactory { diff --git a/hbase-hadoop2-compat/pom.xml b/hbase-hadoop2-compat/pom.xml index 571dc3abce7..df77668b34d 100644 --- a/hbase-hadoop2-compat/pom.xml +++ b/hbase-hadoop2-compat/pom.xml @@ -150,6 +150,12 @@ limitations under the License. + + org.apache.hbase + hbase-annotations + test-jar + test + org.apache.hbase hbase-hadoop-compat diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceImpl.java index 4cdd60677fe..cdef0a1f1e9 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceImpl.java @@ -22,7 +22,10 @@ import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.master.MetricsMasterSource; import org.apache.hadoop.hbase.master.MetricsMasterSourceFactory; import org.apache.hadoop.hbase.master.MetricsMasterSourceImpl; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; @@ -30,6 +33,7 @@ import static org.junit.Assert.assertTrue; /** * Test for MetricsMasterSourceImpl */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsMasterSourceImpl { @Test diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/metrics/TestBaseSourceImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/metrics/TestBaseSourceImpl.java index 3c9d792409c..7381fb9b870 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/metrics/TestBaseSourceImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/metrics/TestBaseSourceImpl.java @@ -18,10 +18,13 @@ package org.apache.hadoop.hbase.metrics; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.apache.hadoop.metrics2.lib.MutableCounterLong; import org.apache.hadoop.metrics2.lib.MutableGaugeLong; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -29,6 +32,7 @@ import static org.junit.Assert.assertNull; /** * Test of default BaseSource for hadoop 2 */ +@Category({MetricsTests.class, SmallTests.class}) public class TestBaseSourceImpl { private static BaseSourceImpl bmsi; diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceImpl.java index e6e16c78c64..05a5522af81 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceImpl.java @@ -19,7 +19,10 @@ package org.apache.hadoop.hbase.regionserver; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; @@ -27,6 +30,7 @@ import static org.junit.Assert.assertTrue; /** * Test for MetricsRegionServerSourceImpl */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsRegionServerSourceImpl { @Test diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionSourceImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionSourceImpl.java index f9b902abfba..7eb9c529927 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionSourceImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionSourceImpl.java @@ -26,8 +26,12 @@ import java.util.Map; import org.apache.commons.math.stat.descriptive.DescriptiveStatistics; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsRegionSourceImpl { @Test diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSourceImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSourceImpl.java index 088a8cf51b9..ddfed45ebbc 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSourceImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSourceImpl.java @@ -18,11 +18,15 @@ package org.apache.hadoop.hbase.regionserver.wal; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsWALSourceImpl { @Test diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactoryImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactoryImpl.java index d370b17a489..abbd49fb509 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactoryImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactoryImpl.java @@ -18,10 +18,14 @@ package org.apache.hadoop.hbase.replication.regionserver; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.*; +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsReplicationSourceFactoryImpl { diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceImpl.java index bd7f3dde4e1..acbadbe602d 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceImpl.java @@ -21,10 +21,14 @@ package org.apache.hadoop.hbase.replication.regionserver; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationSource; import org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationSourceImpl; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertTrue; +@Category({MetricsTests.class, SmallTests.class}) /** Test for MetricsReplicationSourceImpl */ public class TestMetricsReplicationSourceImpl { diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSourceImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSourceImpl.java index 5f4e70baf1a..8069388f1de 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSourceImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSourceImpl.java @@ -21,7 +21,10 @@ package org.apache.hadoop.hbase.rest; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.rest.MetricsRESTSource; import org.apache.hadoop.hbase.rest.MetricsRESTSourceImpl; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -29,6 +32,7 @@ import static org.junit.Assert.assertTrue; /** * Test for hadoop 2's version of MetricsRESTSource */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsRESTSourceImpl { @Test diff --git a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactoryImpl.java b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactoryImpl.java index c9eda58d9ea..c3a32b9f4f0 100644 --- a/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactoryImpl.java +++ b/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactoryImpl.java @@ -19,9 +19,12 @@ package org.apache.hadoop.hbase.thrift; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.apache.hadoop.hbase.testclassification.MetricsTests; import org.apache.hadoop.hbase.thrift.MetricsThriftServerSourceFactory; import org.apache.hadoop.hbase.thrift.MetricsThriftServerSourceFactoryImpl; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; @@ -30,6 +33,7 @@ import static org.junit.Assert.assertTrue; /** * Test for hadoop 2's version of MetricsThriftServerSourceFactory */ +@Category({MetricsTests.class, SmallTests.class}) public class TestMetricsThriftServerSourceFactoryImpl { @Test