From 6b656528130d2822f73d773a7475e5f5ee2a073a Mon Sep 17 00:00:00 2001 From: Guangxu Cheng Date: Thu, 16 Nov 2017 11:57:15 +0800 Subject: [PATCH] HBASE-19269 Reenable TestShellRSGroups --- .../hbase/client/rsgroup/TestShellRSGroups.java | 1 - .../src/test/ruby/shell/rsgroup_shell_test.rb | 22 ++++++++-------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java b/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java index 8e9c60c95e..37ed0da69a 100644 --- a/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java +++ b/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java @@ -44,7 +44,6 @@ import java.util.List; //Separate Shell test class for Groups //Since we need to use a different balancer and run more than 1 RS @Category({ClientTests.class, LargeTests.class}) -@Ignore public class TestShellRSGroups { final Log LOG = LogFactory.getLog(getClass()); private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); diff --git a/hbase-shell/src/test/ruby/shell/rsgroup_shell_test.rb b/hbase-shell/src/test/ruby/shell/rsgroup_shell_test.rb index b7cfb85f26..329a7b3206 100644 --- a/hbase-shell/src/test/ruby/shell/rsgroup_shell_test.rb +++ b/hbase-shell/src/test/ruby/shell/rsgroup_shell_test.rb @@ -50,7 +50,7 @@ module Hbase hostport = @rsgroup_admin.getRSGroupInfo('default').getServers.iterator.next @shell.command('get_rsgroup', 'default') hostPortStr = hostport.toString - @shell.command('get_server_rsgroup', [hostPortStr]) + @shell.command('get_server_rsgroup', hostPortStr) @shell.command('move_servers_rsgroup', group_name, [hostPortStr]) @@ -62,20 +62,14 @@ module Hbase [table_name]) assert_equal(1, @rsgroup_admin.getRSGroupInfo(group_name).getTables.count) - count = 0 - @hbase.rsgroup_admin().get_rsgroup(group_name) do |line| - case count - when 1 - assert_equal(hostPortStr, line) - when 3 - assert_equal(table_name, line) - end - count += 1 - end - assert_equal(4, count) + group = @hbase.rsgroup_admin().get_rsgroup(group_name) + assert_not_nil(group) + assert_equal(1, group.getServers.count) + assert_equal(1, group.getTables.count) + assert_equal(hostPortStr, group.getServers.iterator.next.toString) + assert_equal(table_name, group.getTables.iterator.next.toString) - assert_equal(2, - @hbase.rsgroup_admin().list_rs_groups.count) + assert_equal(2, @hbase.rsgroup_admin().list_rs_groups.count) # just run it to verify jruby->java api binding @hbase.rsgroup_admin().balance_rs_group(group_name) -- 2.13.0