kamilfb / mqtt-spy

Please use the new Eclipse Paho GitHub repo instead.
https://github.com/eclipse/paho.mqtt-spy/wiki
345 stars 68 forks source link

TestCaseResult with IN_PROGRESS steps is overwritten #47

Closed pogocode closed 9 years ago

pogocode commented 9 years ago

When using the IN_PROGRESS TestCaseStep result, the information returned in such steps in the TestCaseResult is overwritten with the results of the final result for that step.

For example, use the following minimal test script to replicate this:

var TestCaseStepResult = Java.type("pl.baczkowicz.spy.testcases.TestCaseStepResult");
var TestCaseStatus = Java.type("pl.baczkowicz.spy.testcases.TestCaseStatus");

var count = 0;

var getInfo = function () 
{
    var TestCaseInfo = Java.type("pl.baczkowicz.spy.testcases.TestCaseInfo");
    var info = new TestCaseInfo();
    info.setName("Just one test step");
    info.getSteps().add("Test skipping several times");

    return info;
};

var step1 = function ()
{
    count++;

    if (count > 5)
    {
        return new TestCaseStepResult(TestCaseStatus.FAILED, "No messages received");
    }

    return new TestCaseStepResult(TestCaseStatus.IN_PROGRESS, "Skipping on iteration " + count);
};

The debugger shows the following. I would expect the red underlined values to have text "Skipping on iteration N" and a TestCaseStatus of IN_PROGRESS.

image

kamilfb commented 9 years ago

Fixed in build 74. Note that there are some interface changes for running scripts, and the step interval can be now put into the configuration file.

pogocode commented 9 years ago

Yes, this is now working as expected. Thanks very much.