diff options
author | Jan Srnicek <jsrnicek@cisco.com> | 2017-04-18 09:52:15 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2017-04-24 07:31:25 +0000 |
commit | e4139584aaf94df71a4ddb5e5a0dded1a80c249d (patch) | |
tree | e8d7bc381a294e90c7fda6e00abb501b30fee19f /vpp-common/vpp-common-integration/src/test/java | |
parent | 458b915ad1d980f0b1ade7ebbd741d4cd46d5473 (diff) |
HC2VPP-106 - jvpp timeout configuration
Allows dynamic configuration of jvpp timeout
Change-Id: Iab113ec33f1efd8d150f0e525ef548a64ebf1a0b
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'vpp-common/vpp-common-integration/src/test/java')
-rw-r--r-- | vpp-common/vpp-common-integration/src/test/java/io/fd/hc2vpp/common/integration/VppCommonModuleTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vpp-common/vpp-common-integration/src/test/java/io/fd/hc2vpp/common/integration/VppCommonModuleTest.java b/vpp-common/vpp-common-integration/src/test/java/io/fd/hc2vpp/common/integration/VppCommonModuleTest.java index b63601de5..540145beb 100644 --- a/vpp-common/vpp-common-integration/src/test/java/io/fd/hc2vpp/common/integration/VppCommonModuleTest.java +++ b/vpp-common/vpp-common-integration/src/test/java/io/fd/hc2vpp/common/integration/VppCommonModuleTest.java @@ -19,6 +19,7 @@ package io.fd.hc2vpp.common.integration; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.Matchers.empty; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import static org.mockito.MockitoAnnotations.initMocks; @@ -27,9 +28,11 @@ import com.google.inject.Inject; import com.google.inject.name.Named; import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; import io.fd.honeycomb.translate.read.ReaderFactory; import java.util.HashSet; import java.util.Set; +import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.opendaylight.controller.md.sal.binding.api.DataBroker; @@ -49,5 +52,14 @@ public class VppCommonModuleTest { initMocks(this); Guice.createInjector(new VppCommonModule(), BoundFieldModule.of(this)).injectMembers(this); assertThat(readerFactories, is(not(empty()))); + assertEquals(15, JvppReplyConsumer.JvppReplyTimeoutHolder.getTimeout()); + } + + public void testConfigureJVppTimeoutIgnoreOnRetry() { + initMocks(this); + Guice.createInjector(new VppCommonModule(), BoundFieldModule.of(this)).injectMembers(this); + JvppReplyConsumer.JvppReplyTimeoutHolder.setupTimeout(1); + // reconfiguration is ignored + assertEquals(15, JvppReplyConsumer.JvppReplyTimeoutHolder.getTimeout()); } }
\ No newline at end of file |