Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  
  package test.unit.gov.nist.javax.sip.stack.forkedinvite;
  
  import java.util.HashSet;
  
  
 import  junit.framework.TestCase;
 

Author(s):
M. Ranganathan
 
 public class InviteTest extends TestCase {
 
     protected Shootist shootist;
 
     private static Logger logger = Logger.getLogger("test.tck");
 
     protected static final Appender console = new ConsoleAppender(new SimpleLayout());
 
     private static final int forkCount = 2;
     
    
 
     protected HashSet<Shootmeshootme = new HashSet<Shootme>();
 
   
 
     private Proxy proxy;
 
     // private Appender appender;
 
     public InviteTest() {
 
         super("forkedInviteTest");
 
     }
 
     public void setUp() {
 
         try {
             super.setUp();
              = new Shootist(6050, 5070);
             SipProvider shootistProvider = .createSipProvider();
             shootistProvider.addSipListener();
             boolean sendRinging = true;
             for  (int i = 0 ; i <   ; i ++ ) {
                 
                 Shootme shootme = new Shootme(5080 + i,sendRinging,400* - 200*i);
                 sendRinging = false;
                 SipProvider shootmeProvider = shootme.createProvider();
                 shootmeProvider.addSipListener(shootme);
                 this..add(shootme);
             }
 
            
 
             this. = new Proxy(5070,);
             SipProvider provider = .createSipProvider();
             provider.addSipListener();
             .debug("setup completed");
 
         } catch (Exception ex) {
             fail("unexpected exception ");
         }
     }
 
     public void tearDown() {
         try {
             Thread.sleep(12000);
            
             
             this..checkState();
             
             int ackCount = 0;
            
             for ( Shootme shootmethis.) {
                  shootme.checkState();
                 
                  
                  if ( shootme.isAckSeen()) {
                      ackCount ++;
                  }
             }
            
            assertEquals("ACK count must be exactly 2", 2,ackCount);
             
             this..stop();
             
             for ( Shootme shootmethis.) {
              
                shootme.stop();
           }
        
            this..stop();
        } catch (Exception ex) {
            ex.printStackTrace();
            .error("unexpected exception"ex);
            fail("unexpected exception ");
        }
    }
    public void testInvite() throws Exception {
        this..sendInvite();
    }
New to GrepCode? Check out our FAQ X