Class Query


  • public final class Query
    extends Object
    Given one Cucumber Message, find another.

    This class is effectively a simple in memory database. It can be updated in real time through the update(Envelope) method. Queries can be made while the test run is incomplete - and this will naturally return incomplete results.

    It is safe to query and update this class concurrently.

    See Also:
    Cucumber Messages - Message Overview
    • Constructor Detail

      • Query

        public Query()
    • Method Detail

      • countMostSevereTestStepResultStatus

        public Map<io.cucumber.messages.types.TestStepResultStatus,​Long> countMostSevereTestStepResultStatus()
      • countTestCasesStarted

        public int countTestCasesStarted()
      • findAllPickles

        public List<io.cucumber.messages.types.Pickle> findAllPickles()
      • findAllPickleSteps

        public List<io.cucumber.messages.types.PickleStep> findAllPickleSteps()
      • findAllTestCaseStarted

        public List<io.cucumber.messages.types.TestCaseStarted> findAllTestCaseStarted()
      • findAllTestCaseStartedGroupedByFeature

        public Map<Optional<io.cucumber.messages.types.Feature>,​List<io.cucumber.messages.types.TestCaseStarted>> findAllTestCaseStartedGroupedByFeature()
      • findAllTestSteps

        public List<io.cucumber.messages.types.TestStep> findAllTestSteps()
      • findAttachmentsBy

        public List<io.cucumber.messages.types.Attachment> findAttachmentsBy​(io.cucumber.messages.types.TestStepFinished testStepFinished)
      • findFeatureBy

        public Optional<io.cucumber.messages.types.Feature> findFeatureBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • findHookBy

        public Optional<io.cucumber.messages.types.Hook> findHookBy​(io.cucumber.messages.types.TestStep testStep)
      • findMeta

        public Optional<io.cucumber.messages.types.Meta> findMeta()
      • findMostSevereTestStepResultBy

        public Optional<io.cucumber.messages.types.TestStepResult> findMostSevereTestStepResultBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • findNameOf

        public String findNameOf​(io.cucumber.messages.types.GherkinDocument element,
                                 NamingStrategy namingStrategy)
      • findNameOf

        public String findNameOf​(io.cucumber.messages.types.Feature element,
                                 NamingStrategy namingStrategy)
      • findNameOf

        public String findNameOf​(io.cucumber.messages.types.Rule element,
                                 NamingStrategy namingStrategy)
      • findNameOf

        public String findNameOf​(io.cucumber.messages.types.Scenario element,
                                 NamingStrategy namingStrategy)
      • findNameOf

        public String findNameOf​(io.cucumber.messages.types.Examples element,
                                 NamingStrategy namingStrategy)
      • findNameOf

        public String findNameOf​(io.cucumber.messages.types.TableRow element,
                                 NamingStrategy namingStrategy)
      • findNameOf

        public String findNameOf​(io.cucumber.messages.types.Pickle element,
                                 NamingStrategy namingStrategy)
      • findLocationOf

        public Optional<io.cucumber.messages.types.Location> findLocationOf​(io.cucumber.messages.types.Pickle pickle)
      • findPickleBy

        public Optional<io.cucumber.messages.types.Pickle> findPickleBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • findPickleBy

        public Optional<io.cucumber.messages.types.Pickle> findPickleBy​(io.cucumber.messages.types.TestStepStarted testStepStarted)
      • findPickleStepBy

        public Optional<io.cucumber.messages.types.PickleStep> findPickleStepBy​(io.cucumber.messages.types.TestStep testStep)
      • findStepBy

        public Optional<io.cucumber.messages.types.Step> findStepBy​(io.cucumber.messages.types.PickleStep pickleStep)
      • findStepDefinitionsBy

        public List<io.cucumber.messages.types.StepDefinition> findStepDefinitionsBy​(io.cucumber.messages.types.TestStep testStep)
      • findUnambiguousStepDefinitionBy

        public Optional<io.cucumber.messages.types.StepDefinition> findUnambiguousStepDefinitionBy​(io.cucumber.messages.types.TestStep testStep)
      • findTestCaseBy

        public Optional<io.cucumber.messages.types.TestCase> findTestCaseBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • findTestCaseBy

        public Optional<io.cucumber.messages.types.TestCase> findTestCaseBy​(io.cucumber.messages.types.TestStepStarted testStepStarted)
      • findTestCaseDurationBy

        public Optional<Duration> findTestCaseDurationBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • findTestCaseStartedBy

        public Optional<io.cucumber.messages.types.TestCaseStarted> findTestCaseStartedBy​(io.cucumber.messages.types.TestStepStarted testStepStarted)
      • findTestCaseFinishedBy

        public Optional<io.cucumber.messages.types.TestCaseFinished> findTestCaseFinishedBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • findTestRunFinished

        public Optional<io.cucumber.messages.types.TestRunFinished> findTestRunFinished()
      • findTestRunStarted

        public Optional<io.cucumber.messages.types.TestRunStarted> findTestRunStarted()
      • findTestStepBy

        public Optional<io.cucumber.messages.types.TestStep> findTestStepBy​(io.cucumber.messages.types.TestStepStarted testStepStarted)
      • findTestStepBy

        public Optional<io.cucumber.messages.types.TestStep> findTestStepBy​(io.cucumber.messages.types.TestStepFinished testStepFinished)
      • findTestStepsStartedBy

        public List<io.cucumber.messages.types.TestStepStarted> findTestStepsStartedBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • findTestStepsFinishedBy

        public List<io.cucumber.messages.types.TestStepFinished> findTestStepsFinishedBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • findTestStepFinishedAndTestStepBy

        public List<Map.Entry<io.cucumber.messages.types.TestStepFinished,​io.cucumber.messages.types.TestStep>> findTestStepFinishedAndTestStepBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)
      • update

        public void update​(io.cucumber.messages.types.Envelope envelope)
      • findLineageBy

        public Optional<Lineage> findLineageBy​(io.cucumber.messages.types.GherkinDocument element)
      • findLineageBy

        public Optional<Lineage> findLineageBy​(io.cucumber.messages.types.Feature element)
      • findLineageBy

        public Optional<Lineage> findLineageBy​(io.cucumber.messages.types.Rule element)
      • findLineageBy

        public Optional<Lineage> findLineageBy​(io.cucumber.messages.types.Scenario element)
      • findLineageBy

        public Optional<Lineage> findLineageBy​(io.cucumber.messages.types.Examples element)
      • findLineageBy

        public Optional<Lineage> findLineageBy​(io.cucumber.messages.types.TableRow element)
      • findLineageBy

        public Optional<Lineage> findLineageBy​(io.cucumber.messages.types.Pickle pickle)
      • findLineageBy

        public Optional<Lineage> findLineageBy​(io.cucumber.messages.types.TestCaseStarted testCaseStarted)