accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch master updated: Fix Replication test failure from #833
Date Wed, 19 Dec 2018 01:49:57 GMT
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 <ctubbsii@apache.org>
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();


Mime
View raw message