Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  * Conditions Of Use
  *
  * This software was developed by employees of the National Institute of
  * Standards and Technology (NIST), and others.
  * This software is has been contributed to the public domain.
  * As a result, a formal license is not needed to use the software.
  *
  * This software is provided "AS IS."
 * NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
 * AND DATA ACCURACY.  NIST does not warrant or make any representations
 * regarding the use of the software or the results thereof, including but
 * not limited to the correctness, accuracy, reliability or usefulness of
 * the software.
 *
 *
 */
 package test.tck.msgflow.callflows.router;
 
 
 
 import  test.tck.msgflow.callflows.NonSipUriRouter;
Implements common setup and tearDown sequence for Router test

Author(s):
M. Ranganathan
 
 public abstract class AbstractRouterTestCase extends ScenarioHarness implements
         SipListener {
 
 
     protected Shootist shootist;
 
     protected Shootme shootme;
 
     private static Logger logger = Logger.getLogger("test.tck");
 
     static {
         if (!.isAttached()) {
             .addAppender();
         }
     }
 
     public AbstractRouterTestCase() {
         super("routeteluri"true);
     }
 
     public void setUp() throws Exception {
         try {
             super.setUp();
 
             .info("RouterTest: setup()");
              = new Shootist(getTiProtocolObjects());
             SipProvider shootistProvider = .createProvider();
             .put(shootistProvider);
 
              = new Shootme(getRiProtocolObjects());
             SipProvider shootmeProvider = .createProvider();
             .put(shootmeProvider);
 
             shootistProvider.addSipListener(this);
             shootmeProvider.addSipListener(this);
 
             if (getTiProtocolObjects() != getRiProtocolObjects())
                 getTiProtocolObjects().start();
             getRiProtocolObjects().start();
         } catch (Exception ex) {
             .error("unexpected excecption "ex);
             fail("unexpected exception");
         }
     }
 
     public void tearDown() throws Exception {
         try {
             Thread.sleep(2000);
             this..checkState();
             this..checkState();
             assertTrue("Router was not consulted", NonSipUriRouter.routerWasConsulted);
             NonSipUriRouter.routerWasConsulted = false;
             super.tearDown();
             Thread.sleep(1000);
             this..clear();
 
             logTestCompleted();
         } catch (Exception ex) {
             .error("unexpected exception"ex);
             fail("unexpected exception ");
        }
        super.tearDown();
    }
New to GrepCode? Check out our FAQ X