1 package test; 2 3 import alt.jiapi.*; 4 import alt.jiapi.instrumentor.*; 5 9 public class CatchTest extends InstrumentorTest { 10 12 public static void main(String [] args) throws Exception { 13 CatchTest test = new CatchTest(); 14 test.run(args); 15 } 16 17 public CatchTest() throws Exception { 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 |