aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject aurora git commit: Remove dependency on old google testing library.
Date Sun, 30 Aug 2015 22:01:29 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 85f995447 -> 4899e2de3


Remove dependency on old google testing library.

Reviewed at https://reviews.apache.org/r/37933/


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

Branch: refs/heads/master
Commit: 4899e2de3e95d2744b152508c636e6ebc5ec260a
Parents: 85f9954
Author: Bill Farner <wfarner@apache.org>
Authored: Sun Aug 30 14:57:40 2015 -0700
Committer: Bill Farner <wfarner@apache.org>
Committed: Sun Aug 30 14:57:40 2015 -0700

----------------------------------------------------------------------
 build.gradle                                    |  9 ----
 .../aurora/common/testing/TearDownTestCase.java | 53 ++++++++++++++++++++
 .../common/testing/easymock/EasyMockTest.java   |  3 +-
 .../zookeeper/testing/BaseZooKeeperTest.java    |  8 ++-
 .../apache/aurora/common/io/FileUtilsTest.java  | 11 ++--
 .../aurora/common/quantity/AmountTest.java      |  7 ++-
 .../ExceptionHandlingExecutorServiceTest.java   | 11 +---
 ...ionHandlingScheduledExecutorServiceTest.java | 12 +----
 .../aurora/common/zookeeper/GroupTest.java      |  6 +--
 .../common/zookeeper/SingletonServiceTest.java  |  1 -
 .../common/zookeeper/ZooKeeperClientTest.java   |  5 +-
 .../common/zookeeper/ZooKeeperUtilsTest.java    |  6 +--
 .../aurora/scheduler/app/SchedulerIT.java       |  1 -
 .../scheduler/http/JettyServerModuleTest.java   |  1 -
 .../http/api/security/HttpSecurityIT.java       |  8 +--
 .../scheduler/mesos/MesosSchedulerImplTest.java |  1 -
 .../scheduler/offers/OfferManagerImplTest.java  | 25 ++-------
 .../storage/AbstractTaskStoreTest.java          |  2 +-
 .../scheduler/storage/backup/RecoveryTest.java  |  9 +---
 .../storage/backup/StorageBackupTest.java       |  9 +---
 .../scheduler/storage/log/LogStorageTest.java   |  1 -
 .../storage/mem/StorageTransactionTest.java     |  3 +-
 22 files changed, 87 insertions(+), 105 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 05cd36f..7b9a082 100644
