diff options
Diffstat (limited to 'container-search')
3 files changed, 19 insertions, 10 deletions
diff --git a/container-search/src/main/java/com/yahoo/fs4/mplex/FS4Channel.java b/container-search/src/main/java/com/yahoo/fs4/mplex/FS4Channel.java index a4b61803285..adfc63d02f7 100644 --- a/container-search/src/main/java/com/yahoo/fs4/mplex/FS4Channel.java +++ b/container-search/src/main/java/com/yahoo/fs4/mplex/FS4Channel.java @@ -105,8 +105,7 @@ public class FS4Channel { * @param packetCount the number of packets to receive, or -1 to receive any number up to eol/error */ public BasicPacket[] receivePackets(long timeout, int packetCount) - throws InvalidChannelException, ChannelTimeoutException - { + throws InvalidChannelException, ChannelTimeoutException { ensureValid(); List<BasicPacket> packets = new ArrayList<>(12); diff --git a/container-search/src/main/java/com/yahoo/prelude/query/CompositeItem.java b/container-search/src/main/java/com/yahoo/prelude/query/CompositeItem.java index eee9949d831..ff74a8779c1 100644 --- a/container-search/src/main/java/com/yahoo/prelude/query/CompositeItem.java +++ b/container-search/src/main/java/com/yahoo/prelude/query/CompositeItem.java @@ -219,7 +219,7 @@ public abstract class CompositeItem extends Item { copy.subitems = new java.util.ArrayList<>(); for (Item subItem : subitems) { Item subItemCopy = subItem.clone(); - copy.adding(subItemCopy); + subItemCopy.setParent(copy); copy.subitems.add(subItemCopy); } fixConnexity(copy); diff --git a/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java b/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java index 9db956d4b8b..ed6dbf84bd2 100644 --- a/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java +++ b/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java @@ -139,7 +139,6 @@ public class BackendTestCase { 0,0,0,1, 0, 0, 0, 42, 0, 0, 0, 127, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1 }; - @Before public void setUp() throws Exception { logger = Logger.getLogger(Backend.class.getName()); initUseParent = logger.getUseParentHandlers(); @@ -150,7 +149,6 @@ public class BackendTestCase { backend = listeners.getBackend(server.host.getHostString(), server.host.getPort()); } - @After public void tearDown() throws Exception { listeners.deconstruct(); server.dispatch.socket.close(); @@ -160,7 +158,21 @@ public class BackendTestCase { } @Test - public void testBackend() throws IOException, InvalidChannelException { + public void testAll() throws Exception { + setUp(); + doTestBackend(); + tearDown(); + + setUp(); + doTestPinging(); + tearDown(); + + setUp(); + doRequireStatistics(); + tearDown(); + } + + public void doTestBackend() throws IOException, InvalidChannelException { FS4Channel channel = backend.openChannel(); Query q = new Query("/?query=a"); BasicPacket[] b = null; @@ -178,8 +190,7 @@ public class BackendTestCase { channel.close(); } - @Test - public void testPinging() throws IOException, InvalidChannelException { + public void doTestPinging() throws IOException, InvalidChannelException { FS4Channel channel = backend.openPingChannel(); BasicPacket[] b = null; server.dispatch.setNoChannel(); @@ -196,8 +207,7 @@ public class BackendTestCase { channel.close(); } - @Test - public void requireStatistics() throws IOException, InvalidChannelException { + public void doRequireStatistics() throws IOException, InvalidChannelException { FS4Channel channel = backend.openPingChannel(); server.dispatch.channelId = -1; server.dispatch.packetData = PONG; |