Package org.discoproject.worker.protocol.decoder

Examples of org.discoproject.worker.protocol.decoder.FailDecoder


public class DecodersTest {

  @Test
  public void testFailDecoder() {
    final HeaderDecoder headerDecoder = new HeaderDecoder();
    final FailDecoder decoder = new FailDecoder();

    final String inputStr = "FAIL 16 [1234,[5,6,7,8]]\n";
    final ByteBuffer bb = ByteBuffer.wrap(inputStr.getBytes());

    decoder.parse(bb, headerDecoder.parse(bb).getPayloadLength());

    assertEquals(1234, decoder.getInputId());
    final List<Integer> replicaIds = decoder.getReplicaIds();
    for (int i = 0; i < 4; i++) {
      assertEquals((i + 5), replicaIds.get(i).intValue());
    }
  }
View Full Code Here

TOP

Related Classes of org.discoproject.worker.protocol.decoder.FailDecoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.