From 37039138afcddedb1af4035aae5fb6c603c4c4e1 Mon Sep 17 00:00:00 2001 From: Michal Cmarada Date: Thu, 11 Apr 2019 04:18:16 -0400 Subject: HC2VPP-397: add support for java 11 - dependency updates - compilation error fixes - javadoc fixes Change-Id: Ic7371931b0728c888a39350a77c959121afb9786 Signed-off-by: Michal Cmarada --- .../io/fd/hc2vpp/common/test/read/JvppDumpExecutorTest.java | 10 ++++++++++ .../java/io/fd/hc2vpp/common/test/util/FutureProducer.java | 3 +++ .../io/fd/hc2vpp/common/test/util/NamingContextHelper.java | 4 ++-- .../io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) (limited to 'vpp-common/vpp-translate-test/src/main/java') diff --git a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/read/JvppDumpExecutorTest.java b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/read/JvppDumpExecutorTest.java index 45c28aace..88a012641 100644 --- a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/read/JvppDumpExecutorTest.java +++ b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/read/JvppDumpExecutorTest.java @@ -61,6 +61,11 @@ public abstract class JvppDumpExecutorTest> i /** * Return pre-stubed mock that will throw {@link TimeoutException}, * while performing desired method + * + * @return pre-stubed mock that will throw {@link TimeoutException} + * @throws InterruptedException when the operation is interrupted + * @throws ExecutionException when execution fails + * @throws TimeoutException when timeout occurs */ protected FutureJVppCore doThrowTimeoutExceptionWhen() throws InterruptedException, ExecutionException, TimeoutException { @@ -76,6 +81,8 @@ public abstract class JvppDumpExecutorTest> i /** * Return pre-stubed mock that will throw {@link VppInvocationException}, * while performing desired method + * + * @return pre-stubed mock that will throw {@link VppInvocationException} */ protected FutureJVppCore doThrowFailExceptionWhen() { return doReturn(failedFuture()).when(api); @@ -84,6 +91,9 @@ public abstract class JvppDumpExecutorTest> i /** * Return pre-stubed mock that will return specified result * while performing desired method + * + * @param replyDump type of reply dump + * @return pre-stubed mock that will return specified result */ protected FutureJVppCore doReturnResponseWhen(U replyDump) { return doReturn(future(replyDump)).when(api); diff --git a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/FutureProducer.java b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/FutureProducer.java index b2771239d..7e1599704 100644 --- a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/FutureProducer.java +++ b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/FutureProducer.java @@ -33,6 +33,7 @@ public interface FutureProducer { * * @param result returned when {@link CompletableFuture#get()} is invoked * @param the result type of returned future + * @return {@link CompletableFuture} with desired result */ default CompletableFuture future(@Nonnull final T result) { final CompletableFuture future = new CompletableFuture<>(); @@ -45,6 +46,7 @@ public interface FutureProducer { * * @param exception to be thrown when {@link CompletableFuture#get()} is invoked * @param the result type of returned future + * @return {@link CompletableFuture} with provided {@link Exception} as a result */ default CompletableFuture failedFuture(@Nonnull final Exception exception) { final CompletableFuture future = new CompletableFuture<>(); @@ -56,6 +58,7 @@ public interface FutureProducer { * Returns {@link CompletableFuture} with VppCallbackException(retval = -1) as a cause. * * @param the result type of returned future + * @return {@link CompletableFuture} with VppCallbackException(retval = -1) as a cause */ default CompletableFuture failedFuture() { return failedFuture(new VppCallbackException("test-call", "test error msg", 1 /* ctxId */, -1 /* retval */)); diff --git a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/NamingContextHelper.java b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/NamingContextHelper.java index f4f9790c2..5273a5a6b 100644 --- a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/NamingContextHelper.java +++ b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/NamingContextHelper.java @@ -35,7 +35,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; /** - * Utility that helps stubbing {@link io.fd.hc2vpp.common.translate.util.NamingContext} methods. + * Utility that helps stubbing {@link NamingContext} methods. */ // TODO(HONEYCOMB-226): the class needs to be refactored or even removed after extracting interface from NamingContext public interface NamingContextHelper { @@ -86,7 +86,7 @@ public interface NamingContextHelper { } /** - * Stubs {@link MappingContext#read} for given {@link NamingContext} to return {@link Optional#absent} for provided + * Stubs {@link MappingContext#read} for given {@link NamingContext} to return {@link Optional#empty} for provided * name. * * @param mappingContext mock instance of {@link MappingContext} diff --git a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java index 6a8fc2410..7edb964cc 100644 --- a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java +++ b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java @@ -57,6 +57,8 @@ public abstract class WriterCustomizerTest implements FutureProducer, /** * Optional setup for subclasses. Invoked after parent initialization. + * + * @throws Exception unspecified exception while setting up tests */ protected void setUpTest() throws Exception { // this method would normally trigger this warning while compiling: -- cgit 1.2.3-korg