Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix tests to run with run_tests.sh script

  • Loading branch information...
commit 773aa8b388ce4e992adc05c80f510b4ce0e076ac 1 parent 6a74350
@mudphone authored
View
5 README.md
@@ -245,9 +245,8 @@ Enjoy!
# TODO (in rough order of precedence):
- Make this a comprehensive replacement for the HBase shell.
- Implement:
- "regions-for-table"
- "diable-drop-table-if-exists"
- "close_region"
+ * regions-for-table
+ * close all regions for a table (if this is a good idea)
- Complete test coverage of full public API.
- Remove hard-coded (ooops) output / input file paths for table dump files.
- Instructions for clojure-test minor mode to run tests.
View
7 src/hbase_runner/hbase/region.clj
@@ -1,9 +1,12 @@
(ns hbase-runner.hbase.region
(:import [org.apache.hadoop.hbase HConstants HRegionInfo])
+ (:import [org.apache.hadoop.hbase.client HTable])
(:import [org.apache.hadoop.hbase.util Writables])
(:use hbase-runner.hbase.get)
- (:use hbase-runner.hbase.put)
- (:use hbase-runner.hbase-repl))
+ (:use hbase-runner.hbase.put))
+
+(defn meta-table []
+ (HTable. HConstants/META_TABLE_NAME))
(defn online [region-name set-offline]
(let [meta (meta-table)
View
3  src/hbase_runner/hbase_repl.clj
@@ -183,9 +183,6 @@
(defn describe [table-name]
(.toString (.getTableDescriptor *HBaseAdmin* (.getBytes table-name))))
-(defn meta-table []
- (HTable. HConstants/META_TABLE_NAME))
-
(defn close-region [region-name]
(.closeRegion *HBaseAdmin* (.getBytes region-name)))
View
2  src/hbase_runner/utils/create.clj
@@ -27,7 +27,7 @@
(defn dump-table-to-ruby [output-dir htable]
(let [file (str output-dir "/tables.rb")]
(spit file (str (.getTableDescriptor htable)))))
-
+
(defn dump-tables-to-ruby [output-dir table-names]
(map #(dump-table-to-ruby output-dir %) table-names))
View
11 test/hbase_runner/hbase_repl_spec.clj
@@ -3,7 +3,8 @@
(:use [clojure.test :only [run-tests deftest is]])
(:use hbase-runner.spec-helper)
(:use hbase-runner.hbase-repl)
- (:use hbase-runner.utils.config))
+ (:use hbase-runner.utils.config)
+ (:use hbase-runner.utils.file))
(deftest current-table-ns-test
(is (= "hbr_spec" (current-table-ns))))
@@ -20,10 +21,10 @@
(with-test-tables [table-name]
(create-table-if-does-not-exist table-name)
(is (table-enabled? table-name))
-
+
(disable-table table-name)
(is (table-disabled? table-name))
-
+
(enable-table table-name)
(is (table-enabled? table-name)))))
@@ -47,5 +48,7 @@
(with-test-tables [test-table]
(with-cleared-file test-file-path
(dump-tables [test-table] test-file-name)
- (is (= "hbr_spec_t1" (:name (first (hydrate-table-maps-from test-file-name))))))
+ (is (= "hbr_spec_t1" (:name
+ (first
+ (read-clojure-lines-from test-file-path))))))
)))
View
6 utils/spec_suite.clj
@@ -1,9 +1,9 @@
-(ns hbase-runner.all-hbase-repl-spec
- (:use [clojure.test :only [run-tests deftest is]])
+(ns hbase-runner.spec-suite
+ (:use [clojure.test :only [run-all-tests run-tests deftest is]])
(:use hbase-runner.hbase-repl)
(:use hbase-runner.spec-helper)
(:use hbase-runner.hbase-repl-spec))
(start-hbase-repl :test "hbr_spec")
-(run-tests)
+(run-all-tests #".*-spec")
Please sign in to comment.
Something went wrong with that request. Please try again.