use of org.abs_models.backend.java.observing.TaskStackFrameView in project abstools by abstools.
the class TestModel method testStarted.
public void testStarted(TaskView task) {
final String testMethod;
final String className;
final List<ABSValue> testMethodArguments;
final LinkedList<ABSValue> arguments = new LinkedList<>();
if (task.getStack().hasFrames()) {
final TaskStackFrameView currentF = task.getStack().getCurrentFrame();
testMethod = currentF.getMethod().getName();
className = currentF.getMethod().getClassView().getName();
for (String parameterName : currentF.getVariableNames()) {
arguments.add(currentF.getValue(parameterName));
}
} else {
testMethod = task.getMethodName();
className = task.getTarget().getClassName();
arguments.addAll(task.getArgs());
}
if (!task.getStack().hasFrames()) {
System.out.println("Not yet started " + testMethod + " for task " + task.getID());
} else {
System.out.println("Test " + task.getStack().getCurrentFrame().getMethod() + " task: " + task.getID());
}
final TestStatus newTest = new TestStatus(task.getID(), testMethod, className, arguments, task.getStack().getFrames(), TestStatus.Status.ACTIVE);
push(newTest);
System.out.println("Test started: " + task.getMethodName() + " : " + testMethod);
informListenersTestStarted(newTest);
}
Aggregations