Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E33F11C0A for ; Wed, 16 Apr 2014 17:31:42 +0000 (UTC) Received: (qmail 52877 invoked by uid 500); 16 Apr 2014 17:31:37 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 52795 invoked by uid 500); 16 Apr 2014 17:31:35 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 52704 invoked by uid 99); 16 Apr 2014 17:31:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Apr 2014 17:31:24 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yuzhihong@gmail.com designates 209.85.213.54 as permitted sender) Received: from [209.85.213.54] (HELO mail-yh0-f54.google.com) (209.85.213.54) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Apr 2014 17:31:19 +0000 Received: by mail-yh0-f54.google.com with SMTP id f73so11068403yha.41 for ; Wed, 16 Apr 2014 10:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=7VNsSOz6K+18TmfERSEzQ/O9o/5MUwl1q4H4F4CVueE=; b=GkaNapq5G7Cce8g4sku7xp2PthLVsUGkRkfBcOV+fX69P599BQmfDNqUVa4Dh51AQn itgUjcU+6gYIAy9dxxL8WDqZ0+QviMd9gz81CS+Q3SN+KwUFhbzeTjrPX5Oz5knOs2r6 qekznh0bgh3z7arc5jDkqDxEXEMBQgFIwG35maIv4YEUAl7oQhWtX2jAFb0tGZRqGnq0 lwELFx/1+WFklGyaE5dDXO1lX+tm24xn6Kc+KpC59N0chvQAE0rHeRm86k1AMadbhmcm 7sxZBEPGROuBSx8rfrkh/RNISWyfpKydyuVLFsFLYjUgfN32kFsHJ6P/1r8nfWB1+3AE sMyw== MIME-Version: 1.0 X-Received: by 10.236.14.196 with SMTP id d44mr14505843yhd.91.1397669458947; Wed, 16 Apr 2014 10:30:58 -0700 (PDT) Received: by 10.170.79.130 with HTTP; Wed, 16 Apr 2014 10:30:58 -0700 (PDT) In-Reply-To: References: Date: Wed, 16 Apr 2014 10:30:58 -0700 Message-ID: Subject: Re: Question about Writing Unit Tests for JIRA 10950 From: Ted Yu To: "dev@hbase.apache.org" Content-Type: multipart/alternative; boundary=089e013a149e9d62e904f72c477b X-Virus-Checked: Checked by ClamAV on apache.org --089e013a149e9d62e904f72c477b Content-Type: text/plain; charset=UTF-8 There is no patch posted so I don't know what classes you're modifying. If the changes are mostly in hbase-client module, the test(s) should be in the same module. w.r.t. Configuration, you can obtain it using the following code where TEST_UTIL is an instance of HBaseTestingUtility: Configuration conf = TEST_UTIL.getConfiguration(); Refer to existing tests such as TestFromClientSide Cheers On Wed, Apr 16, 2014 at 10:22 AM, Enoch Hsu wrote: > > Hi All, > > I am looking into JIRA 10950 and I have a couple questions about writing > unit tests for the patch. > Where should the unit tests go in terms of module and package location? > e.g. hbase-server, hbase-client, etc > > Another thing I observed while trying to write unit tests is that > HBaseTestingUtility has its own configuration files > that are used once the minicluster is started, and, unless I pass the > minicluster's configuration file to my code, > any new Configuration() calls will not get the same configuration as the > minicluster. > Is there any way to get HBaseTestingUtility and HBaseConfiguration.create() > to interact with each other without passing the conf object around? > Or is there another way I should be going about writing unit tests for > this? > > Thanks, > Enoch Hsu --089e013a149e9d62e904f72c477b--