Add “WatchFeeds” command
[jFCPlib.git] / src / test / java / net / pterodactylus / fcp / AbstractFcpMessageTest.java
1 package net.pterodactylus.fcp;
2
3 import java.io.ByteArrayOutputStream;
4 import java.io.IOException;
5 import java.util.Arrays;
6 import java.util.List;
7
8 /**
9  * Base test for all tests that verify a message’s appearance.
10  *
11  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
12  */
13 public class AbstractFcpMessageTest {
14
15         protected List<String> encodeMessage(FcpMessage fcpMessage) throws Exception {
16                 ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
17                 fcpMessage.write(outputStream);
18                 return Arrays.asList(outputStream.toString().split("\r?\n"));
19         }
20
21 }