use of org.codice.ddf.libs.klv.KlvDecoder in project alliance by codice.
the class MetadataPacketTest method testSynchronousMetadataPacketMetadataAccessUnitTooShort.
@Test
public void testSynchronousMetadataPacketMetadataAccessUnitTooShort() throws Exception {
final byte[] pesPacketBytes = new byte[] { 0x00, 0x00, 0x01, (byte) 0xFC, 0x00, 0x0C, (byte) 0x85, (byte) 0x80, 0x05, 0x27, 0x19, 0x2B, 0x33, (byte) 0x91, 0x01, 0x01, 0x01, 0x00 };
final SynchronousMetadataPacket packet = new SynchronousMetadataPacket(pesPacketBytes, MPSUtils.readPESHeader(ByteBuffer.wrap(pesPacketBytes), 0), new KlvDecoder(Stanag4609TransportStreamParser.UAS_DATALINK_LOCAL_SET_CONTEXT));
assertThat(packet.decodeKLV(), nullValue());
}
use of org.codice.ddf.libs.klv.KlvDecoder in project alliance by codice.
the class MetadataPacketTest method testWrongChecksum.
@Test(expected = KlvDecodingException.class)
public void testWrongChecksum() throws Exception {
final byte[] pesPacketBytes = new byte[] { 0x00, 0x00, 0x01, (byte) 0xBD, 0x00, 0x18, (byte) 0x85, (byte) 0x00, 0x00, 0x06, 0x0E, 0x2B, 0x34, 0x02, 0x0B, 0x01, 0x01, 0x0E, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x04, 0x01, 0x02, 0x4C, 0x52 };
final AsynchronousMetadataPacket packet = new AsynchronousMetadataPacket(pesPacketBytes, MPSUtils.readPESHeader(ByteBuffer.wrap(pesPacketBytes), 0), new KlvDecoder(Stanag4609TransportStreamParser.UAS_DATALINK_LOCAL_SET_CONTEXT));
packet.decodeKLV();
}
use of org.codice.ddf.libs.klv.KlvDecoder in project alliance by codice.
the class MetadataPacketTest method testAsynchronousMetadataPacket.
@Test
public void testAsynchronousMetadataPacket() throws Exception {
final byte[] pesPacketBytes = new byte[] { 0x00, 0x00, 0x01, (byte) 0xBD, 0x00, 0x18, (byte) 0x85, (byte) 0x00, 0x00, 0x06, 0x0E, 0x2B, 0x34, 0x02, 0x0B, 0x01, 0x01, 0x0E, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x04, 0x01, 0x02, 0x4C, 0x51 };
final AsynchronousMetadataPacket packet = new AsynchronousMetadataPacket(pesPacketBytes, MPSUtils.readPESHeader(ByteBuffer.wrap(pesPacketBytes), 0), new KlvDecoder(Stanag4609TransportStreamParser.UAS_DATALINK_LOCAL_SET_CONTEXT));
final DecodedKLVMetadataPacket decodedPacket = packet.decodeKLV();
verifyDecodedKLV(decodedPacket);
assertThat(decodedPacket.getPresentationTimestamp(), is(lessThan(0L)));
}
use of org.codice.ddf.libs.klv.KlvDecoder in project alliance by codice.
the class MetadataPacketTest method testChecksumMissingUASDatalinkLocalSet.
@Test(expected = KlvDecodingException.class)
public void testChecksumMissingUASDatalinkLocalSet() throws Exception {
final byte[] pesPacketBytes = new byte[] { 0x00, 0x00, 0x01, (byte) 0xBD, 0x00, 0x18, (byte) 0x85, (byte) 0x00, 0x00, 0x06, 0x0E, 0x2B, 0x34, 0x02, 0x0B, 0x01, 0x01, 0x0E, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x01, 0x04, 0x01, 0x02, 0x4C, 0x52 };
final AsynchronousMetadataPacket packet = new AsynchronousMetadataPacket(pesPacketBytes, MPSUtils.readPESHeader(ByteBuffer.wrap(pesPacketBytes), 0), new KlvDecoder(Stanag4609TransportStreamParser.UAS_DATALINK_LOCAL_SET_CONTEXT));
packet.decodeKLV();
}
use of org.codice.ddf.libs.klv.KlvDecoder in project alliance by codice.
the class MetadataPacketTest method testMissingChecksum.
@Test(expected = KlvDecodingException.class)
public void testMissingChecksum() throws Exception {
final byte[] pesPacketBytes = new byte[] { 0x00, 0x00, 0x01, (byte) 0xBD, 0x00, 0x18, (byte) 0x85, (byte) 0x00, 0x00, 0x06, 0x0E, 0x2B, 0x34, 0x02, 0x0B, 0x01, 0x01, 0x0E, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x04, 0x06, 0x02, 0x01, 0x01 };
final AsynchronousMetadataPacket packet = new AsynchronousMetadataPacket(pesPacketBytes, MPSUtils.readPESHeader(ByteBuffer.wrap(pesPacketBytes), 0), new KlvDecoder(Stanag4609TransportStreamParser.UAS_DATALINK_LOCAL_SET_CONTEXT));
packet.decodeKLV();
}
Aggregations