Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-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 219421160C for ; Thu, 12 Jun 2014 00:21:46 +0000 (UTC) Received: (qmail 86020 invoked by uid 500); 12 Jun 2014 00:21:45 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 85974 invoked by uid 500); 12 Jun 2014 00:21:45 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 85964 invoked by uid 99); 12 Jun 2014 00:21:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2014 00:21:45 +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 mdrob@cloudera.com designates 209.85.219.42 as permitted sender) Received: from [209.85.219.42] (HELO mail-oa0-f42.google.com) (209.85.219.42) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2014 00:21:41 +0000 Received: by mail-oa0-f42.google.com with SMTP id eb12so577093oac.15 for ; Wed, 11 Jun 2014 17:21:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=/IkkkdFCPfWRi1B7LTXmpHSY0iJvFTzL0g/hOePCg3g=; b=UtoRHImGyFn28bSRSep7EjV0mqTaOngGlkyNc0NYIAHMAvfF4xLePMki1rDQnmYK1X t5GJmUKKIN/W4UHzdv/N8lsNbZv++2fPSHHquXzazW7Aj1msRGkEbKQ2C1bgApCA2H38 20ZhkY033l1Zmb03Xw3kWQmtgwFn/WryIEsQZj3KdtWn+BagfIH2XmY0ydJl4P/A8ZCY nX0QhkkvofE6IfSFbMqeqODz5YeuTASrbl3+ttYMSEN+W4iPphF0AUmzYVmtnrhQhNJr yEHkkqsFGVvss8F0TWM2+BIQM3noXmPXGPVIGc7xRAj5IJsxTcAQ7KxwVdZ+I7n6RbYE NtkA== X-Gm-Message-State: ALoCoQnOfxkVMb2sWDtshwq5RE2ZZn2HjDON/9PKVNHtCE7JmEQusoRhb1xfubN4QXwEB6m+fvO1 X-Received: by 10.182.144.161 with SMTP id sn1mr66735obb.82.1402532481133; Wed, 11 Jun 2014 17:21:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.145.43 with HTTP; Wed, 11 Jun 2014 17:21:01 -0700 (PDT) In-Reply-To: References: From: Mike Drob Date: Wed, 11 Jun 2014 20:21:01 -0400 Message-ID: Subject: Re: Using ZooCache in unit tests To: Accumulo Dev List Content-Type: multipart/alternative; boundary=089e0158ac785306dc04fb988a3f X-Virus-Checked: Checked by ClamAV on apache.org --089e0158ac785306dc04fb988a3f Content-Type: text/plain; charset=UTF-8 I tried passing a MockInstance and a mock(Instance.class) higher in the call chain, but it still tried to pull information out of them to make the call. Explicitly mocking that call might work, but I thought there was some issue with PowerMock and Java 7 that existed when mocking static methods? Oh, also that call is private, so I'd have to mock everything that uses it. I'll look into that soon. On Wed, Jun 11, 2014 at 8:16 PM, William Slacum < wilhelm.von.cloud@accumulo.net> wrote: > What about mocking that call? > > > On Wed, Jun 11, 2014 at 8:09 PM, Mike Drob wrote: > > > When writing unit tests, I indirectly call code that invokes > > {{Tables.getZooCache(Instance)}} which sets up a connection to a > zookeeper. > > However, there is not a server running, so this end up looping forever > > until my test times out. > > > > It looks like my options are... > > 1) Make it an IT that uses MAC, so that there is a ZK to connect to > > (probably overkill) > > 2) Stand up my own ZK (error prone? duplicative?) > > 3) Stand up a Curator Testing Server (introduces new dependencies). > > 4) Not write tests. > > > > I'm leaning toward number 3, but was wondering if anybody had thoughts on > > this, since I feel like that will have a lasting impact on the code. > > > --089e0158ac785306dc04fb988a3f--