package test;
import alt.jiapi.InstrumentationDescriptor;
import alt.jiapi.Instrumentor;
import alt.jiapi.InstrumentorChain;
import alt.jiapi.JiapiException;
import alt.jiapi.instrumentor.*;
import alt.jiapi.util.ChainBuilder;
/**
* Class description. CBTest
* @author Mika Riekkinen
*/
public class CBTest extends InstrumentorTest {
public static void main(String [] args) throws Exception {
CBTest gt = new CBTest();
gt.run(args);
}
public CBTest() throws Exception {
String chainSpec = System.getProperty("chainSpec");
if (chainSpec == null) {
throw new JiapiException("Missing -DchainSpec=<chainSpec>");
}
String [] chainSpecs = tokenizeRules(chainSpec);
if (chainSpecs.length == 0) {
throw new JiapiException("Empty chainSpec");
}
ChainBuilder cb = new ChainBuilder();
InstrumentorChain chain = cb.createChain(chainSpecs[0]);
InstrumentationDescriptor id = new InstrumentationDescriptor();
addInclusionRules(id, getInclusionRules());
addExclusionRules(id, getExclusionRules());
for (int i = 1; i < chainSpecs.length; i++) {
id.addChain(cb.createChain(chainSpecs[i]));
}
ctx.addInstrumentationDescriptor(id);
}
}