KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > CatchTest


1 package test;
2
3 import alt.jiapi.*;
4 import alt.jiapi.instrumentor.*;
5 /**
6  * Class description. tryTest
7  * @author Mika Riekkinen
8  */

9 public class CatchTest extends InstrumentorTest {
10     /**
11      */

12     public static void main(String JavaDoc [] args) throws Exception JavaDoc {
13         CatchTest test = new CatchTest();
14         test.run(args);
15     }
16
17     public CatchTest() throws Exception JavaDoc {
18         InstrumentorChain chain = new InstrumentorChain();
19
20         Instrumentor dispatcher = new MethodDispatcherInstrumentor();
21         CatchInstrumentor selectCatchBlocks = new CatchInstrumentor();
22         Instrumentor selectHead = new HeadInstrumentor();
23         MethodCallInstrumentor callMethod = new MethodCallInstrumentor(this);
24
25         chain.add(dispatcher);
26         chain.add(selectCatchBlocks);
27         chain.add(selectHead);
28         chain.add(callMethod);
29
30         InstrumentationDescriptor id = new InstrumentationDescriptor();
31         id.addChain(chain);
32
33         addInclusionRules(id, getInclusionRules());
34         addExclusionRules(id, getExclusionRules());
35
36         ctx.addInstrumentationDescriptor(id);
37     }
38 }
39
Popular Tags