Source Code Cross Referenced for ReInviteTest.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » test » tck » msgflow » callflows » reinvite » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » Java Advanced Imaging » test.tck.msgflow.callflows.reinvite 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Conditions Of Use 
003:         * 
004:         * This software was developed by employees of the National Institute of
005:         * Standards and Technology (NIST), and others. 
006:         * This software is has been contributed to the public domain. 
007:         * As a result, a formal license is not needed to use the software.
008:         * 
009:         * This software is provided "AS IS."  
010:         * NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
011:         * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
012:         * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
013:         * AND DATA ACCURACY.  NIST does not warrant or make any representations
014:         * regarding the use of the software or the results thereof, including but
015:         * not limited to the correctness, accuracy, reliability or usefulness of
016:         * the software.
017:         * 
018:         * 
019:         */
020:        /**
021:         * 
022:         */package test.tck.msgflow.callflows.reinvite;
023:
024:        import gov.nist.javax.sip.SipProviderImpl;
025:
026:        import java.util.EventObject;
027:        import java.util.Hashtable;
028:        import java.util.Timer;
029:        import java.util.TimerTask;
030:
031:        import javax.sip.DialogTerminatedEvent;
032:        import javax.sip.IOExceptionEvent;
033:        import javax.sip.RequestEvent;
034:        import javax.sip.ResponseEvent;
035:        import javax.sip.SipListener;
036:        import javax.sip.SipProvider;
037:        import javax.sip.TimeoutEvent;
038:        import javax.sip.TransactionTerminatedEvent;
039:
040:        import org.apache.log4j.Appender;
041:        import org.apache.log4j.ConsoleAppender;
042:        import org.apache.log4j.FileAppender;
043:        import org.apache.log4j.Logger;
044:        import org.apache.log4j.PropertyConfigurator;
045:        import org.apache.log4j.SimpleLayout;
046:        import org.apache.log4j.helpers.NullEnumeration;
047:
048:        import test.tck.msgflow.callflows.ProtocolObjects;
049:        import test.tck.msgflow.callflows.ScenarioHarness;
050:        import test.tck.TestHarness;
051:
052:        import junit.framework.TestCase;
053:
054:        /**
055:         * @author M. Ranganathan
056:         * 
057:         */
058:        public class ReInviteTest extends ScenarioHarness implements 
059:                SipListener {
060:
061:            protected Shootist shootist;
062:
063:            private Shootme shootme;
064:
065:            private static Logger logger = Logger.getLogger("test.tck");
066:
067:            static {
068:                if (!logger.isAttached(console))
069:                    logger.addAppender(console);
070:            }
071:
072:            private SipListener getSipListener(EventObject sipEvent) {
073:                SipProvider source = (SipProvider) sipEvent.getSource();
074:                SipListener listener = (SipListener) providerTable.get(source);
075:                assertTrue(listener != null);
076:                return listener;
077:            }
078:
079:            public ReInviteTest() {
080:                super ("reinvitetest", true);
081:            }
082:
083:            public void setUp() {
084:
085:                try {
086:                    this .transport = "udp";
087:
088:                    super .setUp();
089:                    shootist = new Shootist(riProtocolObjects);
090:                    SipProvider shootistProvider = shootist.createSipProvider();
091:                    providerTable.put(shootistProvider, shootist);
092:
093:                    shootme = new Shootme(tiProtocolObjects);
094:                    SipProvider shootmeProvider = shootme.createSipProvider();
095:                    providerTable.put(shootmeProvider, shootme);
096:                    shootistProvider.addSipListener(this );
097:                    shootmeProvider.addSipListener(this );
098:
099:                    riProtocolObjects.start();
100:                    if (tiProtocolObjects != riProtocolObjects)
101:                        tiProtocolObjects.start();
102:                } catch (Exception ex) {
103:                    ex.printStackTrace();
104:                    fail("unexpected exception ");
105:                }
106:            }
107:
108:            public void testSendInvite() {
109:                this .shootist.sendInvite();
110:            }
111:
112:            public void tearDown() {
113:                try {
114:                    Thread.sleep(2000);
115:                    this .shootist.checkState();
116:                    this .shootme.checkState();
117:                    tiProtocolObjects.destroy();
118:                    if (tiProtocolObjects != riProtocolObjects)
119:                        riProtocolObjects.destroy();
120:                    Thread.sleep(1000);
121:                    this .providerTable.clear();
122:                    logTestCompleted();
123:                } catch (Exception ex) {
124:                    ex.printStackTrace();
125:                }
126:
127:            }
128:
129:            public void processRequest(RequestEvent requestEvent) {
130:                getSipListener(requestEvent).processRequest(requestEvent);
131:
132:            }
133:
134:            public void processResponse(ResponseEvent responseEvent) {
135:                getSipListener(responseEvent).processResponse(responseEvent);
136:
137:            }
138:
139:            public void processTimeout(TimeoutEvent timeoutEvent) {
140:                getSipListener(timeoutEvent).processTimeout(timeoutEvent);
141:            }
142:
143:            public void processIOException(IOExceptionEvent exceptionEvent) {
144:                fail("unexpected exception");
145:
146:            }
147:
148:            public void processTransactionTerminated(
149:                    TransactionTerminatedEvent transactionTerminatedEvent) {
150:                getSipListener(transactionTerminatedEvent)
151:                        .processTransactionTerminated(
152:                                transactionTerminatedEvent);
153:
154:            }
155:
156:            public void processDialogTerminated(
157:                    DialogTerminatedEvent dialogTerminatedEvent) {
158:                getSipListener(dialogTerminatedEvent).processDialogTerminated(
159:                        dialogTerminatedEvent);
160:
161:            }
162:
163:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.