HBASE-15418 Clean up un-used warning in test util

Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a66896f1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a66896f1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a66896f1

Branch: refs/heads/HBASE-14850
Commit: a66896f1929f053345a866a460cc6e68493beb74
Parents: 639f5a3
Author: Elliott Clark <ecl...@apache.org>
Authored: Fri Mar 25 15:44:06 2016 -0700
Committer: Elliott Clark <elli...@fb.com>
Committed: Tue May 17 15:02:24 2016 -0700

----------------------------------------------------------------------
 .../bin/start_local_hbase_and_wait.sh           |  9 +++++-
 .../bin/stop_local_hbase_and_wait.sh            |  2 +-
 hbase-native-client/core/BUCK                   |  6 ----
 .../core/native-client-test-env.cc              |  9 ++++--
 hbase-native-client/core/test_env.h             | 32 --------------------
 5 files changed, 15 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a66896f1/hbase-native-client/bin/start_local_hbase_and_wait.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/start_local_hbase_and_wait.sh 
b/hbase-native-client/bin/start_local_hbase_and_wait.sh
index 64d0b68..cfc71f9 100755
--- a/hbase-native-client/bin/start_local_hbase_and_wait.sh
+++ b/hbase-native-client/bin/start_local_hbase_and_wait.sh
@@ -17,10 +17,17 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# Clean up from any other tests.
+rm -rf /tmp/hbase-*
+
+# Start the master/regionservers.
 $PWD/../bin/start-hbase.sh
 
-until [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == 
"200" ]
+until [ $(curl -s -o /dev/null -I -w "%{http_code}" 
http://localhost:16010/jmx) == "200" ]
 do
      printf "Waiting for local HBase cluster to start\n"
      sleep 1
 done
+
+# This sucks, but master can easily be up and meta not be assigned yet.
+sleep 30

http://git-wip-us.apache.org/repos/asf/hbase/blob/a66896f1/hbase-native-client/bin/stop_local_hbase_and_wait.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/stop_local_hbase_and_wait.sh 
b/hbase-native-client/bin/stop_local_hbase_and_wait.sh
index 4e89334..761412a 100755
--- a/hbase-native-client/bin/stop_local_hbase_and_wait.sh
+++ b/hbase-native-client/bin/stop_local_hbase_and_wait.sh
@@ -17,7 +17,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-$PWD/../bin/stop-hbase.sh
+ps aux | grep proc_master | awk '{print $2}' | xargs kill -9
 
 while [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == 
"200" ]
 do

http://git-wip-us.apache.org/repos/asf/hbase/blob/a66896f1/hbase-native-client/core/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index 817b5a0..d1e89d1 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -51,9 +51,6 @@ cxx_library(name="core",
             ], )
 
 cxx_test(name="simple-test",
-         headers=[
-             "test_env.h",
-         ],
          srcs=[
              "native-client-test-env.cc",
              "simple-native-client-test.cc",
@@ -63,9 +60,6 @@ cxx_test(name="simple-test",
          ],
          run_test_separately=True, )
 cxx_test(name="location-cache-test",
-         headers=[
-             "test_env.h",
-         ],
          srcs=[
              "native-client-test-env.cc",
              "location-cache-test.cc",

http://git-wip-us.apache.org/repos/asf/hbase/blob/a66896f1/hbase-native-client/core/native-client-test-env.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/native-client-test-env.cc 
b/hbase-native-client/core/native-client-test-env.cc
index a86961f..07f30a6 100644
--- a/hbase-native-client/core/native-client-test-env.cc
+++ b/hbase-native-client/core/native-client-test-env.cc
@@ -18,18 +18,21 @@
  */
 
 #include <gtest/gtest.h>
-#include <core/test_env.h>
 
 namespace {
 
 class NativeClientTestEnv : public ::testing::Environment {
  public:
   void SetUp() override {
-    init_test_env();
+    // start local HBase cluster to be reused by all tests
+    auto result = system("bin/start_local_hbase_and_wait.sh");
+    ASSERT_EQ(0, result);
   }
 
   void TearDown() override {
-    clean_test_env();
+    // shutdown local HBase cluster
+    auto result = system("bin/stop_local_hbase_and_wait.sh");
+    ASSERT_EQ(0, result);
   }
 };
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/a66896f1/hbase-native-client/core/test_env.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/test_env.h 
b/hbase-native-client/core/test_env.h
deleted file mode 100644
index 79bdbec..0000000
--- a/hbase-native-client/core/test_env.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#pragma once
-
-#include <cstdlib>
-
-inline void init_test_env() {
-  // start local HBase cluster to be reused by all tests
-  system("scripts/start_local_hbase_and_wait.sh");
-}
-
-inline void clean_test_env() {
-  // shutdown local HBase cluster
-  system("scripts/stop_local_hbase_and_wait.sh");
-}

Reply via email to