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

Conflicts:
	hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceImpl.java
This commit is contained in:
Sean Busbey 2015-09-29 20:09:48 -05:00 committed by Sean Busbey
parent 5b3579c327
commit 436bd5e823
19 changed files with 102 additions and 0 deletions

View File

@ -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 {
}

View File

@ -107,6 +107,12 @@
</build>
<dependencies>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-annotations</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- General dependencies -->
<dependency>
<groupId>commons-logging</groupId>

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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 {

View File

@ -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 {

View File

@ -150,6 +150,12 @@ limitations under the License.
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-annotations</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-hadoop-compat</artifactId>

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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