summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-05-24 12:37:45 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-05-24 12:37:45 +0200
commit2ed32514f274ac6cdc40d6824ddfaa6d0eda7293 (patch)
tree01c971e9085fab1fc64f0d55fb4f12244d868578 /container-search
parentd06ec4eac1df145e6b52edf3734a3f130a9ffc02 (diff)
Serialize tests
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/fs4/mplex/FS4Channel.java3
-rw-r--r--container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java24
2 files changed, 18 insertions, 9 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/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;