You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/04/04 06:06:22 UTC
svn commit: r1464284 -
/hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb
Author: stack
Date: Thu Apr 4 04:06:22 2013
New Revision: 1464284
URL: http://svn.apache.org/r1464284
Log:
HBASE-8231 delete tests in table_tests.rb(TestShell) always running on empty table
Modified:
hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb
Modified: hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb?rev=1464284&r1=1464283&r2=1464284&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb (original)
+++ hbase/branches/0.95/hbase-server/src/test/ruby/hbase/table_test.rb Thu Apr 4 04:06:22 2013
@@ -101,6 +101,22 @@ module Hbase
@test_name = "hbase_shell_tests_table"
create_test_table(@test_name)
@test_table = table(@test_name)
+
+ # Insert data to perform delete operations
+ @test_table.put("101", "x:a", "1")
+ @test_table.put("101", "x:a", "2", Time.now.to_i)
+
+ @test_table.put("102", "x:a", "1",1212)
+ @test_table.put("102", "x:a", "2", 1213)
+
+ @test_table.put(103, "x:a", "3")
+ @test_table.put(103, "x:a", "4")
+
+ @test_table.put("104", "x:a", 5)
+ @test_table.put("104", "x:b", 6)
+
+ @test_table.put(105, "x:a", "3")
+ @test_table.put(105, "x:a", "4")
end
define_test "put should work without timestamp" do
@@ -122,25 +138,35 @@ module Hbase
#-------------------------------------------------------------------------------
define_test "delete should work without timestamp" do
- @test_table.delete("123", "x:a")
+ @test_table.delete("101", "x:a")
+ res = @test_table._get_internal('101', 'x:a')
+ assert_nil(res)
end
define_test "delete should work with timestamp" do
- @test_table.delete("123", "x:a", Time.now.to_i)
+ @test_table.delete("102", "x:a", 1214)
+ res = @test_table._get_internal('102', 'x:a')
+ assert_nil(res)
end
define_test "delete should work with integer keys" do
- @test_table.delete(123, "x:a")
+ @test_table.delete(103, "x:a")
+ res = @test_table._get_internal('103', 'x:a')
+ assert_nil(res)
end
#-------------------------------------------------------------------------------
define_test "deleteall should work w/o columns and timestamps" do
- @test_table.deleteall("123")
+ @test_table.deleteall("104")
+ res = @test_table._get_internal('104', 'x:a', 'x:b')
+ assert_nil(res)
end
define_test "deleteall should work with integer keys" do
- @test_table.deleteall(123)
+ @test_table.deleteall(105)
+ res = @test_table._get_internal('105', 'x:a')
+ assert_nil(res)
end
#-------------------------------------------------------------------------------