diff options
author | 2016-08-31 08:36:24 +0200 | |
---|---|---|
committer | 2016-08-31 06:47:49 +0000 | |
commit | 4442eaaceb27f080e2ad38075823f0985d769b7c (patch) | |
tree | dfc047619cd16870337324bd060f13bca64066fd /vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po | |
parent | 67266f9f518f02295dab13da90a9ba2488ef4a31 (diff) |
HONEYCOMB-144 - Make dump cache manager thread-save
Modified to be thread save and generic
to be usable in all plugins
Change-Id: I26c90e8c8aa13c07fa389d86a9784e92e9532bcd
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po')
-rw-r--r-- | vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/cache/DumpCacheManagerTest.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/cache/DumpCacheManagerTest.java b/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/cache/DumpCacheManagerTest.java index 21b3646c4..456744f86 100644 --- a/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/cache/DumpCacheManagerTest.java +++ b/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/cache/DumpCacheManagerTest.java @@ -20,9 +20,9 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; import com.google.common.base.Optional; +import io.fd.honeycomb.translate.ModificationCache; import io.fd.honeycomb.translate.v3po.util.cache.exceptions.check.i.DumpEmptyException; import io.fd.honeycomb.translate.v3po.util.cache.exceptions.execution.DumpExecutionFailedException; -import io.fd.honeycomb.translate.ModificationCache; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; @@ -73,7 +73,7 @@ public class DumpCacheManagerTest { public void testCaching() throws DumpExecutionFailedException { - Optional<IpDetailsReplyDump> stage1Optional = managerNegative.getDump(KEY, cache); + Optional<IpDetailsReplyDump> stage1Optional = managerNegative.getDump(KEY, cache, null); //this is first call so instance should be from executor assertEquals(false, stage1Optional.isPresent()); @@ -81,18 +81,18 @@ public class DumpCacheManagerTest { //rebind executor with other data IpDetailsReplyDump stage2LoadedDump = new IpDetailsReplyDump(); - when(executor.executeDump()).thenReturn(stage2LoadedDump); + when(executor.executeDump(null)).thenReturn(stage2LoadedDump); - Optional<IpDetailsReplyDump> stage2Optional = managerPositive.getDump(KEY, cache); + Optional<IpDetailsReplyDump> stage2Optional = managerPositive.getDump(KEY, cache, null); assertEquals(true, stage2Optional.isPresent()); assertEquals(stage2LoadedDump, stage2Optional.get()); //rebind executor with other data IpDetailsReplyDump stage3LoadedDump = new IpDetailsReplyDump(); - when(executor.executeDump()).thenReturn(stage3LoadedDump); + when(executor.executeDump(null)).thenReturn(stage3LoadedDump); - Optional<IpDetailsReplyDump> stage3Optional = managerPositive.getDump(KEY, cache); + Optional<IpDetailsReplyDump> stage3Optional = managerPositive.getDump(KEY, cache, null); assertEquals(true, stage3Optional.isPresent()); //check if it returns instance cached from previous stage assertEquals(stage2LoadedDump, stage3Optional.get()); @@ -105,9 +105,9 @@ public class DumpCacheManagerTest { details.swIfIndex = 2; dump.ipDetails.add(details); - when(executor.executeDump()).thenReturn(dump); + when(executor.executeDump(null)).thenReturn(dump); - Optional<IpDetailsReplyDump> optionalDump = managerPositiveWithPostProcessing.getDump(KEY, cache); + Optional<IpDetailsReplyDump> optionalDump = managerPositiveWithPostProcessing.getDump(KEY, cache, null); assertEquals(true, optionalDump.isPresent()); assertEquals(1, optionalDump.get().ipDetails.size()); |