Exemplo n.º 1
0
  @Test
  public void canBeCompressed_bothCommandAreParameterizedCommandButWithDifferentGroups() {
    PclCommandBuilder builder =
        new PclCommandBuilder().p(LOWEST_PARAMETERIZED_BYTE).v("1").t(LOWEST_TERMINATION_BYTE);

    PclCommand command = builder.copy().g(LOWEST_GROUP_BYTE).toCommand();
    PclCommand otherCommand = builder.copy().g(HIGHEST_GROUP_BYTE).toCommand();

    assertFalse(compressor.canBeCompressed(command, otherCommand));
  }
Exemplo n.º 2
0
 @Test
 public void
     canBeCompressed_bothCommandAreParameterizedCommandWithMatchingParameterizedAndGroupBytes() {
   PclCommand command =
       new PclCommandBuilder()
           .p(LOWEST_PARAMETERIZED_BYTE)
           .g(LOWEST_GROUP_BYTE)
           .v("1")
           .t(LOWEST_TERMINATION_BYTE)
           .toCommand();
   assertTrue(compressor.canBeCompressed(command, command));
 }
Exemplo n.º 3
0
  @Test
  public void canBeCompressed_bothCommandAreParameterizedButFirstCommandHasBinaryData() {
    PclCommandBuilder builder =
        new PclCommandBuilder()
            .p(LOWEST_PARAMETERIZED_BYTE)
            .g(LOWEST_GROUP_BYTE)
            .v("1")
            .t(LOWEST_TERMINATION_BYTE);

    PclCommand command = builder.copy().d("12").toCommand();
    PclCommand otherCommand = builder.toCommand();

    assertFalse(compressor.canBeCompressed(command, otherCommand));
  }
Exemplo n.º 4
0
 @Test
 public void canBeCompressed_secondCommandIsATextCommand() {
   assertFalse(
       compressor.canBeCompressed(
           new ParameterizedCommand(new byte[3]), new TextCommand("X".getBytes())));
 }
Exemplo n.º 5
0
 @Test
 public void canBeCompressed_firstCommandIsATwoByteCommandAndCanNotBeCompressed() {
   assertFalse(
       compressor.canBeCompressed(
           new TwoByteCommand(new byte[2]), new ParameterizedCommand(new byte[3])));
 }
Exemplo n.º 6
0
 @Test
 public void canBeCompressed_firstCommandIsNullAndCanNotBeCompressed() {
   assertFalse(compressor.canBeCompressed(null, new ParameterizedCommand(new byte[3])));
 }