01: package test.gov.nist.javax.sdp.parser;
02:
03: import gov.nist.javax.sdp.SessionDescriptionImpl;
04: import gov.nist.javax.sdp.parser.SDPAnnounceParser;
05: import junit.framework.TestCase;
06:
07: public class SdpParserTest extends TestCase {
08:
09: String sdpData[] = {
10: "\r\n " + "v=0\r\n"
11: + "o=4855 13760799956958020 13760799956958020"
12: + " IN IP4 129.6.55.78\r\n"
13: + "s=mysession session\r\n"
14: + "p=+46 8 52018010\r\n"
15: + "c=IN IP4 129.6.55.78\r\n" + "t=0 0\r\n"
16: + "m=audio 6022 RTP/AVP 0 4 18\r\n"
17: + "a=rtpmap:0 PCMU/8000\r\n"
18: + "a=rtpmap:4 G723/8000\r\n"
19: + "a=rtpmap:18 G729A/8000\r\n" + "a=ptime:20\r\n",
20:
21: "v=0\r\n" + "o=root 14539767 1208 IN IP4 66.237.65.67\r\n"
22: + "s=session\r\n" + "t=0 0\r\n"
23: + "m=audio 38658 RTP/AVP 3 110 97 0 8 101\r\n"
24: + "c=IN IP4 66.237.65.67\r\n"
25: + "a=rtpmap:3 GSM/8000\r\n"
26: + "a=rtpmap:110 speex/8000\r\n"
27: + "a=rtpmap:97 iLBC/8000\r\n"
28: + "a=rtpmap:0 PCMU/8000\r\n"
29: + "a=rtpmap:8 PCMA/8000\r\n"
30: + "a=rtpmap:101 telephone-event/8000\r\n"
31: + "a=fmtp:101 0-16\r\n"
32: + "a=silenceSupp:off - - - -\r\n" };
33:
34: public void testSdpParser() throws Exception {
35: for (String sdpdata : sdpData) {
36: SDPAnnounceParser parser = new SDPAnnounceParser(sdpdata);
37: SessionDescriptionImpl sessiondescription = parser.parse();
38: SessionDescriptionImpl sessiondescription1 = new SDPAnnounceParser(
39: sessiondescription.toString()).parse();
40: // Unfortunately equals is not yet implemented.
41: //assertEquals("Equality check", sessiondescription,sessiondescription1);
42: }
43:
44: }
45:
46: }
|