--- a/build.gradle
+++ b/build.gradle
@@ -39,10 +39,6 @@ allprojects {
 
   repositories {
     mavenCentral()
-    // TODO(zmanji): Remove dependency on Twitter maven.
-    maven {
-      url 'https://maven.twttr.com/'
-    }
   }
 
   compileJava {
@@ -173,11 +169,6 @@ project(':commons') {
     compile "org.easymock:easymock:3.2"
     compile "org.slf4j:slf4j-jdk14:${slf4jRev}"
 
-    // TODO(zmanji): Remove dependency on this old jetty package
-    compile 'org.mortbay.jetty:jetty:6.1.25'
-    // TODO(zmanji): Remove dependency on this very old google package
-    compile 'com.google.testing:test-libraries-for-java:1.1.1'
-
     testCompile "junit:junit:${junitRev}"
     testCompile "com.sun.jersey:jersey-client:${jerseyRev}"
   }

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/main/java/org/apache/aurora/common/testing/TearDownTestCase.java
----------------------------------------------------------------------
diff --git a/commons/src/main/java/org/apache/aurora/common/testing/TearDownTestCase.java
b/commons/src/main/java/org/apache/aurora/common/testing/TearDownTestCase.java
new file mode 100644
index 0000000..f13cd7d
--- /dev/null
+++ b/commons/src/main/java/org/apache/aurora/common/testing/TearDownTestCase.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed 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.
+ */
+package org.apache.aurora.common.testing;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+import org.junit.After;
+
+/**
+ * A base class for unit tests to easily add teardown actions.
+ */
+public class TearDownTestCase {
+  private final LinkedList<TearDown> actions = new LinkedList<>();
+
+  public final void addTearDown(TearDown tearDown) {
+    actions.addFirst(tearDown);
+  }
+
+  @After
+  public final void tearDown() {
+    List<Exception> exceptions = Lists.newArrayList();
+    for (TearDown action : actions) {
+      try {
+        action.tearDown();
+      } catch (Exception e) {
+        exceptions.add(e);
+      }
+    }
+    if(!exceptions.isEmpty()) {
+      throw new RuntimeException("Tear down did not complete cleanly: " + exceptions);
+    } else {
+      actions.clear();
+    }
+  }
+
+  public interface TearDown {
+    void tearDown() throws Exception;
+  }
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/main/java/org/apache/aurora/common/testing/easymock/EasyMockTest.java
----------------------------------------------------------------------
diff --git a/commons/src/main/java/org/apache/aurora/common/testing/easymock/EasyMockTest.java
b/commons/src/main/java/org/apache/aurora/common/testing/easymock/EasyMockTest.java
index 92ba0c3..4031475 100644
--- a/commons/src/main/java/org/apache/aurora/common/testing/easymock/EasyMockTest.java
+++ b/commons/src/main/java/org/apache/aurora/common/testing/easymock/EasyMockTest.java
@@ -20,9 +20,8 @@ import java.lang.reflect.WildcardType;
 
 import com.google.common.base.Preconditions;
 import com.google.common.reflect.TypeToken;
-import com.google.common.testing.TearDown;
-import com.google.common.testing.junit4.TearDownTestCase;
 
+import org.apache.aurora.common.testing.TearDownTestCase;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/main/java/org/apache/aurora/common/zookeeper/testing/BaseZooKeeperTest.java
----------------------------------------------------------------------
diff --git a/commons/src/main/java/org/apache/aurora/common/zookeeper/testing/BaseZooKeeperTest.java
b/commons/src/main/java/org/apache/aurora/common/zookeeper/testing/BaseZooKeeperTest.java
index 88cd6d2..d97c001 100644
--- a/commons/src/main/java/org/apache/aurora/common/zookeeper/testing/BaseZooKeeperTest.java
+++ b/commons/src/main/java/org/apache/aurora/common/zookeeper/testing/BaseZooKeeperTest.java
@@ -16,15 +16,13 @@ package org.apache.aurora.common.zookeeper.testing;
 import java.io.IOException;
 
 import com.google.common.base.Preconditions;
-import com.google.common.testing.TearDown;
-import com.google.common.testing.junit4.TearDownTestCase;
-
-import org.apache.aurora.common.zookeeper.ZooKeeperClient;
-import org.junit.Before;
 
 import org.apache.aurora.common.application.ShutdownRegistry.ShutdownRegistryImpl;
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
+import org.apache.aurora.common.testing.TearDownTestCase;
+import org.apache.aurora.common.zookeeper.ZooKeeperClient;
+import org.junit.Before;
 
 /**
  * A baseclass for in-process zookeeper tests.

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/test/java/org/apache/aurora/common/io/FileUtilsTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/io/FileUtilsTest.java b/commons/src/test/java/org/apache/aurora/common/io/FileUtilsTest.java
index 6b8f6d3..a043451 100644
--- a/commons/src/test/java/org/apache/aurora/common/io/FileUtilsTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/io/FileUtilsTest.java
@@ -17,16 +17,13 @@ import java.io.File;
 import java.io.IOException;
 
 import com.google.common.io.Files;
-import com.google.common.testing.TearDown;
-import com.google.common.testing.junit4.JUnitAsserts;
-import com.google.common.testing.junit4.TearDownTestCase;
-
-import org.junit.Before;
-import org.junit.Test;
 
 import org.apache.aurora.common.base.ExceptionalClosure;
 import org.apache.aurora.common.base.ExceptionalFunction;
 import org.apache.aurora.common.base.Function;
+import org.apache.aurora.common.testing.TearDownTestCase;
+import org.junit.Before;
+import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -62,7 +59,7 @@ public class FileUtilsTest extends TearDownTestCase {
   public void testCreateFile() throws IOException {
     File tmpFile = temporary.createFile(".jake");
     assertEmptyFile(tmpFile);
-    JUnitAsserts.assertMatchesRegex(".+\\.jake$", tmpFile.getName());
+    assertTrue(tmpFile.getName().matches(".+\\.jake$"));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/test/java/org/apache/aurora/common/quantity/AmountTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/quantity/AmountTest.java b/commons/src/test/java/org/apache/aurora/common/quantity/AmountTest.java
index 8adf3f6..a51d2dd 100644
--- a/commons/src/test/java/org/apache/aurora/common/quantity/AmountTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/quantity/AmountTest.java
@@ -18,10 +18,9 @@ import com.google.common.collect.Ordering;
 
 import org.junit.Test;
 
-import static com.google.common.testing.junit4.JUnitAsserts.assertNotEqual;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
 
 /**
@@ -37,9 +36,9 @@ public class AmountTest {
     assertEquals("expected equality to be calculated from amounts converted to a common unit",
         Amount.of(1L, Time.DAYS), Amount.of(24L, Time.HOURS));
 
-    assertNotEqual("expected unit conversions for equality tests to not lose precision",
+    assertNotEquals("expected unit conversions for equality tests to not lose precision",
         Amount.of(25L, Time.HOURS), Amount.of(1L, Time.DAYS));
-    assertNotEqual("expected unit conversions for equality tests to not lose precision",
+    assertNotEquals("expected unit conversions for equality tests to not lose precision",
         Amount.of(1L, Time.DAYS), Amount.of(25L, Time.HOURS));
 
     assertFalse("expected value equality to work only for the same Number types",

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingExecutorServiceTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingExecutorServiceTest.java
b/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingExecutorServiceTest.java
index 6cea4b1..722f1cc 100644
--- a/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingExecutorServiceTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingExecutorServiceTest.java
@@ -18,7 +18,6 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import com.google.common.testing.TearDown;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 
 import org.junit.Before;
@@ -50,15 +49,9 @@ public class ExceptionHandlingExecutorServiceTest extends EasyMockTest
{
             .build()),
         signallingHandler);
 
-    final ExecutorServiceShutdown executorServiceShutdown = new ExecutorServiceShutdown(
+    ExecutorServiceShutdown executorServiceShutdown = new ExecutorServiceShutdown(
         executorService, Amount.of(3L, Time.SECONDS));
-
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() throws Exception {
-        executorServiceShutdown.execute();
-      }
-    });
+    addTearDown(executorServiceShutdown::execute);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingScheduledExecutorServiceTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingScheduledExecutorServiceTest.java
b/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingScheduledExecutorServiceTest.java
index 3caeeaa..3b2c96b 100644
--- a/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingScheduledExecutorServiceTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/util/concurrent/ExceptionHandlingScheduledExecutorServiceTest.java
@@ -21,8 +21,6 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
-import com.google.common.testing.TearDown;
-
 import org.junit.Before;
 import org.junit.Test;
 
@@ -49,15 +47,9 @@ public class ExceptionHandlingScheduledExecutorServiceTest extends EasyMockTest
     executorService = MoreExecutors.exceptionHandlingExecutor(
         Executors.newSingleThreadScheduledExecutor(), signallingHandler);
 
-    final ExecutorServiceShutdown executorServiceShutdown = new ExecutorServiceShutdown(
+    ExecutorServiceShutdown executorServiceShutdown = new ExecutorServiceShutdown(
         executorService, Amount.of(3L, Time.SECONDS));
-
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() throws Exception {
-        executorServiceShutdown.execute();
-      }
-    });
+    addTearDown(executorServiceShutdown::execute);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java b/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java
index 804b772..09d9016 100644
--- a/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/zookeeper/GroupTest.java
@@ -36,7 +36,6 @@ import org.apache.aurora.common.zookeeper.Group.NodeScheme;
 import org.apache.aurora.common.zookeeper.ZooKeeperClient.Credentials;
 import org.apache.aurora.common.zookeeper.testing.BaseZooKeeperTest;
 
-import static com.google.common.testing.junit4.JUnitAsserts.assertNotEqual;
 import static org.easymock.EasyMock.createMock;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
@@ -44,6 +43,7 @@ import static org.easymock.EasyMock.reset;
 import static org.easymock.EasyMock.verify;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.fail;
 
 public class GroupTest extends BaseZooKeeperTest {
@@ -197,8 +197,8 @@ public class GroupTest extends BaseZooKeeperTest {
       members = listener.take();
     }
     assertEquals(1, Iterables.size(members));
-    assertNotEqual(originalMemberId, Iterables.getOnlyElement(members));
-    assertNotEqual(originalMemberId, membership.getMemberId());
+    assertNotEquals(originalMemberId, Iterables.getOnlyElement(members));
+    assertNotEquals(originalMemberId, membership.getMemberId());
 
     listener.assertEmpty();
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
b/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
index 2e9e246..167e242 100644
--- a/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/zookeeper/SingletonServiceTest.java
@@ -20,7 +20,6 @@ import java.util.Map;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
-import com.google.common.testing.TearDown;
 
 import org.apache.aurora.common.base.ExceptionalCommand;
 import org.apache.aurora.common.zookeeper.Candidate.Leader;

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
b/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
index a64a98f..e074cf5 100644
--- a/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperClientTest.java
@@ -30,11 +30,10 @@ import org.apache.aurora.common.zookeeper.ZooKeeperClient.Credentials;
 import org.apache.aurora.common.zookeeper.ZooKeeperClient.ZooKeeperConnectionException;
 import org.apache.aurora.common.zookeeper.testing.BaseZooKeeperTest;
 
-import static com.google.common.testing.junit4.JUnitAsserts.assertNotEqual;
-
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
@@ -158,7 +157,7 @@ public class ZooKeeperClientTest extends BaseZooKeeperTest {
     // Close on an open client should force session re-establishment
     zkClient.close();
 
-    assertNotEqual(firstSessionId, zkClient.get().getSessionId());
+    assertNotEquals(firstSessionId, zkClient.get().getSessionId());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperUtilsTest.java
----------------------------------------------------------------------
diff --git a/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperUtilsTest.java
b/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperUtilsTest.java
index b3c469f..b17fe93 100644
--- a/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperUtilsTest.java
+++ b/commons/src/test/java/org/apache/aurora/common/zookeeper/ZooKeeperUtilsTest.java
@@ -22,9 +22,9 @@ import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.data.Stat;
 import org.junit.Test;
 
-import static com.google.common.testing.junit4.JUnitAsserts.assertNotEqual;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -83,7 +83,7 @@ public class ZooKeeperUtilsTest extends BaseZooKeeperTest {
 
     // expect using the correct version to work
     Stat rev2Stat = zkClient.get().setData(nodePath, "rev2".getBytes(), rev1Stat.getVersion());
-    assertNotEqual(ZooKeeperUtils.ANY_VERSION, rev2Stat.getVersion());
+    assertNotEquals(ZooKeeperUtils.ANY_VERSION, rev2Stat.getVersion());
 
     zkClient.get().setData(nodePath, "force-write".getBytes(), ZooKeeperUtils.ANY_VERSION);
     Stat forceWriteStat = new Stat();
@@ -91,7 +91,7 @@ public class ZooKeeperUtilsTest extends BaseZooKeeperTest {
     assertArrayEquals("force-write".getBytes(), forceWriteData);
 
     assertTrue(forceWriteStat.getVersion() > rev2Stat.getVersion());
-    assertNotEqual(ZooKeeperUtils.ANY_VERSION, forceWriteStat.getVersion());
+    assertNotEquals(ZooKeeperUtils.ANY_VERSION, forceWriteStat.getVersion());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
index 6447f69..1a25924 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
@@ -34,7 +34,6 @@ import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.hash.Hashing;
 import com.google.common.io.Files;
-import com.google.common.testing.TearDown;
 import com.google.common.util.concurrent.Atomics;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import com.google.inject.AbstractModule;

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java b/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
index efc30a5..ed8e811 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
@@ -18,7 +18,6 @@ import javax.ws.rs.core.MediaType;
 
 import com.google.common.base.Throwables;
 import com.google.common.net.HostAndPort;
-import com.google.common.testing.TearDown;
 import com.google.common.util.concurrent.RateLimiter;
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityIT.java
b/src/test/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityIT.java
index a5703e5..2454959 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityIT.java
@@ -19,7 +19,6 @@ import java.util.Set;
 import com.google.common.base.Joiner;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
-import com.google.common.testing.TearDown;
 import com.google.inject.AbstractModule;
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
@@ -160,12 +159,7 @@ public class HttpSecurityIT extends JettyServerModuleTest {
 
   private AuroraAdmin.Client getClient(HttpClient httpClient) throws TTransportException
{
     final TTransport httpClientTransport = new THttpClient(formatUrl(API_PATH), httpClient);
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() throws Exception {
-        httpClientTransport.close();
-      }
-    });
+    addTearDown(httpClientTransport::close);
     return new AuroraAdmin.Client(new TJSONProtocol(httpClientTransport));
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java b/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java
index 8365c6c..7e1d13b 100644
--- a/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/mesos/MesosSchedulerImplTest.java
@@ -22,7 +22,6 @@ import java.util.logging.Logger;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.testing.TearDown;
 import com.google.common.util.concurrent.MoreExecutors;
 
 import org.apache.aurora.common.application.Lifecycle;

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/offers/OfferManagerImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/offers/OfferManagerImplTest.java b/src/test/java/org/apache/aurora/scheduler/offers/OfferManagerImplTest.java
index 553eac3..0d9628c 100644
--- a/src/test/java/org/apache/aurora/scheduler/offers/OfferManagerImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/offers/OfferManagerImplTest.java
@@ -18,7 +18,6 @@ import java.util.logging.Level;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
-import com.google.common.testing.TearDown;
 
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
@@ -77,29 +76,13 @@ public class OfferManagerImplTest extends EasyMockTest {
 
   @Before
   public void setUp() {
-    offerManager.LOG.setLevel(Level.FINE);
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() throws Exception {
-        offerManager.LOG.setLevel(Level.INFO);
-      }
-    });
+    OfferManagerImpl.LOG.setLevel(Level.FINE);
+    addTearDown(() -> OfferManagerImpl.LOG.setLevel(Level.INFO));
     driver = createMock(Driver.class);
     DelayExecutor executorMock = createMock(DelayExecutor.class);
     clock = FakeScheduledExecutor.fromDelayExecutor(executorMock);
-
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() throws Exception {
-        clock.assertEmpty();
-      }
-    });
-    OfferReturnDelay returnDelay = new OfferReturnDelay() {
-      @Override
-      public Amount<Long, Time> get() {
-        return RETURN_DELAY;
-      }
-    };
+    addTearDown(clock::assertEmpty);
+    OfferReturnDelay returnDelay = () -> RETURN_DELAY;
     offerManager = new OfferManagerImpl(driver, returnDelay, executorMock);
   }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
b/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
index bc3f364..2c03238 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java
@@ -26,7 +26,6 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
-import com.google.common.testing.junit4.TearDownTestCase;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
@@ -34,6 +33,7 @@ import com.google.inject.Module;
 
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
+import org.apache.aurora.common.testing.TearDownTestCase;
 import org.apache.aurora.common.util.concurrent.ExecutorServiceShutdown;
 import org.apache.aurora.gen.Attribute;
 import org.apache.aurora.gen.Container;

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java b/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java
index a3a7c98..cc9c066 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java
@@ -18,7 +18,6 @@ import java.util.concurrent.ScheduledExecutorService;
 
 import com.google.common.collect.ImmutableSet;
 import com.google.common.io.Files;
-import com.google.common.testing.TearDown;
 
 import org.apache.aurora.common.base.Command;
 import org.apache.aurora.common.quantity.Amount;
@@ -42,6 +41,7 @@ import org.apache.aurora.scheduler.storage.backup.StorageBackup.StorageBackupImp
 import org.apache.aurora.scheduler.storage.backup.TemporaryStorage.TemporaryStorageFactory;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.testing.FakeScheduledExecutor;
+import org.apache.commons.io.FileUtils;
 import org.easymock.Capture;
 import org.junit.Before;
 import org.junit.Test;
@@ -70,12 +70,7 @@ public class RecoveryTest extends EasyMockTest {
   @Before
   public void setUp() {
     final File backupDir = Files.createTempDir();
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() throws Exception {
-        org.apache.commons.io.FileUtils.deleteDirectory(backupDir);
-      }
-    });
+    addTearDown(() -> FileUtils.deleteDirectory(backupDir));
     snapshotStore = createMock(new Clazz<SnapshotStore<Snapshot>>() { });
     distributedStore = createMock(DistributedSnapshotStore.class);
     primaryStorage = createMock(Storage.class);

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
b/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
index e38fbd1..18dbd2f 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
@@ -23,7 +23,6 @@ import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.io.Files;
-import com.google.common.testing.TearDown;
 
 import org.apache.aurora.codec.ThriftBinaryCodec;
 import org.apache.aurora.common.quantity.Amount;
@@ -44,6 +43,7 @@ import org.apache.aurora.scheduler.storage.SnapshotStore;
 import org.apache.aurora.scheduler.storage.backup.StorageBackup.StorageBackupImpl;
 import org.apache.aurora.scheduler.storage.backup.StorageBackup.StorageBackupImpl.BackupConfig;
 import org.apache.aurora.scheduler.testing.FakeScheduledExecutor;
+import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -67,12 +67,7 @@ public class StorageBackupTest extends EasyMockTest {
     final File backupDir = Files.createTempDir();
     ScheduledExecutorService executor = createMock(ScheduledExecutorService.class);
     clock = FakeScheduledExecutor.scheduleExecutor(executor);
-    addTearDown(new TearDown() {
-      @Override
-      public void tearDown() throws Exception {
-        org.apache.commons.io.FileUtils.deleteDirectory(backupDir);
-      }
-    });
+    addTearDown(() -> FileUtils.deleteDirectory(backupDir));
     config = new BackupConfig(backupDir, MAX_BACKUPS, INTERVAL);
     clock.advance(Amount.of(365 * 30L, Time.DAYS));
     storageBackup = new StorageBackupImpl(delegate, clock, config, executor);

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java b/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
index 54fc2a6..cc777b2 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/log/LogStorageTest.java
@@ -27,7 +27,6 @@ import com.google.common.collect.Iterators;
 import com.google.common.collect.Sets;
 import com.google.common.hash.HashFunction;
 import com.google.common.hash.Hashing;
-import com.google.common.testing.TearDown;
 
 import org.apache.aurora.codec.ThriftBinaryCodec;
 import org.apache.aurora.codec.ThriftBinaryCodec.CodingException;

http://git-wip-us.apache.org/repos/asf/aurora/blob/4899e2de/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
b/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
index 012f2b8..947a50f 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/mem/StorageTransactionTest.java
@@ -23,12 +23,11 @@ import java.util.concurrent.Future;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.testing.TearDown;
-import com.google.common.testing.junit4.TearDownTestCase;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 
 import org.apache.aurora.common.quantity.Amount;
 import org.apache.aurora.common.quantity.Time;
+import org.apache.aurora.common.testing.TearDownTestCase;
 import org.apache.aurora.common.util.concurrent.ExecutorServiceShutdown;
 import org.apache.aurora.gen.ResourceAggregate;
 import org.apache.aurora.scheduler.base.Query;


Mime
View raw message