Start a new step as child step of current running test case or step. Shortcut
for {@link #startStep(String, String, StepResult)}.

@param uuid   the uuid of step.
@param result the step.
960150
public void startStep(final String uuid, final StepResult result) {
        final Optional<String> current = threadContext.getCurrent();
        if (!current.isPresent()) {
            LOGGER.error("Could not start step: no test case running");
            return;
        }
        final String parentUuid = current.get();
        startStep(parentUuid, uuid, result);
    }
499576
public void transform(Result result) {
    if (logger.isInfoEnabled())
      logger.info("Transforming source into result");
    try {
      if (content == null) {
        throw new IllegalStateException("No source to transform");
      }

      Transformer transformer = null;
      if (this.transformer != null) {
        transformer = getTransformer();
      } else {
        if (logger.isWarnEnabled())
          logger.warn("No transformer, so using identity transform");
        transformer = TransformerFactory.newInstance().newTransformer();
      }

      transformer.transform(content, result);
    } catch (TransformerException e) {
      logger.error("Failed to transform source into result",e);
      throw new MarkLogicIOException(e);
    }
  }
221126
public function run(TestResult $result)
    {
        $this->applyFocus($result);

        $this->eventEmitter->on('test.failed', function () {
            if ($this->configuration->shouldStopOnFailure()) {
                $this->eventEmitter->emit('suite.halt');
            }
        });

        $this->eventEmitter->emit('runner.start');
        $this->suite->setEventEmitter($this->eventEmitter);
        $start = microtime(true);
        $this->suite->run($result);
        $this->eventEmitter->emit('runner.end', [microtime(true) - $start, $result]);
    }
794368
protected void generateTapPerMethod(Result result) {
        for (final JUnitTestData testMethod : testMethodsList) {
            final TestResult tapTestResult = TapJUnitUtil
                    .generateTAPTestResult(testMethod, 1, isYaml());

            final TestSet testSet = new TestSet();
            testSet.setPlan(new Plan(1));
            testSet.addTestResult(tapTestResult);

            final String className = TapJUnitUtil.extractClassName(testMethod
                    .getDescription());
            final String methodName = TapJUnitUtil.extractMethodName(testMethod
                    .getDescription());

            final File output = new File(System.getProperty(
                    "tap.junit.results", "target/"), className + ":"
                    + methodName + ".tap");
            tapProducer.dump(testSet, output);
        }
    }
1232055
public TraceStep startStep(String call, IStatsProducer producer, String methodName){
		TraceStep last = current;
		current = new TraceStep(call, producer, methodName);
		//it actually happened in production, we are still investigating why, but this fix should at least prevent the NPE for now.
		if (last!=null)
			last.addChild(current);
		return current;
	}
456145
public static SQLiteEvent createInsertWithUid(String result) {
		return new SQLiteEvent(SqlModificationType.INSERT, null, null, result);
	}
692094
public void stopStep() {
        final String root = threadContext.getRoot().orElse(null);
        final Optional<String> current = threadContext.getCurrent()
                .filter(uuid -> !Objects.equals(uuid, root));
        if (!current.isPresent()) {
            LOGGER.error("Could not stop step: no step running");
            return;
        }
        final String uuid = current.get();
        stopStep(uuid);
    }
245035
public Object invoke(final String stepTokenId, final List<String> args) {
        final AtomicReference resultRef = new AtomicReference();

        PolledAssertion p = new PolledAssertion() {
            protected void validate() throws Exception {
                Object r = wrappedInvoker.invoke(stepTokenId, args);
                resultRef.set(r);
            }

            protected int getPollPeriodMillis() {
                return (int)pollFrequency;
            }
        };

        retryAttempts = doTest(p, timeUnit, length);

        Object result = resultRef.get();
        return result;
    }
769718
public void fire(TestCaseStartedEvent event) {
        //init root step in parent thread if needed
        stepStorage.get();

        TestCaseResult testCase = testCaseStorage.get();
        event.process(testCase);

        synchronized (TEST_SUITE_ADD_CHILD_LOCK) {
            testSuiteStorage.get(event.getSuiteUid()).getTestCases().add(testCase);
        }

        notifier.fire(event);
    }
196400
@Override
  public void onSuccess(T result) {
    checkState();
    for (Callback<T> cb : callbacks) {
      cb.onSuccess(result);
    }
    callbacks = null; // note that we've fired
  }
537894
@Override
  public void processNewResult(ResultHierarchy hier, Result result) {
    // Get all new clusterings
    // TODO: handle clusterings added later, too. Can we update the result?

    List<Clustering<?>> clusterings = Clustering.getClusteringResults(result);
    // Abort if not enough clusterings to compare
    if(clusterings.size() < 2) {
      return;
    }

    // create segments
    Segments segments = new Segments(clusterings);
    hier.add(result, segments);
  }
865530
public function printStepPath(
        Formatter $formatter,
        Scenario $scenario,
        StepNode $step,
        StepResult $result,
        $indentation
    ) {
        $printer = $formatter->getOutputPrinter();

        if (!$result instanceof DefinedStepResult || !$result->getStepDefinition() || !$formatter->getParameter('paths')) {
            $printer->writeln();

            return;
        }

        $textWidth = $this->widthCalculator->calculateStepWidth($step, $indentation);
        $scenarioWidth = $this->widthCalculator->calculateScenarioWidth($scenario, $indentation - 2, 2);

        $this->printDefinedStepPath($printer, $result, $scenarioWidth, $textWidth);
    }
706017
protected ExecutionResult postExecute(ExecutionResult result) {
    if (isFailure(result)) {
      result = onFailure(result.with(false, false));
      callFailureListener(result);
    } else {
      result = result.with(true, true);
      onSuccess(result);
      callSuccessListener(result);
    }

    return result;
  }
267483
public Object invokeStep(String remoteStepInvokerId, String stepTokenId, List<String> params) throws Exception {
        try {
            //call the remote method
            Object[] args = {remoteStepInvokerId, stepTokenId, ChorusContext.getContext().getSnapshot(), params};
            String[] signature = {"java.lang.String", "java.lang.String", "java.util.Map", "java.util.List"};
            log.debug(String.format("About to invoke step (%s) on MBean (%s)", remoteStepInvokerId, objectName));
            JmxStepResult r = (JmxStepResult) mBeanServerConnection.invoke(objectName, "invokeStep", args, signature);

            //update the local context with any changes made remotely
            Map newContextState = r.getChorusContext();
            ChorusContext.resetContext(newContextState);

            //return the result which the remote step method returned
            return r.getResult();
        } catch (MBeanException e) {
            throw e.getTargetException();
        }
    }
865393
private void setCurrentStep(int nNewID) {
        try {
            XPropertySet xDialogModelPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_xMSFDialogModel);
            int nOldStep = getCurrentStep();
            // in the following line "ID" and "Step" are mixed together.
            // In fact in this case they denot the same
            if (nNewID != nOldStep){
                xDialogModelPropertySet.setPropertyValue("Step", new Integer(nNewID));
            }
        } catch (com.sun.star.uno.Exception exception) {
            exception.printStackTrace(System.out);
        }
    }
262811
public static void step(final String name, final ThrowableRunnableVoid runnable) {
        step(name, () -> {
            runnable.run();
            return null;
        });
    }
467372
async def step(self, step_id, session, scenario=None):
        
        if scenario is None:
            scenario = pick_scenario(self.wid, step_id)
        try:
            await self.send_event('scenario_start', scenario=scenario)

            await scenario['func'](session, *scenario['args'],
                                   **scenario['kw'])

            await self.send_event('scenario_success', scenario=scenario)

            if scenario['delay'] > 0.:
                await cancellable_sleep(scenario['delay'])
            return 1
        except Exception as exc:
            await self.send_event('scenario_failure',
                                  scenario=scenario,
                                  exception=exc)
            if self.args.verbose > 0:
                self.console.print_error(exc)
                await self.console.flush()

        return -1