Examples of InputDecoder


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

  }

  @Test
  public void testInputDecoder() {
    final HeaderDecoder headerDecoder = new HeaderDecoder();
    final InputDecoder inputDecoder = new InputDecoder();

    final String inputStr = "INPUT 110 [\"done\",[[0,\"ok\",[[0,\"raw://eyJlbnRyeWV4aXRsZXZlbCI6WyJERUMiLDEuNV0sInFyMiI6WyJERUMiLDFdLCJxcjEiOlsiREVD\"]]]]]\n";
    final ByteBuffer bb = ByteBuffer.wrap(inputStr.getBytes());

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

    assertTrue(inputDecoder.isDone());

    final List<DiscoInput> inputs = inputDecoder.getInputs();
    final DiscoInput input = inputs.get(0);
    assertEquals(0, input.getId());
    assertEquals(DiscoInputStatus.ok, input.getStatus());

    final List<DiscoInputReplica> replicas = input.getReplicas();
View Full Code Here

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

  }

  @Test
  public void testInputDecoder() {
    final HeaderDecoder headerDecoder = new HeaderDecoder();
    final InputDecoder inputDecoder = new InputDecoder();

    final String inputStr = "INPUT 110 [\"done\",[[0,\"ok\",[[0,\"raw://eyJlbnRyeWV4aXRsZXZlbCI6WyJERUMiLDEuNV0sInFyMiI6WyJERUMiLDFdLCJxcjEiOlsiREVD\"]]]]]\n";
    final ByteBuffer bb = ByteBuffer.wrap(inputStr.getBytes());

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

    assertTrue(inputDecoder.isDone());

    final List<DiscoInput> inputs = inputDecoder.getInputs();
    final DiscoInput input = inputs.get(0);
    assertEquals(0, input.getId());
    assertEquals(DiscoInputStatus.ok, input.getStatus());

    final List<DiscoInputReplica> replicas = input.getReplicas();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.