diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-30 12:24:15 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-30 12:24:15 +0200 |
commit | b8bac3b2ba562d9d3a2faf13068d36cbaf9942f5 (patch) | |
tree | f61a751894bd48b30e25de036f5ef21e86e36d9e /container-core/src/test/java | |
parent | d654f0ab3e25be8a85d596a5af13b430386baa9c (diff) |
Don't reused renderer executors across renderer recycling
Diffstat (limited to 'container-core/src/test/java')
-rw-r--r-- | container-core/src/test/java/com/yahoo/processing/rendering/AsynchronousSectionedRendererTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/container-core/src/test/java/com/yahoo/processing/rendering/AsynchronousSectionedRendererTest.java b/container-core/src/test/java/com/yahoo/processing/rendering/AsynchronousSectionedRendererTest.java index b8efd8562b1..ab684872ce8 100644 --- a/container-core/src/test/java/com/yahoo/processing/rendering/AsynchronousSectionedRendererTest.java +++ b/container-core/src/test/java/com/yahoo/processing/rendering/AsynchronousSectionedRendererTest.java @@ -36,6 +36,26 @@ public class AsynchronousSectionedRendererTest { private static final Charset CHARSET = Utf8.getCharset(); @Test + public void testRenderersOfTheSamePrototypeUseTheSameExecutor() { + TestRenderer rendererPrototype = new TestRenderer(); + TestRenderer rendererCopy1 = (TestRenderer)rendererPrototype.clone(); + rendererCopy1.init(); + assertTrue(rendererPrototype.getRenderingExecutor() == rendererCopy1.getRenderingExecutor()); + } + + @Test + public void testRenderersOfDifferentPrototypesUseDifferentExecutors() { + TestRenderer rendererPrototype1 = new TestRenderer(); + TestRenderer rendererCopy1 = (TestRenderer)rendererPrototype1.clone(); + rendererCopy1.init(); + + TestRenderer rendererPrototype2 = new TestRenderer(); + TestRenderer rendererCopy2 = (TestRenderer)rendererPrototype2.clone(); + rendererCopy2.init(); + assertTrue(rendererPrototype1.getRenderingExecutor() != rendererCopy2.getRenderingExecutor()); + } + + @Test public void testAsyncSectionedRenderer() throws IOException, InterruptedException { StringDataList dataList = createDataListWithStrangeStrings(); |