kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [1/2] kudu git commit: [test] Add interface annotations to test utilities
Date Wed, 19 Sep 2018 21:46:57 GMT
Repository: kudu
Updated Branches:
  refs/heads/master ffb1f22a7 -> df93255d9


[test] Add interface annotations to test utilities

We assume the test utilities are private, but we should
mark them via the interface annotations to make
it more clear.

Follow up patches may move some utilities to
another module and mark them as public.

Change-Id: I3a07c83a979d3c27392d5eaaf2fe87af376966b8
Reviewed-on: http://gerrit.cloudera.org:8080/11473
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: f3cd878dcdf2536e30995c466a09b933dc00eaa4
Parents: ffb1f22
Author: Grant Henke <granthenke@apache.org>
Authored: Tue Sep 18 12:53:35 2018 -0500
Committer: Grant Henke <granthenke@apache.org>
Committed: Wed Sep 19 20:48:28 2018 +0000

----------------------------------------------------------------------
 .../org/apache/kudu/client/BaseKuduTest.java    |  4 +++
 .../java/org/apache/kudu/client/FakeDNS.java    |  4 +++
 .../org/apache/kudu/client/MiniKuduCluster.java | 34 ++++++++++++--------
 .../java/org/apache/kudu/client/TestUtils.java  |  4 +++
 .../java/org/apache/kudu/junit/RetryRule.java   |  4 +++
 .../org/apache/kudu/util/AssertHelpers.java     |  5 +++
 .../apache/kudu/util/CapturingLogAppender.java  |  4 +++
 .../org/apache/kudu/util/ClientTestUtil.java    |  4 +++
 8 files changed, 49 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/f3cd878d/java/kudu-client/src/test/java/org/apache/kudu/client/BaseKuduTest.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/BaseKuduTest.java b/java/kudu-client/src/test/java/org/apache/kudu/client/BaseKuduTest.java
index eeabece..17d6c3c 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/BaseKuduTest.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/BaseKuduTest.java
@@ -29,6 +29,8 @@ import com.google.common.base.Stopwatch;
 import com.google.common.net.HostAndPort;
 import com.stumbleupon.async.Deferred;
 import org.apache.kudu.junit.RetryRule;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -40,6 +42,8 @@ import org.apache.kudu.Schema;
 import org.apache.kudu.client.LocatedTablet.Replica;
 import org.apache.kudu.master.Master;
 
