HBASE-19269 Reenable TestShellRSGroups

Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
Guangxu Cheng 2017-11-16 16:33:58 +08:00 committed by Michael Stack
parent 63b02a072a
commit 3330dd517e
No known key found for this signature in database
GPG Key ID: 9816C7FC8ACC93D2
2 changed files with 9 additions and 17 deletions

View File

@ -33,7 +33,6 @@ import org.jruby.embed.PathType;
import org.jruby.embed.ScriptingContainer; import org.jruby.embed.ScriptingContainer;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.experimental.categories.Category; import org.junit.experimental.categories.Category;
@ -44,7 +43,6 @@ import java.util.List;
//Separate Shell test class for Groups //Separate Shell test class for Groups
//Since we need to use a different balancer and run more than 1 RS //Since we need to use a different balancer and run more than 1 RS
@Category({ClientTests.class, LargeTests.class}) @Category({ClientTests.class, LargeTests.class})
@Ignore
public class TestShellRSGroups { public class TestShellRSGroups {
final Log LOG = LogFactory.getLog(getClass()); final Log LOG = LogFactory.getLog(getClass());
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();

View File

@ -50,7 +50,7 @@ module Hbase
hostport = @rsgroup_admin.getRSGroupInfo('default').getServers.iterator.next hostport = @rsgroup_admin.getRSGroupInfo('default').getServers.iterator.next
@shell.command('get_rsgroup', 'default') @shell.command('get_rsgroup', 'default')
hostPortStr = hostport.toString hostPortStr = hostport.toString
@shell.command('get_server_rsgroup', [hostPortStr]) @shell.command('get_server_rsgroup', hostPortStr)
@shell.command('move_servers_rsgroup', @shell.command('move_servers_rsgroup',
group_name, group_name,
[hostPortStr]) [hostPortStr])
@ -62,23 +62,17 @@ module Hbase
[table_name]) [table_name])
assert_equal(1, @rsgroup_admin.getRSGroupInfo(group_name).getTables.count) assert_equal(1, @rsgroup_admin.getRSGroupInfo(group_name).getTables.count)
count = 0 group = @hbase.rsgroup_admin.get_rsgroup(group_name)
@hbase.rsgroup_admin().get_rsgroup(group_name) do |line| assert_not_nil(group)
case count assert_equal(1, group.getServers.count)
when 1 assert_equal(1, group.getTables.count)
assert_equal(hostPortStr, line) assert_equal(hostPortStr, group.getServers.iterator.next.toString)
when 3 assert_equal(table_name, group.getTables.iterator.next.toString)
assert_equal(table_name, line)
end
count += 1
end
assert_equal(4, count)
assert_equal(2, assert_equal(2, @hbase.rsgroup_admin.list_rs_groups.count)
@hbase.rsgroup_admin().list_rs_groups.count)
# just run it to verify jruby->java api binding # just run it to verify jruby->java api binding
@hbase.rsgroup_admin().balance_rs_group(group_name) @hbase.rsgroup_admin.balance_rs_group(group_name)
end end
# we test exceptions that could be thrown by the ruby wrappers # we test exceptions that could be thrown by the ruby wrappers