Search in sources :

Example 1 with TaskStackFrameView

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);
}
Also used : ABSValue(org.abs_models.backend.java.lib.types.ABSValue) TaskStackFrameView(org.abs_models.backend.java.observing.TaskStackFrameView) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)1 ABSValue (org.abs_models.backend.java.lib.types.ABSValue)1 TaskStackFrameView (org.abs_models.backend.java.observing.TaskStackFrameView)1