From fff56adeda975a76f441425d9c650dd93e19ae1c Mon Sep 17 00:00:00 2001 From: Jan Srnicek Date: Fri, 25 Nov 2016 08:43:57 +0100 Subject: HONEYCOMB-277 - Keep-alive timeout exported Timeout exported to configurable property Change-Id: Ic095469be4d95f6726fdcabe17a6d2e4e51ba856 Signed-off-by: Jan Srnicek --- .../src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java | 14 ++++++++++++-- v3po/v3po2vpp/src/test/resources/v3po.json | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 v3po/v3po2vpp/src/test/resources/v3po.json (limited to 'v3po/v3po2vpp/src/test') diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java index 3366af64f..66231b2ff 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java @@ -19,6 +19,7 @@ package io.fd.hc2vpp.v3po; 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.assertNotNull; import static org.junit.Assert.assertThat; import static org.mockito.MockitoAnnotations.initMocks; @@ -28,18 +29,19 @@ 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.v3po.cfgattrs.V3poConfiguration; import io.fd.honeycomb.translate.MappingContext; -import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder; import io.fd.honeycomb.translate.impl.write.registry.FlatWriterRegistryBuilder; +import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.write.WriterFactory; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; 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; -import io.fd.vpp.jvpp.core.future.FutureJVppCore; public class V3poModuleTest { @@ -68,6 +70,9 @@ public class V3poModuleTest { @Inject private Set writerFactories = new HashSet<>(); + @Inject + private V3poConfiguration configuration; + @Before public void setUp() { initMocks(this); @@ -93,4 +98,9 @@ public class V3poModuleTest { writerFactories.stream().forEach(factory -> factory.init(registryBuilder)); assertNotNull(registryBuilder.build()); } + + @Test + public void testConfiguration() { + assertEquals(30, configuration.getKeepaliveDelay()); + } } \ No newline at end of file diff --git a/v3po/v3po2vpp/src/test/resources/v3po.json b/v3po/v3po2vpp/src/test/resources/v3po.json new file mode 100644 index 000000000..9ea66efe8 --- /dev/null +++ b/v3po/v3po2vpp/src/test/resources/v3po.json @@ -0,0 +1,3 @@ +{ + "keepalive-delay": "30" +} -- cgit 1.2.3-korg