EMMA Coverage Report (generated Tue Dec 18 20:38:46 CET 2007)
[all classes][cz.vutbr.feec.packets.rtcp]

## COVERAGE SUMMARY FOR SOURCE FILE [AppPacketTest.java]

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
AppPacketTest.java | 100% (1/1) | 100% (2/2) | 94% (134/143) | 98% (26,4/27)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class AppPacketTest | 100% (1/1) | 100% (2/2) | 94% (134/143) | 98% (26,4/27)
testAppPacket (): void |  | 100% (1/1) | 93% (127/136) | 98% (24,4/25)
AppPacketTest (): void |  | 100% (1/1) | 100% (7/7) | 100% (2/2)

1 | package cz.vutbr.feec.packets.rtcp;
2 |
3 | import org.junit.Assert;
4 | import org.junit.Test;
5 |
6 | import cz.vutbr.feec.packets.PacketGenerateException;
7 | import cz.vutbr.feec.packets.PacketParseException;
8 |
9 | public class AppPacketTest {
10 |
11 | byte[] buffer = new byte[100];
12 |
13 | @Test
14 | public void testAppPacket() throws PacketParseException,
15 | PacketGenerateException {
16 | AppPacket appliPacket = new AppPacket();
17 | appliPacket.setVersion(2);
18 | appliPacket.setPadding(1);
19 | appliPacket.setSubtype(8);
20 | appliPacket.setPayloadtype(204);
21 | appliPacket.setLength(200);
22 | appliPacket.setSSRC_CSRC(11223344);
23 | appliPacket.setNameASCII(55555);
24 |
25 | String text = "Ahoj";
26 | byte appData[] = text.getBytes();
27 | int lengthData = text.length();
28 | appliPacket.setAppData(appData, lengthData);
29 |
30 | int length = appliPacket.generate(buffer, 0);
31 |
32 | AppPacket appliPacketParse = new AppPacket();
33 |
34 | int length2 = appliPacketParse.parse(buffer, 0, length);
35 |
36 | Assert.assertTrue("Musi byt zarovnano na 4 byty", length % 4 == 0);
37 | Assert.assertTrue(length == length2);
38 | Assert.assertTrue(appliPacket.getVersion() == appliPacketParse.getVersion());
39 | Assert.assertTrue(appliPacket.getPadding() == appliPacketParse.getPadding());
40 | Assert.assertTrue(appliPacket.getSubtype() == appliPacketParse.getSubtype());
41 | Assert.assertTrue(appliPacket.getPayloadtype() == appliPacketParse.getPayloadtype());
42 | Assert.assertTrue(appliPacket.getLength() == appliPacketParse.getLength());
43 | Assert.assertTrue(appliPacket.getSSRC_CSRC() == appliPacketParse.getSSRC_CSRC());
44 | Assert.assertTrue(appliPacket.getNameASCII() == appliPacketParse.getNameASCII());
45 | //Assert.assertTrue(appliPacket.getAppData() == appliPacketParse.getAppData());
46 |
47 | }
48 | }

[all classes][cz.vutbr.feec.packets.rtcp]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov