assertThat(lines, requestMatcher.get());
}
+ private void replyWithProtocolError() throws IOException {
+ fcpServer.writeLine(
+ "ProtocolError",
+ "Identifier=" + identifier,
+ "EndMessage"
+ );
+ }
+
public class ConnectionsAndKeyPairs {
public class Connections {
assertThat(peer.get().get().getIdentity(), is("id1"));
}
+ @Test
+ public void protocolErrorEndsCommand() throws InterruptedException, ExecutionException, IOException {
+ Future<Optional<Peer>> peer = fcpClient.addPeer().fromFile(new File("/tmp/ref.txt")).execute();
+ connectAndAssert(() -> allOf(matchesAddPeer(), hasItem("File=/tmp/ref.txt")));
+ replyWithProtocolError();
+ assertThat(peer.get().isPresent(), is(false));
+ }
+
private NodeRef createNodeRef() {
NodeRef nodeRef = new NodeRef();
nodeRef.setIdentity("id1");
}
- private void replyWithProtocolError() throws IOException {
- fcpServer.writeLine(
- "ProtocolError",
- "Identifier=" + identifier,
- "EndMessage"
- );
- }
-
public class ReloadPlugin {
@Test