summaryrefslogtreecommitdiffstats
path: root/vpp-common
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-common')
-rw-r--r--vpp-common/vpp-common-integration/pom.xml4
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/read/JvppDumpExecutorTest.java10
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/FutureProducer.java3
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/util/NamingContextHelper.java4
-rw-r--r--vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java2
-rw-r--r--vpp-common/vpp-translate-utils/pom.xml2
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/TagRewriteOperation.java2
7 files changed, 21 insertions, 6 deletions
diff --git a/vpp-common/vpp-common-integration/pom.xml b/vpp-common/vpp-common-integration/pom.xml
index 4c96405fd..f56773885 100644
--- a/vpp-common/vpp-common-integration/pom.xml
+++ b/vpp-common/vpp-common-integration/pom.xml
@@ -31,7 +31,7 @@
<properties>
<jvpp.version>19.04-SNAPSHOT</jvpp.version>
- <hamcrest.version>1.3</hamcrest.version>
+ <hamcrest.version>2.1</hamcrest.version>
</properties>
<build>
@@ -111,7 +111,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
+ <artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
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<T extends EntityDumpExecutor<?, ?>> 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<T extends EntityDumpExecutor<?, ?>> 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<T extends EntityDumpExecutor<?, ?>> 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 <U> 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 <T> the result type of returned future
+ * @return {@link CompletableFuture} with desired result
*/
default <T> CompletableFuture<T> future(@Nonnull final T result) {
final CompletableFuture<T> future = new CompletableFuture<>();
@@ -45,6 +46,7 @@ public interface FutureProducer {
*
* @param exception to be thrown when {@link CompletableFuture#get()} is invoked
* @param <T> the result type of returned future
+ * @return {@link CompletableFuture} with provided {@link Exception} as a result
*/
default <T> CompletableFuture<T> failedFuture(@Nonnull final Exception exception) {
final CompletableFuture<T> future = new CompletableFuture<>();
@@ -56,6 +58,7 @@ public interface FutureProducer {
* Returns {@link CompletableFuture} with VppCallbackException(retval = -1) as a cause.
*
* @param <T> the result type of returned future
+ * @return {@link CompletableFuture} with VppCallbackException(retval = -1) as a cause
*/
default <T> CompletableFuture<T> 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:
diff --git a/vpp-common/vpp-translate-utils/pom.xml b/vpp-common/vpp-translate-utils/pom.xml
index 0d87515a6..ae49ca563 100644
--- a/vpp-common/vpp-translate-utils/pom.xml
+++ b/vpp-common/vpp-translate-utils/pom.xml
@@ -94,7 +94,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/TagRewriteOperation.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/TagRewriteOperation.java
index 32b2b16cd..25c7862b2 100644
--- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/TagRewriteOperation.java
+++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/TagRewriteOperation.java
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
/**
* Defines vlan tag rewrite config options for VPP.
- * <p/>
+ *
* TODO HONEYCOMB-184 corresponding enum (defined in l2_vtr.h) should be defined in vpe.api
* (does vpp's IDL support enum type definition?)
* which would allow to generate this class in jvpp