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:13 UTC

[3/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/6e0c6271
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6e0c6271
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6e0c6271

Branch: refs/heads/branch-2.1
Commit: 6e0c6271f6ee955e2f3aa8e2cd29d037ef43b962
Parents: e335915
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:19 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/6e0c6271/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 9a79658..ce99d22 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/6e0c6271/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