You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by md...@apache.org on 2018/08/31 17:20:12 UTC
[2/4] hbase git commit: HBASE-20482 Printed a link to the ref guide
chapter for the shell during startup
HBASE-20482 Printed a link to the ref guide chapter for the shell during startup
Signed-off-by: Mike Drob <md...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1cc62e92
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1cc62e92
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1cc62e92
Branch: refs/heads/branch-2
Commit: 1cc62e9286f59fe50d232d40386510f3045d601e
Parents: cf59f2a
Author: Sakthi <ja...@cloudera.com>
Authored: Fri Apr 27 15:57:15 2018 -0700
Committer: Mike Drob <md...@apache.org>
Committed: Fri Aug 31 12:13:00 2018 -0500
----------------------------------------------------------------------
hbase-shell/src/main/ruby/shell.rb | 1 +
hbase-shell/src/test/ruby/shell/shell_test.rb | 14 +++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/1cc62e92/hbase-shell/src/main/ruby/shell.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb
index 2c63ed6..dfbf807 100644
--- a/hbase-shell/src/main/ruby/shell.rb
+++ b/hbase-shell/src/main/ruby/shell.rb
@@ -152,6 +152,7 @@ module Shell
puts 'HBase Shell'
puts 'Use "help" to get list of supported commands.'
puts 'Use "exit" to quit this interactive shell.'
+ puts 'For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell'
print 'Version '
command('version')
puts
http://git-wip-us.apache.org/repos/asf/hbase/blob/1cc62e92/hbase-shell/src/test/ruby/shell/shell_test.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/shell/shell_test.rb b/hbase-shell/src/test/ruby/shell/shell_test.rb
index ab150a5..c1e9017 100644
--- a/hbase-shell/src/test/ruby/shell/shell_test.rb
+++ b/hbase-shell/src/test/ruby/shell/shell_test.rb
@@ -21,6 +21,8 @@ require 'hbase_constants'
require 'shell'
class ShellTest < Test::Unit::TestCase
+ include Hbase::TestHelpers
+
def setup
@hbase = ::Hbase::Hbase.new($TEST_CLUSTER.getConfiguration)
@shell = Shell::Shell.new(@hbase)
@@ -69,7 +71,17 @@ class ShellTest < Test::Unit::TestCase
@shell.command('version')
end
- #-------------------------------------------------------------------------------
+ #-----------------------------------------------------------------------------
+
+ define_test 'Shell::Shell#print_banner should display Reference Guide link' do
+ @shell.interactive = true
+ output = capture_stdout { @shell.print_banner }
+ @shell.interactive = false
+ link_regex = %r{For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell}
+ assert_match(link_regex, output)
+ end
+
+ #-----------------------------------------------------------------------------
define_test "Shell::Shell interactive mode should not throw" do
# incorrect number of arguments