Esempio n. 1
0
  @Test
  public void testParseRGB() throws DecodingException {
    VersionStack.INSTANCE.pushVersion(1);
    byte[] data = new byte[] {0x01, 0x01, 0x00, (byte) 0xaa, (byte) 0xff, (byte) 0xff};
    BitBuffer buffer = new DefaultBitBuffer(ByteBuffer.wrap(data));

    CodecFactory factory = CustomTypes.getCodecFactory(null);
    Codec<LineStyle> codec = factory.create(null, LineStyle.class, null);

    LineStyle result = codec.decode(buffer, null, new DefaultBuilder());

    assertNotNull(result.colorv1);
    assertEquals(Integer.valueOf(0), result.colorv1.red);
    assertEquals(Integer.valueOf(170), result.colorv1.green);
    assertEquals(Integer.valueOf(255), result.colorv1.blue);
  }
Esempio n. 2
0
 @After
 public void cleanup() {
   VersionStack.INSTANCE.popVersion();
 }