Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package test.tck.msgflow.callflows;
  
  import java.util.HashSet;
  
 
 
 public abstract class ScenarioHarness extends TestHarness {
 
 
     protected String transport;
 
     protected Hashtable providerTable;
 
     // this flag determines whether the tested SIP Stack is shootist or shootme
     protected boolean testedImplFlag;
 
     public void setUp() throws Exception {
         if () {
             this..add(new ProtocolObjects("ti" + super.getName(), "gov.nist",
                     true,false));
 
             this.addRiProtocolObjects(new ProtocolObjects("ri" + super.getName(), super
                     .getImplementationPath(), true,false));
             /*
              * if (!getImplementationPath().equals("gov.nist")) this.riProtocolObjects = new
              * ProtocolObjects( super.getName(), super.getImplementationPath(), transport, true);
              * else this.riProtocolObjects = tiProtocolObjects;
              */
 
         } else {
             this..add(new ProtocolObjects("ti" + super.getName(),
                     getImplementationPath(), true,false));
             this.addRiProtocolObjects(new ProtocolObjects("ri" + super.getName(), "gov.nist",
                     true,false));
 
             /*
              * if (!getImplementationPath().equals("gov.nist")) this.riProtocolObjects = new
              * ProtocolObjects( super.getName(), super.getImplementationPath(), transport, true);
              * else this.riProtocolObjects = tiProtocolObjects;
              */
 
         }
     }
 
     public void setUp(int nriint ntithrows Exception {
         if () {
             for (int i = 0; i < ntii++) {
                 this..add(new ProtocolObjects("ti" + super.getName() + i,
                         "gov.nist"true,false));
             }
             for (int i = 0; i < nrii++) {
 
                 this.addRiProtocolObjects(new ProtocolObjects("ri" + super.getName() + isuper
                         .getImplementationPath(), true,false));
             }
             /*
              * if (!getImplementationPath().equals("gov.nist")) this.riProtocolObjects = new
              * ProtocolObjects( super.getName(), super.getImplementationPath(), transport, true);
              * else this.riProtocolObjects = tiProtocolObjects;
              */
 
         } else {
             for (int i = 0; i < ntii++) {
                 this..add(new ProtocolObjects("ti" + super.getName() + i,
                         getImplementationPath(), true,false));
             }
             for (int i = 0; i < nrii++) {
                 this.addRiProtocolObjects(new ProtocolObjects("ri" + super.getName() + i,
                         "gov.nist"true,false));
             }
 
             /*
              * if (!getImplementationPath().equals("gov.nist")) this.riProtocolObjects = new
              * ProtocolObjects( super.getName(), super.getImplementationPath(), transport, true);
              * else this.riProtocolObjects = tiProtocolObjects;
              */
 
         }
     }
 
     public void setUp(boolean riAutoDialogthrows Exception {
         if () {
             this..add(new ProtocolObjects("ti" + super.getName(), "gov.nist",
                     truefalse));
            this.addRiProtocolObjects(new ProtocolObjects("ri" + super.getName(), super
                    .getImplementationPath(), riAutoDialog,false));
            /*
             * if (!getImplementationPath().equals("gov.nist")) this.riProtocolObjects = new
             * ProtocolObjects( super.getName(), super.getImplementationPath(), transport, true);
             * else this.riProtocolObjects = tiProtocolObjects;
             */
        } else {
            this..add(new ProtocolObjects("ti" + super.getName(),
                    getImplementationPath(), true,false));
            this.addRiProtocolObjects(new ProtocolObjects("ri" + super.getName(), "gov.nist",
                    riAutoDialog,false));
            /*
             * if (!getImplementationPath().equals("gov.nist")) this.riProtocolObjects = new
             * ProtocolObjects( super.getName(), super.getImplementationPath(), transport, true);
             * else this.riProtocolObjects = tiProtocolObjects;
             */
        }
    }
    public void setUp(boolean riAutoDialogint nriint nti) {
        if () {
            for (int i = 0; i < ntii++) {
                this..add(new ProtocolObjects("ti" + super.getName() + i,
                        "gov.nist"true,false));
            }
            for (int i = 0; i < nrii++) {
                this.addRiProtocolObjects(new ProtocolObjects("ri" + super.getName(), super
                        .getImplementationPath(), riAutoDialog,false));
            }
        } else {
            for (int i = 0; i < ntii++) {
                this..add(new ProtocolObjects("ti" + super.getName() + i,
                        getImplementationPath(), true,false));
            }
            for (int i = 0; i < nrii++) {
                this.addRiProtocolObjects(new ProtocolObjects("ri" + super.getName(), "gov.nist",
                        riAutoDialog,false));
            }
        }
    }
    private SipListener getSipListener(EventObject sipEvent) {
        SipProvider source = (SipProvidersipEvent.getSource();
        SipListener listener = (SipListener.get(source);
        if (listener == null)
            throw new TckInternalError("Unexpected null listener");
        return listener;
    }
    public void processRequest(RequestEvent requestEvent) {
        getSipListener(requestEvent).processRequest(requestEvent);
    }
    public void processResponse(ResponseEvent responseEvent) {
        getSipListener(responseEvent).processResponse(responseEvent);
    }
    public void processTimeout(TimeoutEvent timeoutEvent) {
        getSipListener(timeoutEvent).processTimeout(timeoutEvent);
    }
    public void processIOException(IOExceptionEvent exceptionEvent) {
    
    	..println("IOException ");
    }
    public void processTransactionTerminated(TransactionTerminatedEvent transactionTerminatedEvent) {
        getSipListener(transactionTerminatedEvent).processTransactionTerminated(
                transactionTerminatedEvent);
    }
    public void processDialogTerminated(DialogTerminatedEvent dialogTerminatedEvent) {
        getSipListener(dialogTerminatedEvent).processDialogTerminated(dialogTerminatedEvent);
    }
    protected ScenarioHarness(String nameboolean autoDialog) {
        super(nameautoDialog);
        this. = new Hashtable();
    }
    protected ScenarioHarness(String nameboolean autoDialogint nriint nti) {
        super(nameautoDialog);
        this. = new Hashtable();
    }

    

Parameters:
riProtocolObjects the riProtocolObjects to set
    protected void addRiProtocolObjects(ProtocolObjects riProtocolObjects) {
        this..add(riProtocolObjects);
    }

    

Returns:
the riProtocolObjects
    protected ProtocolObjects getRiProtocolObjects() {
        return .iterator().next();
    }

    

Parameters:
tiProtocolObjects the tiProtocolObjects to set
    protected void addTiProtocolObjects(
            test.tck.msgflow.callflows.ProtocolObjects tiProtocolObjects) {
        this..add(tiProtocolObjects);
    }

    

Returns:
the tiProtocolObjects
        return .iterator().next();
    }
    public ProtocolObjects getTiProtocolObjects(int index) {
        return (ProtocolObjects.toArray()[index];
    }
    public ProtocolObjects getRiProtocolObjects(int index) {
        return (ProtocolObjects.toArray()[index];
    }
    public void tearDown() throws Exception {
        for (ProtocolObjects protocolObjects : this.) {
            protocolObjects.destroy();
        }
        for (ProtocolObjects protocolObjects : this.) {
            protocolObjects.destroy();
        }
    }
    
    public void start() throws Exception {
        for (ProtocolObjects protocolObjects : this.) {
            protocolObjects.start();
        }
        for (ProtocolObjects protocolObjects : this.) {
            protocolObjects.start();
        }
    }
New to GrepCode? Check out our FAQ X