From f22c7a65837fe0274dde4f3d009e75a6281c5d87 Mon Sep 17 00:00:00 2001 From: Sandeep Pal <50725353+sandeepvinayak@users.noreply.github.com> Date: Sat, 20 Jun 2020 22:38:15 +0530 Subject: [PATCH] HBASE-23126: Removing the un-used integration test class - IntegrationTestRSGroup Closes #1936 Signed-off-by: Duo Zhang Signed-off-by: Jan Hentschel Signed-off-by: Viraj Jasani --- .../hbase/rsgroup/IntegrationTestRSGroup.java | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 hbase-it/src/test/java/org/apache/hadoop/hbase/rsgroup/IntegrationTestRSGroup.java diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/rsgroup/IntegrationTestRSGroup.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/rsgroup/IntegrationTestRSGroup.java deleted file mode 100644 index f40440253f8d..000000000000 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/rsgroup/IntegrationTestRSGroup.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright The Apache Software Foundation - * - * 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.hadoop.hbase.rsgroup; - -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.IntegrationTestingUtility; -import org.apache.hadoop.hbase.Waiter; -import org.apache.hadoop.hbase.testclassification.IntegrationTests; -import org.junit.After; -import org.junit.Before; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Runs all of the units tests defined in TestGroupBase as an integration test. - * Requires TestRSGroupBase.NUM_SLAVE_BASE servers to run. - */ -@Category(IntegrationTests.class) -public class IntegrationTestRSGroup extends TestRSGroupsBase { - private final static Logger LOG = LoggerFactory.getLogger(IntegrationTestRSGroup.class); - private static boolean initialized = false; - - @Before - public void beforeMethod() throws Exception { - if (!initialized) { - LOG.info("Setting up IntegrationTestRSGroup"); - LOG.info("Initializing cluster with " + NUM_SLAVES_BASE + " servers"); - TEST_UTIL = new IntegrationTestingUtility(); - TEST_UTIL.getConfiguration().set(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, - RSGroupBasedLoadBalancer.class.getName()); - RSGroupUtil.enableRSGroup(TEST_UTIL.getConfiguration()); - ((IntegrationTestingUtility) TEST_UTIL).initializeCluster(NUM_SLAVES_BASE); - // set shared configs - ADMIN = TEST_UTIL.getAdmin(); - CLUSTER = TEST_UTIL.getHBaseClusterInterface(); - LOG.info("Done initializing cluster"); - initialized = true; - // cluster may not be clean - // cleanup when initializing - afterMethod(); - } - } - - @After - public void afterMethod() throws Exception { - LOG.info("Cleaning up previous test run"); - //cleanup previous artifacts - deleteTableIfNecessary(); - deleteNamespaceIfNecessary(); - deleteGroups(); - ADMIN.balancerSwitch(true, true); - - LOG.info("Restoring the cluster"); - ((IntegrationTestingUtility)TEST_UTIL).restoreCluster(); - LOG.info("Done restoring the cluster"); - - TEST_UTIL.waitFor(WAIT_TIMEOUT, new Waiter.Predicate() { - @Override - public boolean evaluate() throws Exception { - LOG.info("Waiting for cleanup to finish "+ ADMIN.listRSGroups()); - //Might be greater since moving servers back to default - //is after starting a server - return ADMIN.getRSGroup(RSGroupInfo.DEFAULT_GROUP).getServers().size() - >= NUM_SLAVES_BASE; - } - }); - - TEST_UTIL.waitFor(WAIT_TIMEOUT, new Waiter.Predicate() { - @Override - public boolean evaluate() throws Exception { - LOG.info("Waiting for regionservers to be registered "+ ADMIN.listRSGroups()); - //Might be greater since moving servers back to default - //is after starting a server - return ADMIN.getRSGroup(RSGroupInfo.DEFAULT_GROUP).getServers().size() - == getNumServers(); - } - }); - - LOG.info("Done cleaning up previous test run"); - } -}