Skip to content

Commit a545d71

Browse files
committed
HBASE-14516 categorize hadoop-compat tests
* make sure the test classifications are in test scope for their use in the hadoop-compat modules * added a test category for 'metrics related' since that's what all these tests are for * categorized tests as small,metrics
1 parent 3b8039e commit a545d71

19 files changed

Lines changed: 102 additions & 0 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/**
20+
* Tag a test that covers our metrics handling
21+
*/
22+
package org.apache.hadoop.hbase.testclassification;
23+
24+
public interface MetricsTests {
25+
}

hbase-hadoop-compat/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@
107107
</build>
108108

109109
<dependencies>
110+
<dependency>
111+
<groupId>org.apache.hbase</groupId>
112+
<artifactId>hbase-annotations</artifactId>
113+
<type>test-jar</type>
114+
<scope>test</scope>
115+
</dependency>
110116
<!-- General dependencies -->
111117
<dependency>
112118
<groupId>commons-logging</groupId>

hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/TestCompatibilitySingletonFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@
2626
import java.util.concurrent.Executors;
2727
import java.util.concurrent.Future;
2828

29+
import org.apache.hadoop.hbase.testclassification.SmallTests;
30+
import org.apache.hadoop.hbase.testclassification.MetricsTests;
31+
2932
import org.junit.Test;
33+
import org.junit.experimental.categories.Category;
3034

3135
import static org.junit.Assert.assertEquals;
3236
import static org.junit.Assert.assertNotEquals;
3337

38+
@Category({MetricsTests.class, SmallTests.class})
3439
public class TestCompatibilitySingletonFactory {
3540

3641
private static final int ITERATIONS = 100000;

hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020

2121
import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
2222
import org.apache.hadoop.hbase.master.MetricsMasterSource;
23+
import org.apache.hadoop.hbase.testclassification.SmallTests;
24+
import org.apache.hadoop.hbase.testclassification.MetricsTests;
2325
import org.junit.Test;
26+
import org.junit.experimental.categories.Category;
2427

2528
/**
2629
* Test for the CompatibilitySingletonFactory and building MetricsMasterSource
2730
*/
31+
@Category({MetricsTests.class, SmallTests.class})
2832
public class TestMetricsMasterSourceFactory {
2933

3034
@Test(expected=RuntimeException.class)

hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020

2121
import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
2222
import org.apache.hadoop.hbase.regionserver.MetricsRegionServerSourceFactory;
23+
import org.apache.hadoop.hbase.testclassification.SmallTests;
24+
import org.apache.hadoop.hbase.testclassification.MetricsTests;
2325
import org.junit.Test;
26+
import org.junit.experimental.categories.Category;
2427

2528
/**
2629
* Test for the CompatibilitySingletonFactory and building MetricsRegionServerSource
2730
*/
31+
@Category({MetricsTests.class, SmallTests.class})
2832
public class TestMetricsRegionServerSourceFactory {
2933

3034
@Test(expected=RuntimeException.class)

hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestMetricsWALSource.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919
package org.apache.hadoop.hbase.regionserver.wal;
2020

2121
import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
22+
import org.apache.hadoop.hbase.testclassification.SmallTests;
23+
import org.apache.hadoop.hbase.testclassification.MetricsTests;
2224
import org.junit.Test;
25+
import org.junit.experimental.categories.Category;
2326

27+
@Category({MetricsTests.class, SmallTests.class})
2428
public class TestMetricsWALSource {
2529

2630
@Test(expected=RuntimeException.class)

hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020

2121
import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
2222
import org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationSource;
23+
import org.apache.hadoop.hbase.testclassification.SmallTests;
24+
import org.apache.hadoop.hbase.testclassification.MetricsTests;
2325
import org.junit.Test;
26+
import org.junit.experimental.categories.Category;
2427

2528
/**
2629
* Test for the CompatibilitySingletonFactory and building MetricsReplicationSource
2730
*/
31+
@Category({MetricsTests.class, SmallTests.class})
2832
public class TestMetricsReplicationSourceFactory {
2933

3034
@Test(expected=RuntimeException.class)

hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020

2121
import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
2222
import org.apache.hadoop.hbase.rest.MetricsRESTSource;
23+
import org.apache.hadoop.hbase.testclassification.SmallTests;
24+
import org.apache.hadoop.hbase.testclassification.MetricsTests;
2325
import org.junit.Test;
26+
import org.junit.experimental.categories.Category;
2427

2528
/**
2629
* Test of Rest Metrics Source interface.
2730
*/
31+
@Category({MetricsTests.class, SmallTests.class})
2832
public class TestMetricsRESTSource {
2933

3034

hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
package org.apache.hadoop.hbase.thrift;
2020

2121
import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
22+
import org.apache.hadoop.hbase.testclassification.SmallTests;
23+
import org.apache.hadoop.hbase.testclassification.MetricsTests;
2224
import org.apache.hadoop.hbase.thrift.MetricsThriftServerSourceFactory;
2325
import org.junit.Test;
26+
import org.junit.experimental.categories.Category;
2427

2528
/**
2629
* Test for the interface of MetricsThriftServerSourceFactory
2730
*/
31+
@Category({MetricsTests.class, SmallTests.class})
2832
public class TestMetricsThriftServerSourceFactory {
2933

3034

hbase-hadoop2-compat/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ limitations under the License.
150150
</exclusion>
151151
</exclusions>
152152
</dependency>
153+
<dependency>
154+
<groupId>org.apache.hbase</groupId>
155+
<artifactId>hbase-annotations</artifactId>
156+
<type>test-jar</type>
157+
<scope>test</scope>
158+
</dependency>
153159
<dependency>
154160
<groupId>org.apache.hbase</groupId>
155161
<artifactId>hbase-hadoop-compat</artifactId>

0 commit comments

Comments
 (0)