use of apet.testCases.ABSData in project abstools by abstools.
the class MethodTestCaseBuilder method makePreviousCalls.
@Override
List<Exp> makePreviousCalls(String testName, Set<String> heapNames, List<PreviousCall> calls) {
// task interleaving
List<Exp> expressions = new ArrayList<Exp>();
for (PreviousCall call : calls) {
// test execution
List<ABSData> callInputArguments = getCallArgs(call);
String methodName = removeClassName(getMethodName(call));
expressions.add(makeMethodCall(testName, heapNames, methodName, callInputArguments, false));
}
return expressions;
}
use of apet.testCases.ABSData in project abstools by abstools.
the class MethodTestCaseBuilder method makeMethodCall.
private Call makeMethodCall(String testName, Set<String> heapNames, String methodName, List<ABSData> inArgs, boolean sync) {
if (inArgs.size() == 0) {
throw new IllegalStateException("Inputs for a method must at least have a reference");
}
ABSData r = inArgs.get(0);
if (!(r instanceof ABSRef)) {
throw new IllegalStateException("Inputs for a method must at least have a reference");
}
PureExp[] ps = new PureExp[inArgs.size() - 1];
for (int i = 1; i < inArgs.size(); i++) {
ABSData d = inArgs.get(i);
PureExp exp = pureExpBuilder.createPureExpression(testName, heapNames, d);
ps[i - 1] = exp;
}
String rn = getABSDataValue(r);
VarUse var = new VarUse(heapRefBuilder.heapReferenceForTest(testName, rn));
Call call = getCall(var, methodName, sync, ps);
return call;
}
use of apet.testCases.ABSData in project abstools by abstools.
the class PureExpressionBuilder method parseValue.
DataConstructorExp parseValue(String currentHeapReference, List<String> initialisationsOrders, String testName, Set<String> heap, ABSTerm term) {
final DataConstructorExp result = new DataConstructorExp();
String fn = getABSTermFunctor(term);
result.setConstructor(fn);
result.setParamList(new abs.frontend.ast.List<PureExp>());
List<ABSData> vs = getABSTermArgs(term);
for (int i = 0; i < vs.size(); i++) {
result.setParam(createPureExpression(currentHeapReference, initialisationsOrders, testName, heap, vs.get(i)), i);
}
return result;
}
Aggregations