+@InterfaceAudience.Private
+@InterfaceStability.Unstable
 public class BaseKuduTest {
 
   protected static final Logger LOG = LoggerFactory.getLogger(BaseKuduTest.class);

http://git-wip-us.apache.org/repos/asf/kudu/blob/f3cd878d/java/kudu-client/src/test/java/org/apache/kudu/client/FakeDNS.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/FakeDNS.java b/java/kudu-client/src/test/java/org/apache/kudu/client/FakeDNS.java
index caff049..72444ae 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/FakeDNS.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/FakeDNS.java
@@ -30,6 +30,8 @@ import javax.annotation.concurrent.GuardedBy;
 
 import com.google.common.base.Throwables;
 import com.google.common.net.InetAddresses;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
 
 /**
  * Fake DNS resolver which allows our tests to work well even though we use
@@ -45,6 +47,8 @@ import com.google.common.net.InetAddresses;
  * In the future this class might also be extended to test more interesting
  * DNS-related scenarios.
  */
+@InterfaceAudience.Private
+@InterfaceStability.Unstable
 public class FakeDNS {
   static FakeDNS instance = new FakeDNS();
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/f3cd878d/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java b/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
index dccddff..ee664fb 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
@@ -1,17 +1,19 @@
-/**
- * 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. See accompanying LICENSE file.
- */
-
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you 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.kudu.client;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
@@ -53,6 +55,8 @@ import org.apache.kudu.tools.Tool.StartClusterRequestPB;
 import org.apache.kudu.tools.Tool.StartDaemonRequestPB;
 import org.apache.kudu.tools.Tool.StopDaemonRequestPB;
 import org.apache.kudu.util.SecurityUtil;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,6 +65,8 @@ import org.slf4j.LoggerFactory;
  * kudu, kudu-master, and kudu-tserver binaries. {@link BaseKuduTest} should be
  * extended instead of directly using this class in almost all cases.
  */
+@InterfaceAudience.Private
+@InterfaceStability.Unstable
 public class MiniKuduCluster implements AutoCloseable {
 
   private static final Logger LOG = LoggerFactory.getLogger(MiniKuduCluster.class);

http://git-wip-us.apache.org/repos/asf/kudu/blob/f3cd878d/java/kudu-client/src/test/java/org/apache/kudu/client/TestUtils.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestUtils.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestUtils.java
index a3196d6..03ac43d 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestUtils.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestUtils.java
@@ -28,6 +28,8 @@ import java.util.Set;
 import com.google.common.base.Joiner;
 import com.google.common.collect.ImmutableSet;
 import com.google.protobuf.ByteString;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -38,6 +40,8 @@ import org.apache.kudu.master.Master;
 /**
  * A grouping of methods that help unit testing.
  */
+@InterfaceAudience.Private
+@InterfaceStability.Unstable
 public class TestUtils {
   private static final Logger LOG = LoggerFactory.getLogger(TestUtils.class);
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/f3cd878d/java/kudu-client/src/test/java/org/apache/kudu/junit/RetryRule.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/junit/RetryRule.java b/java/kudu-client/src/test/java/org/apache/kudu/junit/RetryRule.java
index 716fcab..fa0f6d0 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/junit/RetryRule.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/junit/RetryRule.java
@@ -16,6 +16,8 @@
 // under the License.
 package org.apache.kudu.junit;
 
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
 import org.junit.rules.TestRule;
 import org.junit.runner.Description;
 import org.junit.runners.model.Statement;
@@ -28,6 +30,8 @@ import org.slf4j.LoggerFactory;
  * Surefire/Failsafe rerunFailingTestsCount like Maven does. We use the system
  * property rerunFailingTestsCount to mimic the maven arguments closely.
  */
+@InterfaceAudience.Private
+@InterfaceStability.Unstable
 public class RetryRule implements TestRule {
 
   private static final Logger LOG = LoggerFactory.getLogger(RetryRule.class);

http://git-wip-us.apache.org/repos/asf/kudu/blob/f3cd878d/java/kudu-client/src/test/java/org/apache/kudu/util/AssertHelpers.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/util/AssertHelpers.java b/java/kudu-client/src/test/java/org/apache/kudu/util/AssertHelpers.java
index ff7d67e..ac30117 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/util/AssertHelpers.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/util/AssertHelpers.java
@@ -16,8 +16,13 @@
 // under the License.
 package org.apache.kudu.util;
 
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
+
 import static org.junit.Assert.assertTrue;
 
+@InterfaceAudience.Private
+@InterfaceStability.Unstable
 public class AssertHelpers {
   public interface BooleanExpression {
     boolean get() throws Exception;

http://git-wip-us.apache.org/repos/asf/kudu/blob/f3cd878d/java/kudu-client/src/test/java/org/apache/kudu/util/CapturingLogAppender.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/util/CapturingLogAppender.java
b/java/kudu-client/src/test/java/org/apache/kudu/util/CapturingLogAppender.java
index 583b9d5..c108826 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/util/CapturingLogAppender.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/util/CapturingLogAppender.java
@@ -25,12 +25,16 @@ import org.apache.log4j.Layout;
 import org.apache.log4j.Logger;
 import org.apache.log4j.SimpleLayout;
 import org.apache.log4j.spi.LoggingEvent;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
 
 /**
  * Test utility which wraps Log4j and captures all messages logged
  * while it is attached. This can be useful for asserting that a particular
  * message is (or is not) logged.
  */
+@InterfaceAudience.Private
+@InterfaceStability.Unstable
 public class CapturingLogAppender extends AppenderSkeleton {
   private StringBuilder appended = new StringBuilder();
   private static final Layout layout = new SimpleLayout();

http://git-wip-us.apache.org/repos/asf/kudu/blob/f3cd878d/java/kudu-client/src/test/java/org/apache/kudu/util/ClientTestUtil.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/util/ClientTestUtil.java b/java/kudu-client/src/test/java/org/apache/kudu/util/ClientTestUtil.java
index d795b26..053e3e2 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/util/ClientTestUtil.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/util/ClientTestUtil.java
@@ -41,6 +41,8 @@ import org.apache.kudu.client.KuduTable;
 import org.apache.kudu.client.PartialRow;
 import org.apache.kudu.client.RowResult;
 import org.apache.kudu.client.RowResultIterator;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,6 +55,8 @@ import java.util.concurrent.atomic.AtomicInteger;
 /**
  * Utilities useful for cluster testing.
  */
+@InterfaceAudience.Private
+@InterfaceStability.Unstable
 public abstract class ClientTestUtil {
 
   private static final Logger LOG = LoggerFactory.getLogger(ClientTestUtil.class);


Mime
View raw message