From commits-return-22423-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Wed Dec 19 02:50:00 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id A4931180669 for ; Wed, 19 Dec 2018 02:49:59 +0100 (CET) Received: (qmail 34804 invoked by uid 500); 19 Dec 2018 01:49:58 -0000 Mailing-List: contact commits-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 commits@accumulo.apache.org Received: (qmail 34794 invoked by uid 99); 19 Dec 2018 01:49:58 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2018 01:49:58 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id C382B85286; Wed, 19 Dec 2018 01:49:57 +0000 (UTC) Date: Wed, 19 Dec 2018 01:49:57 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo] branch master updated: Fix Replication test failure from #833 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <154518419768.7198.334356652101353824@gitbox.apache.org> From: ctubbsii@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: e56f2d35653e3b5bc1e7366153f26f76e4045df3 X-Git-Newrev: 826f9f2004b1ccfe878065e3ecc02cdf2b4f8f98 X-Git-Rev: 826f9f2004b1ccfe878065e3ecc02cdf2b4f8f98 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/accumulo.git The following commit(s) were added to refs/heads/master by this push: new 826f9f2 Fix Replication test failure from #833 826f9f2 is described below commit 826f9f2004b1ccfe878065e3ecc02cdf2b4f8f98 Author: Christopher Tubbs AuthorDate: Tue Dec 18 20:14:05 2018 -0500 Fix Replication test failure from #833 --- .../replication/ReplicationOperationsImplIT.java | 72 +++++++++------------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationOperationsImplIT.java b/test/src/main/java/org/apache/accumulo/test/replication/ReplicationOperationsImplIT.java index 59b431e..b4d9c30 100644 --- a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationOperationsImplIT.java +++ b/test/src/main/java/org/apache/accumulo/test/replication/ReplicationOperationsImplIT.java @@ -66,10 +66,12 @@ public class ReplicationOperationsImplIT extends ConfigurableMacBase { private static final Logger log = LoggerFactory.getLogger(ReplicationOperationsImplIT.class); private AccumuloClient client; + private ServerContext serverContext; @Before public void configureInstance() throws Exception { client = createClient(); + serverContext = getServerContext(); ReplicationTable.setOnline(client); client.securityOperations().grantTablePermission(client.whoami(), MetadataTable.NAME, TablePermission.WRITE); @@ -84,8 +86,6 @@ public class ReplicationOperationsImplIT extends ConfigurableMacBase { */ private ReplicationOperationsImpl getReplicationOperations() throws Exception { Master master = EasyMock.createMock(Master.class); - ServerContext serverContext = EasyMock.createMock(ServerContext.class); - EasyMock.expect((AccumuloClient) master.getContext()).andReturn(client).anyTimes(); EasyMock.expect(master.getContext()).andReturn(serverContext).anyTimes(); EasyMock.replay(master); @@ -152,17 +152,14 @@ public class ReplicationOperationsImplIT extends ConfigurableMacBase { final AtomicBoolean done = new AtomicBoolean(false); final AtomicBoolean exception = new AtomicBoolean(false); final ReplicationOperationsImpl roi = getReplicationOperations(); - Thread t = new Thread(new Runnable() { - @Override - public void run() { - try { - roi.drain("foo"); - } catch (Exception e) { - log.error("Got error", e); - exception.set(true); - } - done.set(true); + Thread t = new Thread(() -> { + try { + roi.drain("foo"); + } catch (Exception e) { + log.error("Got error", e); + exception.set(true); } + done.set(true); }); t.start(); @@ -253,17 +250,14 @@ public class ReplicationOperationsImplIT extends ConfigurableMacBase { final ReplicationOperationsImpl roi = getReplicationOperations(); - Thread t = new Thread(new Runnable() { - @Override - public void run() { - try { - roi.drain("foo"); - } catch (Exception e) { - log.error("Got error", e); - exception.set(true); - } - done.set(true); + Thread t = new Thread(() -> { + try { + roi.drain("foo"); + } catch (Exception e) { + log.error("Got error", e); + exception.set(true); } + done.set(true); }); t.start(); @@ -332,17 +326,14 @@ public class ReplicationOperationsImplIT extends ConfigurableMacBase { final AtomicBoolean done = new AtomicBoolean(false); final AtomicBoolean exception = new AtomicBoolean(false); final ReplicationOperationsImpl roi = getReplicationOperations(); - Thread t = new Thread(new Runnable() { - @Override - public void run() { - try { - roi.drain("foo"); - } catch (Exception e) { - log.error("Got error", e); - exception.set(true); - } - done.set(true); + Thread t = new Thread(() -> { + try { + roi.drain("foo"); + } catch (Exception e) { + log.error("Got error", e); + exception.set(true); } + done.set(true); }); t.start(); @@ -410,17 +401,14 @@ public class ReplicationOperationsImplIT extends ConfigurableMacBase { final AtomicBoolean done = new AtomicBoolean(false); final AtomicBoolean exception = new AtomicBoolean(false); final ReplicationOperationsImpl roi = getReplicationOperations(); - Thread t = new Thread(new Runnable() { - @Override - public void run() { - try { - roi.drain("foo"); - } catch (Exception e) { - log.error("Got error", e); - exception.set(true); - } - done.set(true); + Thread t = new Thread(() -> { + try { + roi.drain("foo"); + } catch (Exception e) { + log.error("Got error", e); + exception.set(true); } + done.set(true); }); t.start();