01: package test.load.concurrency;
02:
03: import javax.sip.SipProvider;
04:
05: public class SelfTest {
06:
07: public static void main(String[] args) throws Exception {
08: ProtocolObjects.init("shootist", true);
09: if (args.length == 0)
10: Shootist.NDIALOGS = 10000;
11: else
12: Shootist.NDIALOGS = Integer.parseInt(args[0]);
13: Shootist.addressFactory = ProtocolObjects.addressFactory;
14: Shootist.messageFactory = ProtocolObjects.messageFactory;
15: Shootist.headerFactory = ProtocolObjects.headerFactory;
16: Shootist.sipStack = ProtocolObjects.sipStack;
17: Shootist.transport = ProtocolObjects.transport;
18: Shootist shootist = new Shootist();
19: shootist.createProvider(shootist);
20:
21: ProtocolObjects.init("shootme", true);
22: Shootme.addressFactory = ProtocolObjects.addressFactory;
23: Shootme.messageFactory = ProtocolObjects.messageFactory;
24: Shootme.headerFactory = ProtocolObjects.headerFactory;
25: Shootme.sipStack = ProtocolObjects.sipStack;
26: Shootme.transport = ProtocolObjects.transport;
27: Shootme shootme = new Shootme();
28: SipProvider sipProvider = shootme.createSipProvider();
29: sipProvider.addSipListener(shootme);
30:
31: shootist.start = System.currentTimeMillis();
32: for (int i = 0; i < Shootist.NDIALOGS; i++) {
33: Thread.sleep(3);
34: shootist.sendInvite();
35: }
36: }
37:
38: }
|