├── .github └── workflows │ ├── build.yml │ └── ci.yml ├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── DEPLOY.md ├── LICENSE.txt ├── README.md ├── archetypes ├── jbehave-groovy-archetype │ ├── pom.xml │ └── src │ │ └── main │ │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── groovy │ │ ├── configuration │ │ │ └── MyReporterBuilder.groovy │ │ └── steps │ │ │ └── MySteps.groovy │ │ ├── java │ │ └── GroovyStories.java │ │ └── resources │ │ └── stories │ │ └── my.story ├── jbehave-guice-archetype │ ├── pom.xml │ └── src │ │ └── main │ │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ ├── MyStories.java │ │ └── steps │ │ │ └── MySteps.java │ │ └── resources │ │ └── stories │ │ └── my.story ├── jbehave-needle-archetype │ ├── pom.xml │ └── src │ │ └── main │ │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ ├── MyStories.java │ │ └── steps │ │ │ ├── MySteps.java │ │ │ ├── SpecialService.java │ │ │ └── UsualService.java │ │ └── resources │ │ └── stories │ │ └── my.story ├── jbehave-pico-archetype │ ├── pom.xml │ └── src │ │ └── main │ │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ ├── MyStories.java │ │ └── steps │ │ │ └── MySteps.java │ │ └── resources │ │ └── stories │ │ └── my.story ├── jbehave-simple-archetype │ ├── pom.xml │ └── src │ │ └── main │ │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ ├── MyStories.java │ │ └── steps │ │ │ └── MySteps.java │ │ └── resources │ │ └── stories │ │ └── my.story ├── jbehave-spring-archetype │ ├── pom.xml │ └── src │ │ └── main │ │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ ├── MyStories.java │ │ └── steps │ │ │ └── MySteps.java │ │ └── resources │ │ ├── my_steps.xml │ │ └── stories │ │ └── my.story ├── pom.xml └── src │ └── test │ └── resources │ └── projects │ └── sample │ ├── archetype.properties │ └── goal.txt ├── bitbucket-pipelines.yml ├── build.sh ├── distribution ├── README.md ├── pom.xml └── src │ ├── assembly │ ├── assembly-bin.xml │ └── assembly-src.xml │ ├── checkstyle │ └── jbehave-checks.xml │ └── site │ ├── config │ └── xsite.xml │ ├── content │ ├── aliases.html │ ├── annotations.html │ ├── archetypes.html │ ├── building-source.html │ ├── candidate-steps.html │ ├── code-coverage.html │ ├── composite-steps.html │ ├── concepts.html │ ├── conditional-steps.html │ ├── configuration.html │ ├── context-view.html │ ├── continuous-integration.html │ ├── dependencies.html │ ├── dependency-injection.html │ ├── developing-stories.html │ ├── download.html │ ├── examples-modules.html │ ├── examples-philosophy.html │ ├── faq.html │ ├── features.html │ ├── finding-steps.html │ ├── getting-started.html │ ├── given-stories.html │ ├── grammar.html │ ├── how-to-contribute.html │ ├── index.html │ ├── issue-tracking.html │ ├── javadoc.html │ ├── keyword-synonyms.html │ ├── license.html │ ├── lifecycle.html │ ├── locating-stories.html │ ├── mailing-lists.html │ ├── maven-goals.html │ ├── meta-filtering.html │ ├── meta-info.html │ ├── meta-parametrisation.html │ ├── migration-paths.html │ ├── more-on-bdd.html │ ├── multi-threading.html │ ├── outcomes-table.html │ ├── parameter-converters.html │ ├── parameter-injection.html │ ├── parametrised-scenarios.html │ ├── pattern-variants.html │ ├── pending-steps.html │ ├── prioritising-steps.html │ ├── release-notes.html │ ├── reporting-stories.html │ ├── running-examples.html │ ├── running-stories.html │ ├── sitemap.xml │ ├── source-repository.html │ ├── stories-in-your-language.html │ ├── story-mapping.html │ ├── story-syntax.html │ ├── story-timeouts.html │ ├── story-transformers.html │ ├── surefire-reporter.html │ ├── tabular-parameters.html │ ├── team-list.html │ ├── tutorials.html │ ├── users-experiences.html │ ├── using-groovy.html │ ├── using-jruby.html │ ├── using-rest.html │ └── using-scala.html │ ├── key │ └── Images.key │ ├── resources │ ├── README │ └── images │ │ ├── Images.001.png │ │ ├── Images.002.png │ │ ├── Images.003.png │ │ ├── Images.004.png │ │ ├── Images.005.png │ │ └── Images.006.png │ └── templates │ └── README ├── examples ├── README.md ├── annotations │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── annotations │ │ ├── CoreAnnotatedEmbedder.java │ │ ├── CoreAnnotatedPathRunner.java │ │ ├── CoreAnnotatedPathRunnerUsingScanning.java │ │ └── CoreStoriesUsingScanning.java ├── core │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── examples │ │ │ └── core │ │ │ ├── CoreStories.java │ │ │ ├── CoreStoriesEmbedders.java │ │ │ ├── CoreStoriesFailing.java │ │ │ ├── CoreStoriesFailingUponPending.java │ │ │ ├── CoreStoriesUsingJFrame.java │ │ │ ├── CoreStoriesWithCorrelation.java │ │ │ ├── CoreStoriesWithCustomReports.java │ │ │ ├── CoreStory.java │ │ │ ├── converters │ │ │ ├── CalendarConverter.java │ │ │ └── TraderConverter.java │ │ │ ├── model │ │ │ ├── Stock.java │ │ │ └── Trader.java │ │ │ ├── persistence │ │ │ └── TraderPersister.java │ │ │ ├── service │ │ │ └── TradingService.java │ │ │ ├── steps │ │ │ ├── AbstractSteps.java │ │ │ ├── AndSteps.java │ │ │ ├── BankAccountSteps.java │ │ │ ├── BeforeAfterSteps.java │ │ │ ├── CalendarSteps.java │ │ │ ├── CompositeNestedSteps.java │ │ │ ├── CompositeSteps.java │ │ │ ├── ContextSteps.java │ │ │ ├── FailingBeforeAfterSteps.java │ │ │ ├── IgnoringSteps.java │ │ │ ├── JsonSteps.java │ │ │ ├── MetaParametrisationSteps.java │ │ │ ├── MyContext.java │ │ │ ├── NamedAnnotationsSteps.java │ │ │ ├── NamedParametersSteps.java │ │ │ ├── ParameterDelimitersSteps.java │ │ │ ├── ParametrisationByDelimitedNameSteps.java │ │ │ ├── ParametrisedSteps.java │ │ │ ├── PendingSteps.java │ │ │ ├── PriorityMatchingSteps.java │ │ │ ├── RestartingSteps.java │ │ │ ├── SandpitSteps.java │ │ │ ├── SearchSteps.java │ │ │ ├── StepsContextSteps.java │ │ │ ├── TableMappingSteps.java │ │ │ ├── TableSteps.java │ │ │ ├── TraderSteps.java │ │ │ ├── VerbatimSteps.java │ │ │ └── composite.steps │ │ │ └── stories │ │ │ ├── GivenStoriesFilteredByMeta.java │ │ │ ├── MetaFiltering.java │ │ │ ├── ParameterDelimiters.java │ │ │ ├── ParametrisationByDelimitedName.java │ │ │ ├── PriorityMatching.java │ │ │ ├── Restarting.java │ │ │ ├── SkipBeforeAndAfterScenarioStepsIfGivenStory.java │ │ │ ├── alias.story │ │ │ ├── and_step.story │ │ │ ├── calendar.story │ │ │ ├── context.story │ │ │ ├── custom │ │ │ └── synonyms.story │ │ │ ├── do_nothing.story │ │ │ ├── failing │ │ │ ├── EnsuringOrderUsingSteps.java │ │ │ ├── ExamplesTableFailing.java │ │ │ ├── FailingAfterStories.java │ │ │ ├── FailingBeforeAfter.java │ │ │ ├── FailingBeforeStories.java │ │ │ ├── SkipScenariosAfterFailure.java │ │ │ ├── SkipStoryIfGivenStoryFailed.java │ │ │ ├── after_scenario_outcome.story │ │ │ ├── and_step.story │ │ │ ├── ensuring_order_using_steps.story │ │ │ ├── examples_table_failing.story │ │ │ ├── failing_after_stories.story │ │ │ ├── failing_before_after.story │ │ │ ├── failing_before_stories.story │ │ │ ├── failure_correlation_one.story │ │ │ ├── failure_correlation_two.story │ │ │ ├── failure_followed_by_given_stories.story │ │ │ ├── given_non_successful.story │ │ │ ├── lifecycle.story │ │ │ ├── non_successful.story │ │ │ ├── skip_scenarios_after_failure.story │ │ │ ├── skip_story_if_given_story_failed.story │ │ │ └── traders_can_be_searched.story │ │ │ ├── given │ │ │ ├── GivenStoriesLoadedByRelativePath.java │ │ │ ├── given_stories_loaded_by_relative_path.story │ │ │ ├── parametrised.story │ │ │ └── scenarios.story │ │ │ ├── given_stories_filtered_by_meta.story │ │ │ ├── given_stories_filtered_by_scenario_id.story │ │ │ ├── given_stories_parametrised_by_anchor.story │ │ │ ├── given_stories_parametrised_by_examples.story │ │ │ ├── given_stories_parametrised_by_meta.story │ │ │ ├── ignoring.story │ │ │ ├── json_mapping.story │ │ │ ├── lifecycle_scenario.story │ │ │ ├── lifecycle_scope.story │ │ │ ├── meta_filtering.story │ │ │ ├── meta_parametrisation.story │ │ │ ├── named_annotations.story │ │ │ ├── named_parameters.story │ │ │ ├── parameter_delimiters.story │ │ │ ├── parametrisation_by_delimited_name.story │ │ │ ├── parametrised_scenario.story │ │ │ ├── parametrised_table.story │ │ │ ├── pending │ │ │ ├── MetaFiltering.java │ │ │ ├── meta_filtering.story │ │ │ ├── parametrised_scenario.story │ │ │ ├── pending.story │ │ │ ├── pending_stats.story │ │ │ └── step_composition.story │ │ │ ├── priority_matching.story │ │ │ ├── restarting.story │ │ │ ├── select_stock_exchange.story │ │ │ ├── skip_before_and_after_scenario_steps_if_given_story.story │ │ │ ├── step_composition.story │ │ │ ├── step_composition_from_definition_file.story │ │ │ ├── step_nested_composition.story │ │ │ ├── steps_context.story │ │ │ ├── table_loaded_from_classpath.story │ │ │ ├── table_parameter_mapping.story │ │ │ ├── table_parameters.story │ │ │ ├── table_transformers.story │ │ │ ├── trade_types.story │ │ │ ├── trader_is_alerted_of_status.story │ │ │ ├── trader_sells_all_stocks.story │ │ │ ├── traders.table │ │ │ ├── traders_can_be_searched.story │ │ │ ├── trades.table │ │ │ ├── trades_transposed.table │ │ │ └── verbatim.story │ │ └── resources │ │ ├── alias │ │ └── aliases.json │ │ ├── ftl │ │ ├── custom-html-output.ftl │ │ └── custom-reports.ftl │ │ └── i18n │ │ └── custom_en.properties ├── executable-jar │ ├── Notes.txt │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── examples │ │ │ └── executablejar │ │ │ ├── MyStories.java │ │ │ └── steps │ │ │ └── MySteps.java │ │ └── resources │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── executablejar │ │ └── stories │ │ ├── jar.story │ │ └── jar2.story ├── failing │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── FailingStories.java ├── gherkin │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── gherkin │ │ ├── GherkinStories.java │ │ ├── features │ │ └── using_gherkin.feature │ │ └── steps │ │ └── GherkinSteps.java ├── google │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── google │ │ ├── GoogleStories.java │ │ ├── steps │ │ ├── GoogleSteps.java │ │ ├── a_story.odt │ │ └── a_story.txt │ │ └── stories │ │ └── load_odt_from_google.story ├── grid │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── grid │ │ ├── GridStories.java │ │ ├── domain │ │ ├── Cell.java │ │ ├── Game.java │ │ ├── Grid.java │ │ ├── GridObserver.java │ │ └── StringObserver.java │ │ ├── steps │ │ └── GridSteps.java │ │ └── stories │ │ └── grid_cells_can_be_toggled.story ├── groovy │ ├── pom.xml │ └── src │ │ └── main │ │ ├── groovy │ │ └── org │ │ │ └── jbehave │ │ │ └── examples │ │ │ └── groovy │ │ │ ├── configuration │ │ │ └── MyReporterBuilder.groovy │ │ │ └── steps │ │ │ └── GroovySteps.groovy │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── groovy │ │ ├── AnnotatedEmbedderUsingGroovy.java │ │ ├── GroovyStories.java │ │ └── stories │ │ └── using_groovy.story ├── guice │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── guice │ │ ├── AnnotatedEmbedderUsingGuice.java │ │ ├── AnnotatedEmbedderUsingGuiceAndSteps.java │ │ ├── AnnotatedPathRunnerUsingGuice.java │ │ ├── CoreStoriesUsingGuice.java │ │ ├── GuiceCoreSteps.java │ │ ├── InheritingAnnotatedEmbedderUsingSteps.java │ │ └── ParentAnnotatedEmbedderUsingGuice.java ├── i18n │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── trader │ │ └── i18n │ │ ├── DeStories.java │ │ ├── FrStories.java │ │ ├── ItStories.java │ │ ├── LocalizedStories.java │ │ ├── PtStories.java │ │ ├── SvStories.java │ │ ├── steps │ │ ├── DeSteps.java │ │ ├── FrSteps.java │ │ ├── ItSteps.java │ │ ├── PtSteps.java │ │ └── SvSteps.java │ │ └── stories │ │ ├── de_trader_is_alerted_of_status.geschichte │ │ ├── fr_trader_is_alerted_of_status.histoire │ │ ├── it_trader_is_alerted_of_status.storia │ │ ├── pt_trader_is_alerted_of_status.historia │ │ └── sv_and_step.story ├── jruby │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── examples │ │ │ └── jruby │ │ │ ├── JRubyStories.java │ │ │ └── stories │ │ │ └── using_jruby.story │ │ └── ruby │ │ └── JRubySteps.rb ├── maps │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── maps │ │ └── CoreStoryMaps.java ├── meta │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── meta │ │ ├── MetaByRowEmbedder.java │ │ ├── MetaByRowStories.java │ │ ├── StepsScanner.java │ │ ├── steps.xml │ │ ├── steps │ │ └── InputSteps.java │ │ └── stories │ │ └── meta_by_row.story ├── needle │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── jbehave │ │ │ └── examples │ │ │ └── core │ │ │ └── needle │ │ │ ├── AnnotatedEmbedderUsingNeedle.java │ │ │ ├── AnnotatedEmbedderUsingNeedleAndSteps.java │ │ │ ├── AnnotatedPathRunnerUsingNeedle.java │ │ │ ├── CoreStoriesUsingNeedle.java │ │ │ ├── InheritingAnnotatedEmbedderUsingSteps.java │ │ │ ├── ParentAnnotatedEmbedderUsingNeedle.java │ │ │ └── steps │ │ │ └── NeedleTraderSteps.java │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── examples │ │ │ └── core │ │ │ └── needle │ │ │ └── steps │ │ │ └── NeedleTraderStepsTest.java │ │ └── resources │ │ └── log4j2.properties ├── performance │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── performance │ │ ├── PerformanceStories.java │ │ ├── steps │ │ └── PerformanceSteps.java │ │ └── stories │ │ ├── generate.story │ │ └── parsing.story ├── pico │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── pico │ │ ├── AnnotatedEmbedderUsingPico.java │ │ ├── AnnotatedEmbedderUsingPicoAndSteps.java │ │ ├── AnnotatedPathRunnerUsingPico.java │ │ ├── CoreStoriesUsingPico.java │ │ ├── InheritingAnnotatedEmbedderUsingSteps.java │ │ └── ParentAnnotatedEmbedderUsingPico.java ├── pom.xml ├── rest │ ├── README.md │ ├── pom.xml │ ├── rest.sh │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── examples │ │ │ └── core │ │ │ └── rest │ │ │ ├── RESTStories.java │ │ │ ├── steps │ │ │ └── RESTSteps.java │ │ │ └── stories │ │ │ ├── export.story │ │ │ └── index.story │ │ └── resources │ │ └── stories │ │ ├── domain │ │ ├── first.story │ │ ├── second.story │ │ └── subdomain │ │ │ └── third.story │ │ ├── main.stories │ │ ├── a_story.story │ │ └── another_story.story │ │ ├── main.webhome │ │ ├── rssfeeds.story │ │ └── welcome.story │ │ ├── parent_story.story │ │ ├── some_story.story │ │ └── webhome.story ├── scala │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── examples │ │ │ └── scala │ │ │ ├── ScalaStories.java │ │ │ └── stories │ │ │ └── using_scala.story │ │ └── scala │ │ └── ScalaSteps.scala ├── spring-security │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── example │ │ │ └── spring │ │ │ └── security │ │ │ ├── SpringSecurityStories.java │ │ │ ├── dao │ │ │ ├── OrganizationDao.java │ │ │ ├── OrganizationDaoImpl.java │ │ │ ├── UserDao.java │ │ │ └── UserDaoImpl.java │ │ │ ├── domain │ │ │ ├── AuthenticationPolicy.java │ │ │ ├── AuthenticationPolicyBuilder.java │ │ │ ├── Organization.java │ │ │ ├── User.java │ │ │ └── UserBuilder.java │ │ │ ├── service │ │ │ ├── AuthenticationEventListener.java │ │ │ ├── OrganizationManager.java │ │ │ ├── UserDetailsImpl.java │ │ │ └── UserDetailsServiceImpl.java │ │ │ ├── steps │ │ │ ├── AuthenticationSteps.java │ │ │ ├── DbUnitSteps.java │ │ │ ├── OrganizationSteps.java │ │ │ └── UserSteps.java │ │ │ └── util │ │ │ ├── DateUtils.java │ │ │ └── SecurityUtils.java │ │ └── resources │ │ ├── log4j2.properties │ │ ├── steps.xml │ │ └── stories │ │ ├── default_policy.story │ │ ├── expired_passwords.story │ │ ├── failure_lockouts.story │ │ └── user_flags.story ├── spring │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── spring │ │ ├── AnnotatedEmbedderUsingSpring.java │ │ ├── AnnotatedEmbedderUsingSpringAndSteps.java │ │ ├── AnnotatedEmbedderUsingSpringNamespace.java │ │ ├── AnnotatedPathRunnerUsingSpring.java │ │ ├── CoreEmbedderWithSpringJUnit4ClassRunner.java │ │ ├── CoreStoriesUsingSpring.java │ │ ├── CoreStoriesUsingSpringWithAnnotationConfiguration.java │ │ ├── InheritingAnnotatedEmbedderUsingSteps.java │ │ ├── ParentAnnotatedEmbedderUsingSpring.java │ │ ├── SpringAnnotationConfiguration.java │ │ ├── configuration-namespace.xml │ │ ├── configuration.xml │ │ └── steps.xml ├── stepdocs │ └── pom.xml ├── testng │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── testng │ │ └── CoreStoriesUsingTestNG.java ├── threads │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── threads │ │ ├── ThreadsStories.java │ │ ├── steps │ │ └── ThreadsSteps.java │ │ └── stories │ │ ├── a_failed.story │ │ ├── a_long.story │ │ └── another_long.story ├── upload-reports.sh ├── urls │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jbehave │ │ └── examples │ │ └── core │ │ └── urls │ │ ├── CoreStoriesUsingURLs.java │ │ ├── CoreStoryRunner.java │ │ ├── RemoteCoreStories.java │ │ └── URLCoreEmbedder.java └── weld │ ├── pom.xml │ └── src │ └── main │ └── java │ ├── META-INF │ └── beans.xml │ └── org │ └── jbehave │ └── examples │ └── core │ └── weld │ ├── AnnotatedEmbedderUsingWeld.java │ ├── AnnotatedEmbedderUsingWeldAndSteps.java │ ├── AnnotatedPathRunnerUsingWeld.java │ ├── ConfigurationProducer.java │ ├── CoreStoriesUsingWeld.java │ ├── InheritingAnnotatedEmbedderUsingSteps.java │ ├── ParentAnnotatedEmbedderUsingWeld.java │ ├── WeldCoreSteps.java │ └── WeldStepProducer.java ├── jbehave-core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── core │ │ │ ├── ConfigurableEmbedder.java │ │ │ ├── Embeddable.java │ │ │ ├── InjectableEmbedder.java │ │ │ ├── annotations │ │ │ ├── AfterScenario.java │ │ │ ├── AfterStories.java │ │ │ ├── AfterStory.java │ │ │ ├── Alias.java │ │ │ ├── Aliases.java │ │ │ ├── AsJson.java │ │ │ ├── AsParameterConverter.java │ │ │ ├── AsParameters.java │ │ │ ├── BeforeScenario.java │ │ │ ├── BeforeStories.java │ │ │ ├── BeforeStory.java │ │ │ ├── Composite.java │ │ │ ├── Conditional.java │ │ │ ├── Configure.java │ │ │ ├── FromContext.java │ │ │ ├── Given.java │ │ │ ├── Named.java │ │ │ ├── Parameter.java │ │ │ ├── Pending.java │ │ │ ├── ScenarioType.java │ │ │ ├── Scope.java │ │ │ ├── Then.java │ │ │ ├── ToContext.java │ │ │ ├── UsingEmbedder.java │ │ │ ├── UsingPaths.java │ │ │ ├── UsingSteps.java │ │ │ └── When.java │ │ │ ├── condition │ │ │ ├── InstanceStepConditionMatcher.java │ │ │ ├── ReflectionBasedStepConditionMatcher.java │ │ │ ├── StepConditionMatchException.java │ │ │ └── StepConditionMatcher.java │ │ │ ├── configuration │ │ │ ├── AnnotationBuilder.java │ │ │ ├── AnnotationFinder.java │ │ │ ├── AnnotationMonitor.java │ │ │ ├── AnnotationRequired.java │ │ │ ├── Configuration.java │ │ │ ├── Keywords.java │ │ │ ├── MostUsefulConfiguration.java │ │ │ ├── NullAnnotationMonitor.java │ │ │ ├── ParanamerConfiguration.java │ │ │ ├── PrintStreamAnnotationMonitor.java │ │ │ ├── PrintingAnnotationMonitor.java │ │ │ ├── PropertyBasedConfiguration.java │ │ │ └── UnmodifiableConfiguration.java │ │ │ ├── context │ │ │ ├── Context.java │ │ │ ├── ContextView.java │ │ │ └── JFrameContextView.java │ │ │ ├── embedder │ │ │ ├── AllStepCandidates.java │ │ │ ├── DelegatingEmbedderMonitor.java │ │ │ ├── DuplicateCandidateFound.java │ │ │ ├── Embedder.java │ │ │ ├── EmbedderClassLoader.java │ │ │ ├── EmbedderControls.java │ │ │ ├── EmbedderMonitor.java │ │ │ ├── EmbedderMonitorDecorator.java │ │ │ ├── FilteredStory.java │ │ │ ├── MatchingStepMonitor.java │ │ │ ├── MetaFilter.java │ │ │ ├── NullEmbedderMonitor.java │ │ │ ├── PerformableTree.java │ │ │ ├── PrintStreamEmbedderMonitor.java │ │ │ ├── PrintingEmbedderMonitor.java │ │ │ ├── PropertyBasedEmbedderControls.java │ │ │ ├── ReportingFailuresEmbedderMonitor.java │ │ │ ├── SilentEmbedderMonitor.java │ │ │ ├── StoryControls.java │ │ │ ├── StoryManager.java │ │ │ ├── StoryMapper.java │ │ │ ├── StorySplitter.java │ │ │ ├── StoryTimeouts.java │ │ │ ├── UnmodifiableEmbedderControls.java │ │ │ └── executors │ │ │ │ ├── DirectExecutorService.java │ │ │ │ ├── ExecutorServiceFactory.java │ │ │ │ └── FixedThreadExecutors.java │ │ │ ├── expressions │ │ │ ├── BiArgExpressionProcessor.java │ │ │ ├── DelegatingExpressionProcessor.java │ │ │ ├── ExpressionArguments.java │ │ │ ├── ExpressionProcessor.java │ │ │ ├── ExpressionResolver.java │ │ │ ├── ExpressionResolverMonitor.java │ │ │ ├── MultiArgExpressionProcessor.java │ │ │ ├── NullExpressionResolverMonitor.java │ │ │ ├── PrintStreamExpressionResolverMonitor.java │ │ │ ├── PrintingExpressionResolverMonitor.java │ │ │ ├── RelaxedMultiArgExpressionProcessor.java │ │ │ └── SingleArgExpressionProcessor.java │ │ │ ├── failures │ │ │ ├── BatchFailures.java │ │ │ ├── BeforeOrAfterFailed.java │ │ │ ├── FailingUponPendingStep.java │ │ │ ├── FailureStrategy.java │ │ │ ├── IgnoringStepsFailure.java │ │ │ ├── KnownFailure.java │ │ │ ├── PassingUponPendingStep.java │ │ │ ├── PendingStepFound.java │ │ │ ├── PendingStepStrategy.java │ │ │ ├── PendingStepsFound.java │ │ │ ├── RestartingScenarioFailure.java │ │ │ ├── RestartingStoryFailure.java │ │ │ ├── RethrowingFailure.java │ │ │ ├── SilentlyAbsorbingFailure.java │ │ │ ├── StepFailed.java │ │ │ └── UUIDExceptionWrapper.java │ │ │ ├── i18n │ │ │ └── LocalizedKeywords.java │ │ │ ├── io │ │ │ ├── AbsolutePathCalculator.java │ │ │ ├── AbstractStoryPathResolver.java │ │ │ ├── AncestorDelegatingResolver.java │ │ │ ├── CasePreservingResolver.java │ │ │ ├── CodeLocations.java │ │ │ ├── InvalidStoryResource.java │ │ │ ├── JarFileScanner.java │ │ │ ├── LoadFromClasspath.java │ │ │ ├── LoadFromRelativeFile.java │ │ │ ├── LoadFromURL.java │ │ │ ├── PathCalculator.java │ │ │ ├── RelativePathCalculator.java │ │ │ ├── ResourceLoader.java │ │ │ ├── StoryFinder.java │ │ │ ├── StoryLoader.java │ │ │ ├── StoryLocation.java │ │ │ ├── StoryNameResolver.java │ │ │ ├── StoryPathResolver.java │ │ │ ├── StoryResourceNotFound.java │ │ │ ├── UnderscoredCamelCaseResolver.java │ │ │ └── UnderscoredToCapitalized.java │ │ │ ├── junit │ │ │ ├── AnnotatedEmbedderRunner.java │ │ │ ├── AnnotatedEmbedderUtils.java │ │ │ ├── AnnotatedPathRunner.java │ │ │ ├── JUnit4DescriptionGenerator.java │ │ │ ├── JUnit4StoryReporter.java │ │ │ ├── JUnit4StoryRunner.java │ │ │ ├── JUnitStories.java │ │ │ ├── JUnitStory.java │ │ │ ├── JUnitStoryMaps.java │ │ │ ├── JupiterStories.java │ │ │ └── TextManipulator.java │ │ │ ├── model │ │ │ ├── Alias.java │ │ │ ├── AliasVariant.java │ │ │ ├── Composite.java │ │ │ ├── DelegatingTableTransformerMonitor.java │ │ │ ├── Description.java │ │ │ ├── ExamplesTable.java │ │ │ ├── ExamplesTableFactory.java │ │ │ ├── ExamplesTableStringBuilder.java │ │ │ ├── GivenStories.java │ │ │ ├── GivenStory.java │ │ │ ├── ImmutableExamplesTable.java │ │ │ ├── Lifecycle.java │ │ │ ├── Meta.java │ │ │ ├── Narrative.java │ │ │ ├── NullTableTransformerMonitor.java │ │ │ ├── OutcomesTable.java │ │ │ ├── Scenario.java │ │ │ ├── Step.java │ │ │ ├── StepPattern.java │ │ │ ├── StepsContainer.java │ │ │ ├── Story.java │ │ │ ├── StoryDuration.java │ │ │ ├── StoryLanes.java │ │ │ ├── StoryMap.java │ │ │ ├── StoryMaps.java │ │ │ ├── TableParsers.java │ │ │ ├── TableTransformerMonitor.java │ │ │ ├── TableTransformers.java │ │ │ ├── TableTransformersExecutor.java │ │ │ └── Verbatim.java │ │ │ ├── parsers │ │ │ ├── AbstractRegexParser.java │ │ │ ├── AliasParser.java │ │ │ ├── CompositeParser.java │ │ │ ├── JsonAliasParser.java │ │ │ ├── RegexCompositeParser.java │ │ │ ├── RegexPrefixCapturingPatternParser.java │ │ │ ├── RegexStepMatcher.java │ │ │ ├── RegexStoryParser.java │ │ │ ├── StepMatcher.java │ │ │ ├── StepPatternParser.java │ │ │ ├── StoryParser.java │ │ │ ├── StoryTransformer.java │ │ │ ├── TransformingStoryParser.java │ │ │ └── grammar.ebnf │ │ │ ├── reporters │ │ │ ├── ANSIConsoleOutput.java │ │ │ ├── ConcurrentStoryReporter.java │ │ │ ├── ConsoleOutput.java │ │ │ ├── ContextOutput.java │ │ │ ├── ContextStoryReporter.java │ │ │ ├── DelegatingStoryReporter.java │ │ │ ├── EscapeMode.java │ │ │ ├── FilePrintStreamFactory.java │ │ │ ├── Format.java │ │ │ ├── FreemarkerProcessor.java │ │ │ ├── FreemarkerViewGenerator.java │ │ │ ├── HtmlOutput.java │ │ │ ├── HtmlTemplateOutput.java │ │ │ ├── IdeOnlyConsoleOutput.java │ │ │ ├── JsonOutput.java │ │ │ ├── JsonTemplateOutput.java │ │ │ ├── NullStoryReporter.java │ │ │ ├── PostStoryStatisticsCollector.java │ │ │ ├── PrintStreamFactory.java │ │ │ ├── PrintStreamOutput.java │ │ │ ├── PrintStreamStepdocReporter.java │ │ │ ├── PrintingStepdocReporter.java │ │ │ ├── ReportsCount.java │ │ │ ├── SGRCodes.java │ │ │ ├── SilentSuccessFilter.java │ │ │ ├── StackTraceFormatter.java │ │ │ ├── StepFailureDecorator.java │ │ │ ├── StepdocReporter.java │ │ │ ├── StoryReporter.java │ │ │ ├── StoryReporterBuilder.java │ │ │ ├── SurefireReporter.java │ │ │ ├── TeamCityConsoleOutput.java │ │ │ ├── TemplateProcessor.java │ │ │ ├── TemplateableOutput.java │ │ │ ├── TemplateableViewGenerator.java │ │ │ ├── ThreadSafeReporter.java │ │ │ ├── TxtOutput.java │ │ │ ├── ViewGenerator.java │ │ │ ├── XmlOutput.java │ │ │ └── XmlTemplateOutput.java │ │ │ └── steps │ │ │ ├── AbstractCandidateSteps.java │ │ │ ├── AbstractStepResult.java │ │ │ ├── AbstractStepsFactory.java │ │ │ ├── BeforeOrAfterStep.java │ │ │ ├── CandidateSteps.java │ │ │ ├── ChainedRow.java │ │ │ ├── CompositeCandidateSteps.java │ │ │ ├── CompositeStepsFactory.java │ │ │ ├── ConditionalStepCandidate.java │ │ │ ├── ContextStepMonitor.java │ │ │ ├── ConvertedParameters.java │ │ │ ├── DelegatingStepMonitor.java │ │ │ ├── InjectableStepsFactory.java │ │ │ ├── InstanceStepsFactory.java │ │ │ ├── MarkUnmatchedStepsAsPending.java │ │ │ ├── NullStepMonitor.java │ │ │ ├── ParameterControls.java │ │ │ ├── ParameterConverters.java │ │ │ ├── Parameters.java │ │ │ ├── PatternVariantBuilder.java │ │ │ ├── PendingStepMethodGenerator.java │ │ │ ├── PrintStreamStepMonitor.java │ │ │ ├── PrintingStepMonitor.java │ │ │ ├── ProvidedStepsFactory.java │ │ │ ├── Row.java │ │ │ ├── ScanningStepsFactory.java │ │ │ ├── SilentStepMonitor.java │ │ │ ├── Step.java │ │ │ ├── StepCandidate.java │ │ │ ├── StepCollector.java │ │ │ ├── StepCreator.java │ │ │ ├── StepFinder.java │ │ │ ├── StepMonitor.java │ │ │ ├── StepResult.java │ │ │ ├── StepType.java │ │ │ ├── Stepdoc.java │ │ │ ├── Steps.java │ │ │ ├── Timer.java │ │ │ ├── Timing.java │ │ │ └── context │ │ │ └── StepsContext.java │ └── resources │ │ ├── TableFilter │ │ ├── TF_Modules │ │ │ ├── tf_alternateRows.js │ │ │ ├── tf_colOps.js │ │ │ ├── tf_cookies.js │ │ │ ├── tf_extensions.js │ │ │ ├── tf_ezEditTable.js │ │ │ ├── tf_fixedHeaders.js │ │ │ ├── tf_gridLayout.js │ │ │ ├── tf_highlightKeywords.js │ │ │ ├── tf_loader.js │ │ │ ├── tf_paging.js │ │ │ ├── tf_populateCheckList.js │ │ │ ├── tf_populateSelect.js │ │ │ ├── tf_popupFilters.js │ │ │ ├── tf_publicMethods.js │ │ │ ├── tf_refreshFilters.js │ │ │ ├── tf_resetBtn.js │ │ │ ├── tf_rowsCounter.js │ │ │ ├── tf_sort.js │ │ │ ├── tf_statusBar.js │ │ │ ├── tf_themes.js │ │ │ └── tf_watermark.js │ │ ├── TF_Themes │ │ │ ├── Default │ │ │ │ ├── TF_Default.css │ │ │ │ └── images │ │ │ │ │ ├── bg_infDiv.jpg │ │ │ │ │ ├── bg_th.jpg │ │ │ │ │ ├── btn_eraser.gif │ │ │ │ │ ├── btn_first_page.gif │ │ │ │ │ ├── btn_last_page.gif │ │ │ │ │ ├── btn_next_page.gif │ │ │ │ │ ├── btn_over_eraser.gif │ │ │ │ │ ├── btn_over_first_page.gif │ │ │ │ │ ├── btn_over_last_page.gif │ │ │ │ │ ├── btn_over_next_page.gif │ │ │ │ │ ├── btn_over_previous_page.gif │ │ │ │ │ ├── btn_previous_page.gif │ │ │ │ │ └── img_loading.gif │ │ │ ├── MyTheme │ │ │ │ ├── MyTheme.css │ │ │ │ └── images │ │ │ │ │ ├── bg_headers.jpg │ │ │ │ │ ├── bg_infDiv.jpg │ │ │ │ │ ├── btn_filter.png │ │ │ │ │ ├── btn_first_page.gif │ │ │ │ │ ├── btn_last_page.gif │ │ │ │ │ ├── btn_next_page.gif │ │ │ │ │ ├── btn_previous_page.gif │ │ │ │ │ └── img_loading.gif │ │ │ ├── SkyBlue │ │ │ │ ├── TF_SkyBlue.css │ │ │ │ └── images │ │ │ │ │ ├── bg_skyblue.gif │ │ │ │ │ ├── btn_first_page.gif │ │ │ │ │ ├── btn_last_page.gif │ │ │ │ │ ├── btn_next_page.gif │ │ │ │ │ ├── btn_prev_page.gif │ │ │ │ │ ├── icn_clear_filters.png │ │ │ │ │ └── img_loading.gif │ │ │ ├── blank.png │ │ │ ├── btn_clear_filters.png │ │ │ ├── btn_filter.png │ │ │ ├── btn_first_page.gif │ │ │ ├── btn_last_page.gif │ │ │ ├── btn_next_page.gif │ │ │ ├── btn_previous_page.gif │ │ │ ├── downsimple.png │ │ │ ├── icn_filter.gif │ │ │ ├── icn_filterActive.gif │ │ │ └── upsimple.png │ │ ├── filtergrid.css │ │ ├── tablefilter.js │ │ ├── tablefilter_all.js │ │ ├── tablefilter_all_min.js │ │ └── tablefilter_min.js │ │ ├── ftl │ │ ├── jbehave-html-output.ftl │ │ ├── jbehave-json-output.ftl │ │ ├── jbehave-maps.ftl │ │ ├── jbehave-report-decorated.ftl │ │ ├── jbehave-report-non-decorated.ftl │ │ ├── jbehave-reports.ftl │ │ ├── jbehave-views.ftl │ │ ├── jbehave-xml-output.ftl │ │ ├── sh.ftl │ │ └── surefire-xml-report.ftl │ │ ├── i18n │ │ ├── keywords_de.properties │ │ ├── keywords_en.properties │ │ ├── keywords_es.properties │ │ ├── keywords_fi.properties │ │ ├── keywords_fr.properties │ │ ├── keywords_hu.properties │ │ ├── keywords_it.properties │ │ ├── keywords_no.properties │ │ ├── keywords_pl.properties │ │ ├── keywords_pt.properties │ │ ├── keywords_ru.properties │ │ ├── keywords_ru_sbt.properties │ │ ├── keywords_sv.properties │ │ ├── keywords_tr.properties │ │ ├── keywords_zh_CN.properties │ │ └── keywords_zh_TW.properties │ │ ├── jbehave.version │ │ ├── style │ │ └── jbehave-core.css │ │ └── xsd │ │ └── surefire-test-report.xsd │ └── test │ ├── java │ ├── DefaultPackageEmbeddable.java │ └── org │ │ └── jbehave │ │ └── core │ │ ├── ConfigurableEmbedderBehaviour.java │ │ ├── InjectableEmbedderBehaviour.java │ │ ├── condition │ │ ├── InstanceStepConditionMatcherBehaviour.java │ │ └── ReflectionBasedStepConditionMatcherBehaviour.java │ │ ├── configuration │ │ ├── AnnotationBuilderBehaviour.java │ │ ├── AnnotationFinderBehaviour.java │ │ ├── KeywordsBehaviour.java │ │ ├── ParanamerConfigurationBehaviour.java │ │ ├── PropertyBasedConfigurationBehaviour.java │ │ └── UnmodifiableConfigurationBehaviour.java │ │ ├── embedder │ │ ├── AllStepCandidatesBehaviour.java │ │ ├── ConcurrencyBehaviour.java │ │ ├── EmbedderBehaviour.java │ │ ├── EmbedderClassLoaderBehaviour.java │ │ ├── EmbedderControlsBehaviour.java │ │ ├── EmbedderMonitorBehaviour.java │ │ ├── ExpressionResolverBehaviour.java │ │ ├── MetaFilterBehaviour.java │ │ ├── PerformableTreeBehaviour.java │ │ ├── PerformableTreeConversionBehaviour.java │ │ ├── StoryControlsBehaviour.java │ │ ├── StoryManagerBehaviour.java │ │ ├── StoryMapperBehaviour.java │ │ ├── StorySplitterBehaviour.java │ │ ├── StoryTimeoutsBehaviour.java │ │ ├── a_long.story │ │ ├── a_short.story │ │ ├── another_long.story │ │ └── executors │ │ │ └── ExecutorsBehaviour.java │ │ ├── expressions │ │ ├── BiArgExpressionProcessorBehaviour.java │ │ ├── ExpressionArgumentsBehaviour.java │ │ ├── MultiArgExpressionProcessorBehaviour.java │ │ ├── RelaxedMultiArgExpressionProcessorBehaviour.java │ │ └── SingleArgExpressionProcessorBehaviour.java │ │ ├── failures │ │ ├── FailureStrategyBehaviour.java │ │ └── StepFailureBehaviour.java │ │ ├── i18n │ │ └── LocalizedKeywordsBehaviour.java │ │ ├── io │ │ ├── CodeLocationsBehaviour.java │ │ ├── JarFileScannerBehaviour.java │ │ ├── LoadFromRelativeFileBehaviour.java │ │ ├── RelativePathCalculatorBehaviour.java │ │ ├── StoryFinderBehaviour.java │ │ ├── StoryLoaderBehaviour.java │ │ ├── StoryLocationBehaviour.java │ │ ├── StoryNameResolverBehaviour.java │ │ ├── StoryPathResolverBehaviour.java │ │ ├── UnderscoredToCapitalizedBehaviour.java │ │ └── stories │ │ │ ├── MyGroovyStory.groovy │ │ │ ├── MyMultipleStory.java │ │ │ ├── MyPendingStory.java │ │ │ ├── MyPendingStory.txt │ │ │ ├── MyStory.java │ │ │ ├── [mage_hg] │ │ │ └── MyPendingStory.txt │ │ │ ├── foldername has spaces │ │ │ └── MyPendingStory.txt │ │ │ ├── my_dependent_story │ │ │ ├── my_given_story │ │ │ ├── my_multiple_story │ │ │ ├── my_pending_story │ │ │ └── my_pending_story.txt │ │ ├── junit │ │ ├── IgnoredTestsBehaviour.java │ │ ├── JUnit4DescriptionGeneratorBehaviour.java │ │ ├── JUnit4StoryReporterBehaviour.java │ │ ├── JUnit4StoryRunnerBehaviour.java │ │ ├── JUnitStoryPathsExtractionBehaviour.java │ │ ├── TextManipulatorBehaviour.java │ │ ├── steps │ │ │ ├── ExampleSteps.java │ │ │ └── InitSteps.java │ │ └── story │ │ │ ├── ExampleScenarioJUnitStories.java │ │ │ ├── ExampleScenarioJUnitStoriesLocalized.java │ │ │ ├── ExampleScenarioJUnitStory.java │ │ │ ├── FailedStepInFirstScenarioAndSecondScenarioPassesJUnitStory.java │ │ │ ├── FailedStepInScenarioJUnitStory.java │ │ │ ├── FilteredOutScenariosNotStory.java │ │ │ ├── LifecycleStepsStory.java │ │ │ ├── LifecycleStepsStoryWithExamples.java │ │ │ ├── MathStories.java │ │ │ ├── ShowIgnoredScenariosAsIgnoredAndNotPassedStory.java │ │ │ └── StoriesWithAllSortsOfBeforeAndAfter.java │ │ ├── model │ │ ├── ExamplesTableBehaviour.java │ │ ├── ExamplesTableFactoryBehaviour.java │ │ ├── ExamplesTableStringBuilderBehaviour.java │ │ ├── GivenStoriesBehaviour.java │ │ ├── ImmutableExamplesTableBehaviour.java │ │ ├── LifecycleBehaviour.java │ │ ├── MetaBehaviour.java │ │ ├── OutcomesTableBehaviour.java │ │ ├── StoryBehaviour.java │ │ ├── StoryDurationBehaviour.java │ │ ├── StoryMapsBehaviour.java │ │ ├── TableParsersBehaviour.java │ │ ├── TablePropertiesBehaviour.java │ │ ├── TableTransformersBehaviour.java │ │ └── TableTransformersExecutorBehaviour.java │ │ ├── parsers │ │ ├── JsonAliasParserBehaviour.java │ │ ├── RegexCompositeParserBehaviour.java │ │ ├── RegexPrefixCapturingPatternParserBehaviour.java │ │ ├── RegexStoryParserBehaviour.java │ │ └── TransformingStoryParserBehaviour.java │ │ ├── reporters │ │ ├── ANSIConsoleOutputBehaviour.java │ │ ├── AbstractOutputBehaviour.java │ │ ├── DelegatingStoryReporterBehaviour.java │ │ ├── FilePrintStreamFactoryBehaviour.java │ │ ├── FreemarkerViewGeneratorBehaviour.java │ │ ├── NullStoryReporterBehaviour.java │ │ ├── PostStoryStatisticsCollectorBehaviour.java │ │ ├── PrintStreamOutputBehaviour.java │ │ ├── SilentSuccessFilterBehaviour.java │ │ ├── StackTraceFormatterBehaviour.java │ │ ├── StepFailureDecoratorBehaviour.java │ │ ├── StoryNarrator.java │ │ ├── StoryReporterBuilderBehaviour.java │ │ ├── SurefireReporterBehaviour.java │ │ ├── TemplateOutputBehaviour.java │ │ ├── reports │ │ │ ├── index.html │ │ │ ├── report1.html │ │ │ ├── report1.txt │ │ │ ├── report2.html │ │ │ └── report2.txt │ │ ├── surefire-breadcrumb.xml │ │ └── surefire-simple.xml │ │ └── steps │ │ ├── AnnotationNamedParameterSteps.java │ │ ├── BeforeOrAfterStepBehaviour.java │ │ ├── ChainedRowBehaviour.java │ │ ├── CompositeCandidateStepsBehaviour.java │ │ ├── ConcurrencyBehaviour.java │ │ ├── ConvertedParametersBehaviour.java │ │ ├── InstanceStepsFactoryBehaviour.java │ │ ├── JBehaveMatchers.java │ │ ├── Jsr330AnnotationNamedParameterSteps.java │ │ ├── MarkUnmatchedStepsAsPendingBehaviour.java │ │ ├── ParameterConvertersBehaviour.java │ │ ├── ParanamerNamedParameterSteps.java │ │ ├── PatternVariantBuilderBehaviour.java │ │ ├── PendingStepMethodGeneratorBehaviour.java │ │ ├── PrintStreamStepMonitorBehaviour.java │ │ ├── ScanningStepsFactoryBehaviour.java │ │ ├── SomeSteps.java │ │ ├── StepCandidateBehaviour.java │ │ ├── StepCreatorBehaviour.java │ │ ├── StepFinderBehaviour.java │ │ ├── StepResultBehaviour.java │ │ ├── StepsBehaviour.java │ │ ├── scan │ │ ├── GivenOnly.java │ │ ├── GivenWhen.java │ │ ├── GivenWhenThen.java │ │ └── NotAnnotated.java │ │ └── scan2 │ │ └── NotAnnotated.java │ ├── log4j2.properties │ └── resources │ ├── composite.steps │ ├── data-reference.table │ ├── data-simple-reference.table │ ├── data-simple.table │ ├── data.table │ ├── given-story-examples.json │ ├── i18n │ ├── keywords_mk.properties │ ├── keywords_sy.properties │ └── synonyms_en.properties │ ├── org │ └── jbehave │ │ └── core │ │ ├── junit │ │ └── story │ │ │ ├── Empty.story │ │ │ ├── Greetings.story │ │ │ ├── GreetingsFromExtraterrestrials.story │ │ │ ├── Init.story │ │ │ ├── Multiplication.story │ │ │ ├── MultiplicationWithExamplesAndGiven.story │ │ │ ├── Multiplication_de.story │ │ │ ├── ParameterizedGreetings.story │ │ │ ├── example_scenario_j_unit_story.story │ │ │ ├── failed_step_in_first_scenario_and_second_scenario_passes_j_unit_story.story │ │ │ ├── failed_step_in_scenario_j_unit_story.story │ │ │ ├── filtered_out_scenarios_not_story.story │ │ │ ├── lifecycle_steps_story.story │ │ │ ├── lifecycle_steps_story_with_examples.story │ │ │ └── show_ignored_scenarios_as_ignored_and_not_passed_story.story │ │ ├── parsers │ │ ├── aliases-main.json │ │ ├── aliases-with-same-step.json │ │ └── aliases-wrong-step-type-in-alias.json │ │ └── steps │ │ └── aliases.json │ ├── stories.jar │ ├── story-empty-scenario-with-lifecycle.json │ ├── story-level-examples.json │ ├── stream-story-custom-patterns.html │ ├── stream-story-custom-patterns.txt │ ├── stream-story-custom-patterns.xml │ ├── stream-story-excluded.html │ ├── stream-story-excluded.txt │ ├── stream-story-excluded.xml │ ├── stream-story.html │ ├── stream-story.json │ ├── stream-story.txt │ ├── stream-story.xml │ ├── template-story-pending-method.html │ ├── template-story-pending-method.json │ ├── template-story-pending-method.xml │ ├── template-story.html │ ├── template-story.json │ ├── template-story.xml │ ├── test+dir │ └── dummy.story │ └── testfile ├── jbehave-gherkin ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ └── parsers │ │ └── gherkin │ │ └── GherkinStoryParser.java │ └── test │ └── java │ └── org │ └── jbehave │ └── core │ └── parsers │ └── gherkin │ └── GherkinStoryParserBehaviour.java ├── jbehave-google ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ └── io │ │ └── google │ │ └── LoadOdtFromGoogle.java │ └── test │ └── java │ └── org │ └── jbehave │ └── core │ └── io │ └── google │ └── GoogleOdtLoaderBehaviour.java ├── jbehave-groovy ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ ├── annotations │ │ └── groovy │ │ │ └── UsingGroovy.java │ │ ├── configuration │ │ └── groovy │ │ │ ├── BytecodeGroovyClassLoader.java │ │ │ ├── GroovyAnnotationBuilder.java │ │ │ ├── GroovyContext.java │ │ │ └── GroovyResourceFinder.java │ │ ├── junit │ │ └── groovy │ │ │ └── GroovyAnnotatedEmbedderRunner.java │ │ └── steps │ │ └── groovy │ │ └── GroovyStepsFactory.java │ └── test │ └── java │ └── org │ └── jbehave │ └── core │ ├── configuration │ └── groovy │ │ ├── BytecodeGroovyClassLoaderBehaviour.java │ │ ├── GroovyAnnotationBuilderBehaviour.java │ │ └── fooSteps.groovy │ ├── junit │ └── groovy │ │ └── GroovyAnnotatedEmbedderRunnerBehaviour.java │ └── steps │ └── groovy │ ├── GroovyStepsFactoryBehaviour.java │ ├── annotatedSteps.groovy │ ├── invalidSteps.groovy │ └── notAnnotatedSteps.groovy ├── jbehave-guice ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ ├── annotations │ │ └── guice │ │ │ └── UsingGuice.java │ │ ├── configuration │ │ └── guice │ │ │ └── GuiceAnnotationBuilder.java │ │ ├── junit │ │ └── guice │ │ │ ├── GuiceAnnotatedEmbedderRunner.java │ │ │ └── GuiceAnnotatedPathRunner.java │ │ └── steps │ │ └── guice │ │ └── GuiceStepsFactory.java │ └── test │ └── java │ └── org │ └── jbehave │ └── core │ ├── configuration │ └── guice │ │ └── GuiceAnnotationBuilderBehaviour.java │ ├── junit │ └── guice │ │ └── GuiceAnnotatedEmbedderRunnerBehaviour.java │ └── steps │ └── guice │ └── GuiceStepsFactoryBehaviour.java ├── jbehave-io ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── io │ │ ├── ArchivingFileManager.java │ │ ├── FileArchiveFailedException.java │ │ ├── FileArchiver.java │ │ ├── FileManager.java │ │ ├── FileMonitor.java │ │ ├── FileUnarchiveFailedException.java │ │ ├── PrintStreamFileMonitor.java │ │ ├── ResourceFinder.java │ │ ├── SilentFileMonitor.java │ │ └── ZipFileArchiver.java │ └── test │ ├── java │ └── org │ │ └── jbehave │ │ └── io │ │ ├── ArchivingFileManagerBehaviour.java │ │ ├── ResourceFinderBehaviour.java │ │ ├── ZipFileArchiverBehaviour.java │ │ └── resource.txt │ └── resources │ └── archive.zip ├── jbehave-maven-plugin ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── mojo │ │ ├── AbstractEmbedderMojo.java │ │ ├── GenerateStoriesView.java │ │ ├── MapStoriesAsEmbeddables.java │ │ ├── MapStoriesAsPaths.java │ │ ├── ReportStepdocs.java │ │ ├── ReportStepdocsAsEmbeddables.java │ │ ├── RunStoriesAsEmbeddables.java │ │ ├── RunStoriesAsPaths.java │ │ ├── RunStoriesWithAnnotatedEmbedderRunner.java │ │ └── UnpackViewResources.java │ └── test │ └── java │ └── org │ └── jbehave │ └── mojo │ ├── EmbedderMojoBehaviour.java │ └── stories │ ├── Embeddable1.java │ ├── Embeddable2.java │ ├── first.story │ └── second.story ├── jbehave-needle ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── core │ │ │ ├── annotations │ │ │ └── needle │ │ │ │ ├── NeedleInjectionProvider.java │ │ │ │ └── UsingNeedle.java │ │ │ ├── configuration │ │ │ └── needle │ │ │ │ └── NeedleAnnotationBuilder.java │ │ │ ├── junit │ │ │ └── needle │ │ │ │ ├── NeedleAnnotatedEmbedderRunner.java │ │ │ │ └── NeedleAnnotatedPathRunner.java │ │ │ └── steps │ │ │ └── needle │ │ │ ├── NeedleStepsFactory.java │ │ │ └── configuration │ │ │ ├── CollectInjectionProvidersFromStepsInstance.java │ │ │ ├── CreateInstanceByDefaultConstructor.java │ │ │ ├── JBehaveNeedleConfiguration.java │ │ │ ├── LoadResourceBundle.java │ │ │ └── ReadInjectionProviderClassNames.java │ └── resources │ │ └── needle.properties │ └── test │ ├── java │ └── org │ │ └── jbehave │ │ └── core │ │ ├── configuration │ │ └── needle │ │ │ ├── NeedleAnnotationBuilderBehaviour.java │ │ │ └── ValueGetterProvider.java │ │ ├── junit │ │ └── needle │ │ │ └── NeedleAnnotatedEmbedderRunnerBehaviour.java │ │ └── steps │ │ └── needle │ │ ├── NeedleStepsFactoryBehaviour.java │ │ └── ValueGetter.java │ └── resources │ ├── jbehave-needle.properties │ └── log4j2.properties ├── jbehave-odf ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ └── io │ │ └── odf │ │ ├── LoadOdtFromClasspath.java │ │ ├── LoadOdtFromURL.java │ │ └── OdfUtils.java │ └── test │ └── java │ └── org │ └── jbehave │ └── core │ └── io │ └── odf │ ├── OdtLoaderBehaviour.java │ └── stories │ ├── a_story.odt │ └── a_story.txt ├── jbehave-pico ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ ├── annotations │ │ └── pico │ │ │ └── UsingPico.java │ │ ├── configuration │ │ └── pico │ │ │ ├── PicoAnnotationBuilder.java │ │ │ └── PicoModule.java │ │ ├── junit │ │ └── pico │ │ │ ├── PicoAnnotatedEmbedderRunner.java │ │ │ └── PicoAnnotatedPathRunner.java │ │ └── steps │ │ └── pico │ │ └── PicoStepsFactory.java │ └── test │ └── java │ └── org │ └── jbehave │ └── core │ ├── configuration │ └── pico │ │ └── PicoAnnotationBuilderBehaviour.java │ ├── junit │ └── pico │ │ └── PicoAnnotatedEmbedderRunnerBehaviour.java │ └── steps │ └── pico │ └── PicoStepsFactoryBehaviour.java ├── jbehave-rest ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ └── io │ │ └── rest │ │ ├── IndexWithBreadcrumbs.java │ │ ├── LoadFromREST.java │ │ ├── RESTClient.java │ │ ├── Resource.java │ │ ├── ResourceExporter.java │ │ ├── ResourceImporter.java │ │ ├── ResourceIndexer.java │ │ ├── ResourceNameResolver.java │ │ ├── ResourceUploader.java │ │ ├── UploadToREST.java │ │ ├── confluence │ │ ├── Confluence.java │ │ ├── IndexFromConfluence.java │ │ └── LoadFromConfluence.java │ │ ├── filesystem │ │ ├── ExportFromFilesystem.java │ │ ├── FilesystemUtils.java │ │ └── ImportToFilesystem.java │ │ ├── mojo │ │ ├── AbstractFilesystemMojo.java │ │ ├── ExportFromFilesystemMojo.java │ │ └── ImportToFilesystemMojo.java │ │ ├── redmine │ │ ├── IndexFromRedmine.java │ │ ├── LoadFromRedmine.java │ │ └── UploadToRedmine.java │ │ └── xwiki │ │ ├── IndexFromXWiki.java │ │ ├── LoadFromXWiki.java │ │ └── UploadToXWiki.java │ └── test │ ├── java │ └── org │ │ └── jbehave │ │ └── core │ │ └── io │ │ └── rest │ │ ├── IndexWithBreadcrumbsBehaviour.java │ │ ├── LoadFromRestBehaviour.java │ │ ├── confluence │ │ ├── IndexFromConfluenceBehaviour.java │ │ └── LoadFromConfluenceBehaviour.java │ │ ├── filesystem │ │ ├── ExportFromFilesystemBehaviour.java │ │ └── ImportToFilesystemBehaviour.java │ │ ├── mojo │ │ └── ImportToFilesystemMojoBehaviour.java │ │ ├── redmine │ │ ├── IndexFromRedmineBehaviour.java │ │ ├── LoadFromRedmineBehaviour.java │ │ └── UploadToRedmineBehaviour.java │ │ └── xwiki │ │ ├── IndexFromXWikiBehaviour.java │ │ ├── LoadFromXWikiBehaviour.java │ │ └── UploadToXWikiBehaviour.java │ └── resources │ ├── confluence-search.xml │ ├── confluence-story-expanded.xml │ ├── confluence-story.xml │ ├── redmine-index.json │ ├── redmine.json │ ├── redmine.xml │ ├── stories │ ├── A_first.story │ ├── A_second.story │ └── domain │ │ └── A_third.story │ ├── xwiki-index.json │ ├── xwiki.json │ └── xwiki.xml ├── jbehave-scala ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ ├── configuration │ │ └── scala │ │ │ └── ScalaContext.java │ │ └── steps │ │ └── scala │ │ └── ScalaStepsFactory.java │ └── test │ ├── java │ └── org │ │ └── jbehave │ │ └── core │ │ └── steps │ │ └── scala │ │ └── ScalaStepsFactoryBehaviour.java │ └── scala │ ├── AnnotatedSteps.scala │ └── NonAnnotatedSteps.scala ├── jbehave-spring ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jbehave │ │ └── core │ │ ├── annotations │ │ └── spring │ │ │ └── UsingSpring.java │ │ ├── configuration │ │ └── spring │ │ │ ├── SpringAnnotationBuilder.java │ │ │ ├── SpringEmbedderControls.java │ │ │ ├── SpringParameterControls.java │ │ │ ├── SpringStoryControls.java │ │ │ └── SpringStoryReporterBuilder.java │ │ ├── junit │ │ └── spring │ │ │ ├── SpringAnnotatedEmbedderRunner.java │ │ │ └── SpringAnnotatedPathRunner.java │ │ └── steps │ │ └── spring │ │ ├── SpringApplicationContextFactory.java │ │ └── SpringStepsFactory.java │ └── test │ └── java │ └── org │ └── jbehave │ └── core │ ├── configuration │ └── spring │ │ ├── SpringAnnotationBuilderBehaviour.java │ │ ├── SpringStoryReporterBuilderBehaviour.java │ │ └── configuration.xml │ ├── junit │ └── spring │ │ └── SpringAnnotatedEmbedderRunnerBehaviour.java │ └── steps │ └── spring │ ├── SpringStepsFactoryAOPBehaviour.java │ ├── SpringStepsFactoryBehaviour.java │ ├── steps-with-dependency.xml │ ├── steps-with-missing-dependency.xml │ └── steps.xml ├── jbehave-weld ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jbehave │ │ │ └── core │ │ │ ├── annotations │ │ │ └── weld │ │ │ │ ├── UsingWeld.java │ │ │ │ ├── WeldConfiguration.java │ │ │ │ └── WeldStep.java │ │ │ ├── configuration │ │ │ └── weld │ │ │ │ ├── WeldAnnotationBuilder.java │ │ │ │ └── WeldBootstrap.java │ │ │ ├── junit │ │ │ └── weld │ │ │ │ ├── WeldAnnotatedEmbedderRunner.java │ │ │ │ └── WeldAnnotatedPathRunner.java │ │ │ └── steps │ │ │ └── weld │ │ │ └── WeldStepsFactory.java │ └── resources │ │ └── META-INF │ │ └── beans.xml │ └── test │ ├── java │ └── org │ │ └── jbehave │ │ └── core │ │ ├── configuration │ │ └── weld │ │ │ ├── ConfigurationProducer.java │ │ │ └── WeldAnnotationBuilderBehaviour.java │ │ └── junit │ │ └── weld │ │ └── WeldAnnotatedEmbedderRunnerBehaviour.java │ └── resources │ └── META-INF │ └── beans.xml ├── mvnw ├── mvnw.cmd ├── pom.xml └── settings.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .classpath 3 | .project 4 | .settings/ 5 | .idea/ 6 | *.iml 7 | *.ipr 8 | *.iws 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /DEPLOY.md: -------------------------------------------------------------------------------- 1 | # Deploy JBehave 2 | 3 | ## Clone JBehave Site 4 | 5 | Clone jbehave-site to external path, eg to a sibling dir: 6 | 7 | ```` 8 | $ git clone git@bitbucket.org:jbehave/jbehave-site.git ../site 9 | ```` 10 | 11 | ## Deploy release version 12 | 13 | ```` 14 | $ ../site/release.sh jbehave 15 | ```` 16 | 17 | where: 18 | 19 | - version is the release version, e.g. 5.0 20 | - qualifier is the type of release, stable or preview 21 | - next is the next snapshot version, e.g. 5.1-SNAPSHOT 22 | 23 | 24 | ## Deploy snapshot version 25 | 26 | ```` 27 | $ ../site/shapshot.sh jbehave 28 | ```` 29 | 30 | where: 31 | 32 | - version is the snapshot version, e.g. 5.1-SNAPSHOT 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /archetypes/jbehave-groovy-archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jbehave 5 | jbehave-archetypes 6 | 6.0-SNAPSHOT 7 | 8 | jbehave-groovy-archetype 9 | maven-archetype 10 | 11 | JBehave Groovy Archetype 12 | 13 | An archetype to run multiple textual stories with steps classes written in Groovy. 14 | 15 | 16 | -------------------------------------------------------------------------------- /archetypes/jbehave-groovy-archetype/src/main/resources/archetype-resources/src/main/groovy/configuration/MyReporterBuilder.groovy: -------------------------------------------------------------------------------- 1 | import static org.jbehave.core.reporters.Format.CONSOLE; 2 | import static org.jbehave.core.reporters.Format.HTML; 3 | import static org.jbehave.core.reporters.Format.TXT; 4 | import static org.jbehave.core.reporters.Format.XML; 5 | 6 | import org.jbehave.core.reporters.StoryReporterBuilder; 7 | 8 | class MyReportBuilder extends StoryReporterBuilder { 9 | public MyReportBuilder() { 10 | this.withFormats(CONSOLE, TXT, HTML, XML).withDefaultFormats(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /archetypes/jbehave-groovy-archetype/src/main/resources/archetype-resources/src/main/resources/stories/my.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: A scenario with groovy steps 3 | 4 | Given a date of 10/16/2010 5 | When 2 days pass 6 | Then the date is 10/18/2010 7 | And some otherwise ambiguous two string step, with one and two as strings 8 | 9 | -------------------------------------------------------------------------------- /archetypes/jbehave-guice-archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jbehave 5 | jbehave-archetypes 6 | 6.0-SNAPSHOT 7 | 8 | jbehave-guice-archetype 9 | maven-archetype 10 | 11 | JBehave Guice Archetype 12 | 13 | An archetype to run multiple textual stories configured programmatically but with steps classes composed using Guice. 14 | 15 | 16 | -------------------------------------------------------------------------------- /archetypes/jbehave-guice-archetype/src/main/resources/archetype-resources/src/main/java/steps/MySteps.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.steps; 5 | 6 | import org.jbehave.core.annotations.Given; 7 | import org.jbehave.core.annotations.Pending; 8 | import org.jbehave.core.annotations.Then; 9 | import org.jbehave.core.annotations.When; 10 | 11 | public class MySteps { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /archetypes/jbehave-guice-archetype/src/main/resources/archetype-resources/src/main/resources/stories/my.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: A scenario with some pending steps 3 | 4 | Given I am a pending step 5 | And I am still pending step 6 | When a good soul will implement me 7 | Then I shall be happy 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /archetypes/jbehave-needle-archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jbehave 5 | jbehave-archetypes 6 | 6.0-SNAPSHOT 7 | 8 | jbehave-needle-archetype 9 | maven-archetype 10 | 11 | JBehave Needle Archetype 12 | 13 | An archetype to run multiple textual stories configured programmatically but with steps classes composed using Needle. 14 | 15 | 16 | -------------------------------------------------------------------------------- /archetypes/jbehave-needle-archetype/src/main/resources/archetype-resources/src/main/java/steps/SpecialService.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.steps; 5 | 6 | public interface SpecialService { 7 | 8 | boolean makeHappy(); 9 | } 10 | -------------------------------------------------------------------------------- /archetypes/jbehave-needle-archetype/src/main/resources/archetype-resources/src/main/java/steps/UsualService.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.steps; 5 | 6 | public interface UsualService { 7 | 8 | void goodSoul(); 9 | 10 | void isStillStep(); 11 | 12 | void aStep(); 13 | } 14 | -------------------------------------------------------------------------------- /archetypes/jbehave-needle-archetype/src/main/resources/archetype-resources/src/main/resources/stories/my.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: A scenario with some pending steps 3 | 4 | Given I am a pending step 5 | And I am still pending step 6 | When a good soul will implement me 7 | Then I shall be happy 8 | -------------------------------------------------------------------------------- /archetypes/jbehave-pico-archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jbehave 5 | jbehave-archetypes 6 | 6.0-SNAPSHOT 7 | 8 | jbehave-pico-archetype 9 | maven-archetype 10 | 11 | JBehave Pico Archetype 12 | 13 | An archetype to run multiple textual stories configured programmatically but with steps classes composed using Pico. 14 | 15 | 16 | -------------------------------------------------------------------------------- /archetypes/jbehave-pico-archetype/src/main/resources/archetype-resources/src/main/java/steps/MySteps.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.steps; 5 | 6 | import org.jbehave.core.annotations.Given; 7 | import org.jbehave.core.annotations.Pending; 8 | import org.jbehave.core.annotations.Then; 9 | import org.jbehave.core.annotations.When; 10 | 11 | public class MySteps { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /archetypes/jbehave-pico-archetype/src/main/resources/archetype-resources/src/main/resources/stories/my.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: A scenario with some pending steps 3 | 4 | Given I am a pending step 5 | And I am still pending step 6 | When a good soul will implement me 7 | Then I shall be happy 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /archetypes/jbehave-simple-archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jbehave 5 | jbehave-archetypes 6 | 6.0-SNAPSHOT 7 | 8 | jbehave-simple-archetype 9 | maven-archetype 10 | 11 | JBehave Simple Archetype 12 | 13 | An archetype to run multiple textual stories configured programmatically. 14 | 15 | 16 | -------------------------------------------------------------------------------- /archetypes/jbehave-simple-archetype/src/main/resources/archetype-resources/src/main/java/steps/MySteps.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.steps; 5 | 6 | import org.jbehave.core.annotations.Given; 7 | import org.jbehave.core.annotations.Pending; 8 | import org.jbehave.core.annotations.Then; 9 | import org.jbehave.core.annotations.When; 10 | 11 | public class MySteps { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /archetypes/jbehave-simple-archetype/src/main/resources/archetype-resources/src/main/resources/stories/my.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: A scenario with some pending steps 3 | 4 | Given I am a pending step 5 | And I am still pending step 6 | When a good soul will implement me 7 | Then I shall be happy 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /archetypes/jbehave-spring-archetype/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jbehave 5 | jbehave-archetypes 6 | 6.0-SNAPSHOT 7 | 8 | jbehave-spring-archetype 9 | maven-archetype 10 | 11 | JBehave Spring Archetype 12 | 13 | An archetype to run multiple textual stories configured programmatically but with steps classes composed using Spring. 14 | 15 | 16 | -------------------------------------------------------------------------------- /archetypes/jbehave-spring-archetype/src/main/resources/archetype-resources/src/main/java/steps/MySteps.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.steps; 5 | 6 | import org.jbehave.core.annotations.Given; 7 | import org.jbehave.core.annotations.Pending; 8 | import org.jbehave.core.annotations.Then; 9 | import org.jbehave.core.annotations.When; 10 | 11 | public class MySteps { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /archetypes/jbehave-spring-archetype/src/main/resources/archetype-resources/src/main/resources/my_steps.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /archetypes/jbehave-spring-archetype/src/main/resources/archetype-resources/src/main/resources/stories/my.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: A scenario with some pending steps 3 | 4 | Given I am a pending step 5 | And I am still pending step 6 | When a good soul will implement me 7 | Then I shall be happy 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /archetypes/src/test/resources/projects/sample/archetype.properties: -------------------------------------------------------------------------------- 1 | version=1.0-SNAPSHOT 2 | groupId=com.sample 3 | artifactId=sample 4 | jbehaveCoreVersion=${project.version} 5 | jbehaveSiteVersion=3.4.1 6 | package=com.sample 7 | -------------------------------------------------------------------------------- /archetypes/src/test/resources/projects/sample/goal.txt: -------------------------------------------------------------------------------- 1 | package -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | CWD=`pwd` 5 | MVN="mvn -s $CWD/settings.xml" 6 | PROFILES=examples 7 | 8 | $MVN -U clean install -P $PROFILES 9 | 10 | -------------------------------------------------------------------------------- /distribution/README.md: -------------------------------------------------------------------------------- 1 | To build site with standalone XSite: 2 | 3 | 1. Download http://search.maven.org/#search%7Cga%7C1%7Cxsite-distribution 4 | 2. Unzip to local dir, eg ~/xsite, add env XSITE_HOME=~/xsite and $XSITE_HOME/bin to $PATH (as per Maven convention) 5 | 3. xsite -Ssrc/site -mcontent/sitemap.xml -stemplates/skin.html -Rresources -otarget/xsite -------------------------------------------------------------------------------- /distribution/src/site/content/continuous-integration.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Continuous Integration 6 | 7 | 8 | 9 |

CI Builds

10 | 11 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /distribution/src/site/content/issue-tracking.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Issue Tracking 7 | 8 | 9 | 10 |

JIRA

11 | 12 |

JBehave uses JIRA as issue tracking and planning tool.

13 | 14 |

We welcome user input in driving our development priorities. You can suggest new features or enhancements to an existing ones.

15 | 16 |

Please refer to how to contribute for the recommended process of contribution.

17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /distribution/src/site/content/mailing-lists.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Mailing Lists 4 | 5 | 6 | 7 |

Mailing Lists

8 | 9 |

See JBehave Mailing Lists.

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /distribution/src/site/content/more-on-bdd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | More on BDD 5 | 6 | 7 | 8 | 9 |

Resources on the Web

10 | 11 |

You can find out more about behaviour-driven development on behaviour-driven.org.

13 |

Newcomers are encouraged to start from Introducing BDD.

15 | 16 |
17 |
18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /distribution/src/site/key/Images.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/distribution/src/site/key/Images.key -------------------------------------------------------------------------------- /distribution/src/site/resources/README: -------------------------------------------------------------------------------- 1 | Directory includes any resources that may override defaults contained in XSite. 2 | -------------------------------------------------------------------------------- /distribution/src/site/resources/images/Images.001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/distribution/src/site/resources/images/Images.001.png -------------------------------------------------------------------------------- /distribution/src/site/resources/images/Images.002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/distribution/src/site/resources/images/Images.002.png -------------------------------------------------------------------------------- /distribution/src/site/resources/images/Images.003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/distribution/src/site/resources/images/Images.003.png -------------------------------------------------------------------------------- /distribution/src/site/resources/images/Images.004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/distribution/src/site/resources/images/Images.004.png -------------------------------------------------------------------------------- /distribution/src/site/resources/images/Images.005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/distribution/src/site/resources/images/Images.005.png -------------------------------------------------------------------------------- /distribution/src/site/resources/images/Images.006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/distribution/src/site/resources/images/Images.006.png -------------------------------------------------------------------------------- /distribution/src/site/templates/README: -------------------------------------------------------------------------------- 1 | Directory includes any templates that may override defaults contained in XSite. 2 | -------------------------------------------------------------------------------- /examples/annotations/src/main/java/org/jbehave/examples/core/annotations/CoreStoriesUsingScanning.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.annotations; 2 | 3 | import org.jbehave.core.steps.InjectableStepsFactory; 4 | import org.jbehave.core.steps.ScanningStepsFactory; 5 | import org.jbehave.examples.core.CoreStories; 6 | 7 | /** 8 | *

9 | * Example of how multiple stories can be run via JUnit, finding steps 10 | * via the {@link ScanningStepsFactory}. 11 | *

12 | */ 13 | public class CoreStoriesUsingScanning extends CoreStories { 14 | 15 | @Override 16 | public InjectableStepsFactory stepsFactory() { 17 | return new ScanningStepsFactory(configuration(), "org.jbehave.examples.core.steps").notMatchingNames( 18 | ".*Failing.*"); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/CoreStoriesFailing.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core; 2 | 3 | import static org.jbehave.core.io.CodeLocations.codeLocationFromClass; 4 | 5 | import java.util.List; 6 | 7 | import org.jbehave.core.io.StoryFinder; 8 | 9 | public class CoreStoriesFailing extends CoreStories { 10 | 11 | @Override 12 | public List storyPaths() { 13 | String filter = System.getProperty("story.filter", "**/failing/*.story"); 14 | return new StoryFinder().findPaths(codeLocationFromClass(this.getClass()), filter, 15 | "**/custom/*.story,**/given/*.story,**/pending/*.story"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/CoreStoriesFailingUponPending.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core; 2 | 3 | import org.jbehave.core.configuration.Configuration; 4 | import org.jbehave.core.failures.FailingUponPendingStep; 5 | import org.jbehave.core.junit.JUnit4StoryRunner; 6 | import org.junit.runner.RunWith; 7 | 8 | @RunWith(JUnit4StoryRunner.class) 9 | public class CoreStoriesFailingUponPending extends CoreStories { 10 | 11 | @Override 12 | public Configuration configuration() { 13 | return super.configuration() 14 | .usePendingStepStrategy(new FailingUponPendingStep()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/persistence/TraderPersister.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.persistence; 2 | 3 | import org.jbehave.examples.core.model.Trader; 4 | 5 | public class TraderPersister { 6 | 7 | private Trader[] traders; 8 | 9 | public TraderPersister(Trader... traders) { 10 | this.traders = traders; 11 | } 12 | 13 | public Trader retrieveTrader(String name) { 14 | for (Trader trader : traders) { 15 | if (trader.getName().equals(name)) { 16 | return trader; 17 | } 18 | } 19 | return null; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/service/TradingService.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.service; 2 | 3 | import org.jbehave.examples.core.model.Stock; 4 | import org.jbehave.examples.core.model.Trader; 5 | 6 | public class TradingService { 7 | 8 | public Stock newStock(String symbol, double threshold) { 9 | return new Stock(symbol, threshold); 10 | } 11 | 12 | public Trader newTrader(String name, String rank) { 13 | return new Trader(name, rank); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/steps/AbstractSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.steps; 2 | 3 | import org.jbehave.core.annotations.When; 4 | 5 | public abstract class AbstractSteps { 6 | 7 | @When("something happens") 8 | public void whenSomethingHappens() { 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/steps/AndSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.steps; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | import org.jbehave.core.annotations.When; 5 | 6 | public class AndSteps { 7 | @Given("the wind blows") 8 | public void givenWindBlows() { 9 | System.err.println("given the wind blows"); 10 | } 11 | 12 | @When("the wind blows") 13 | public void whenWindBlows() { 14 | System.err.println("when the wind blows"); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/steps/MyContext.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.steps; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class MyContext { 7 | 8 | Map variables = new HashMap<>(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/steps/ParameterDelimitersSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.steps; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | import org.jbehave.core.annotations.Named; 5 | 6 | public class ParameterDelimitersSteps { 7 | 8 | @Given("a ") 9 | public void givenAParameterWithAngleBrackets(@Named("parameter") String parameter) { 10 | System.out.println(">>>> parameter " + parameter); 11 | } 12 | 13 | @Given("a [parameter]") 14 | public void givenAParameterWithSquareBrackets(@Named("parameter") String parameter) { 15 | System.out.println(">>>> parameter " + parameter); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/steps/ParametrisedSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.steps; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | import org.jbehave.core.model.ExamplesTable; 5 | 6 | public class ParametrisedSteps { 7 | 8 | @Given("a parametrised table: $table") 9 | public void givenAParametrisedTable(ExamplesTable table) { 10 | String value = table.getRowAsParameters(0, true).valueAs("value", String.class); 11 | System.out.println(">>>> Replaced row value: " + value); 12 | } 13 | 14 | @Given("a value $value") 15 | public void givenAValue(String value) { 16 | if (value.equals("bad")) { 17 | throw new RuntimeException("Bad value"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/steps/SandpitSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.steps; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | import org.jbehave.core.annotations.Then; 5 | import org.jbehave.core.steps.Steps; 6 | 7 | public class SandpitSteps extends Steps { 8 | 9 | @Given("I do nothing") 10 | public void doNothing() { 11 | } 12 | 13 | @Then("I fail") 14 | public void doFail() { 15 | throw new AssertionError("I failed!"); 16 | } 17 | 18 | @Then("I pass") 19 | public void doPass() { 20 | } 21 | } -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/steps/VerbatimSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.steps; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | import org.jbehave.core.model.Verbatim; 5 | 6 | public class VerbatimSteps { 7 | 8 | @Given("a verbatim content: $verbatim") 9 | public void givenVerbatimContent(Verbatim verbatim) { 10 | System.out.println(verbatim.getContent()); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/steps/composite.steps: -------------------------------------------------------------------------------- 1 | Composite: Given I have a bank account with balance $balance 2 | Given I have a bank account 3 | Given my balance is 4 | 5 | Composite: Given I have a balance $balance and withdraw $value 6 | Given I have a bank account with balance 7 | When I withdraw 8 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/MetaFiltering.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories; 2 | 3 | import java.util.Arrays; 4 | 5 | import org.jbehave.examples.core.CoreStory; 6 | 7 | public class MetaFiltering extends CoreStory { 8 | 9 | public MetaFiltering() { 10 | // Uncomment to set meta filter, which can also be set via Ant or Maven 11 | configuredEmbedder().useMetaFilters(Arrays.asList("+run yes")); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/ParameterDelimiters.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories; 2 | 3 | import org.jbehave.core.configuration.Configuration; 4 | import org.jbehave.core.steps.ParameterControls; 5 | import org.jbehave.examples.core.CoreStory; 6 | 7 | public class ParameterDelimiters extends CoreStory { 8 | 9 | @Override 10 | public Configuration configuration() { 11 | return super.configuration().useParameterControls( 12 | new ParameterControls().useNameDelimiterLeft("[").useNameDelimiterRight("]")); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/PriorityMatching.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories; 2 | 3 | import org.jbehave.examples.core.CoreStory; 4 | 5 | public class PriorityMatching extends CoreStory { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/Restarting.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories; 2 | 3 | import org.jbehave.core.steps.InjectableStepsFactory; 4 | import org.jbehave.core.steps.InstanceStepsFactory; 5 | import org.jbehave.examples.core.CoreStory; 6 | import org.jbehave.examples.core.steps.RestartingSteps; 7 | 8 | public class Restarting extends CoreStory { 9 | 10 | @Override 11 | public InjectableStepsFactory stepsFactory() { 12 | return new InstanceStepsFactory(configuration(), new RestartingSteps()); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/SkipBeforeAndAfterScenarioStepsIfGivenStory.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories; 2 | 3 | import org.jbehave.core.configuration.Configuration; 4 | import org.jbehave.core.embedder.StoryControls; 5 | import org.jbehave.examples.core.CoreStory; 6 | 7 | public class SkipBeforeAndAfterScenarioStepsIfGivenStory extends CoreStory { 8 | 9 | @Override 10 | public Configuration configuration() { 11 | return super.configuration().useStoryControls( 12 | new StoryControls().doSkipBeforeAndAfterScenarioStepsIfGivenStory(true)); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/alias.story: -------------------------------------------------------------------------------- 1 | Scenario: Verify aliases from resources 2 | 3 | Given a plan with Google calendar date of 4 | Then the complainant should receive an amount of 5 | Then the petitioner should receive an amount of 6 | 7 | Examples: 8 | |date |amount| 9 | |none |0.0 | 10 | |01/06/2010 |2.15 | 11 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/and_step.story: -------------------------------------------------------------------------------- 1 | Narrative: 2 | As a story writer 3 | I want to explain the use of And steps and also show that I can use keywords in scenario title and comments 4 | So that I'll be more communicative 5 | 6 | Scenario: And steps should match the previous step type 7 | 8 | Given the wind blows 9 | !-- This And is equivalent to another Given 10 | And the wind blows 11 | !-- This And shows that we can chain multiple And steps 12 | And the wind blows 13 | When the wind blows 14 | !-- This And is equivalent to another When 15 | And the wind blows -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/calendar.story: -------------------------------------------------------------------------------- 1 | Given a plan with calendar date of 2 | Then the claimant should receive an amount of 3 | 4 | Examples: 5 | |date |amount| 6 | |none |0.0 | 7 | |01/06/2010 |2.15 | 8 | 9 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/context.story: -------------------------------------------------------------------------------- 1 | 2 | Meta: @skip 3 | 4 | Scenario: One 5 | 6 | When a variable of name one is processed 7 | Then the context includes the name one 8 | 9 | Scenario: Two 10 | 11 | When a variable of name two is processed 12 | Then the context includes the name two 13 | And the context does not include the name one 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/custom/synonyms.story: -------------------------------------------------------------------------------- 1 | Narrative: 2 | As a story writer 3 | I want to use synonyms 4 | So that I'll be more communicative 5 | 6 | Scenario: And steps using With synonyms 7 | 8 | Given the wind blows 9 | With the wind blows 10 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/do_nothing.story: -------------------------------------------------------------------------------- 1 | 2 | !-- GivenStories: ignore_me.story 3 | 4 | Given I do nothing 5 | 6 | !-- Examples: 7 | |I|am|just|lazy| 8 | 9 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/ExamplesTableFailing.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories.failing; 2 | 3 | import org.jbehave.core.configuration.Configuration; 4 | import org.jbehave.examples.core.CoreStory; 5 | 6 | public class ExamplesTableFailing extends CoreStory { 7 | 8 | @Override 9 | public Configuration configuration() { 10 | Configuration configuration = super.configuration(); 11 | configuration.storyControls().doResetStateBeforeScenario(false); 12 | return configuration; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/FailingBeforeAfter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories.failing; 2 | 3 | import org.jbehave.core.steps.InjectableStepsFactory; 4 | import org.jbehave.core.steps.InstanceStepsFactory; 5 | import org.jbehave.examples.core.CoreStory; 6 | import org.jbehave.examples.core.service.TradingService; 7 | import org.jbehave.examples.core.steps.FailingBeforeAfterSteps; 8 | import org.jbehave.examples.core.steps.TraderSteps; 9 | 10 | public class FailingBeforeAfter extends CoreStory { 11 | 12 | @Override 13 | public InjectableStepsFactory stepsFactory() { 14 | return new InstanceStepsFactory(configuration(), new TraderSteps(new TradingService()), 15 | new FailingBeforeAfterSteps()); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/SkipScenariosAfterFailure.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories.failing; 2 | 3 | import org.jbehave.core.configuration.Configuration; 4 | import org.jbehave.core.embedder.StoryControls; 5 | import org.jbehave.examples.core.CoreStory; 6 | 7 | public class SkipScenariosAfterFailure extends CoreStory { 8 | 9 | @Override 10 | public Configuration configuration() { 11 | return super.configuration().useStoryControls(new StoryControls().doSkipScenariosAfterFailure(true) 12 | .doSkipBeforeAndAfterScenarioStepsIfGivenStory(true)); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/SkipStoryIfGivenStoryFailed.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories.failing; 2 | 3 | import org.jbehave.core.configuration.Configuration; 4 | import org.jbehave.core.embedder.StoryControls; 5 | import org.jbehave.examples.core.CoreStory; 6 | 7 | public class SkipStoryIfGivenStoryFailed extends CoreStory { 8 | 9 | @Override 10 | public Configuration configuration() { 11 | return super.configuration().useStoryControls(new StoryControls().doSkipStoryIfGivenStoryFailed(true)); 12 | } 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/after_scenario_outcome.story: -------------------------------------------------------------------------------- 1 | Story: Showing that @AfterScenario method are executed upon appropriate outcome (ANY, SUCCESS, FAILURE) 2 | 3 | Scenario: Pass on a step 4 | 5 | Given I do nothing 6 | Then I pass 7 | 8 | Scenario: Fail on a step 9 | 10 | Given I do nothing 11 | Then I fail -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/and_step.story: -------------------------------------------------------------------------------- 1 | Scenario: An initial And step should be marked as pending as there is not previous step 2 | 3 | !-- What is this And of? JBehave treats as pending 4 | And the wind blows 5 | !-- Look Ma' - I can also use keywords in scenario title and step comments! 6 | 7 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/examples_table_failing.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | @theme parametrisation 4 | 5 | Scenario: State of parametrised scenarios is not reset, thus the final state will be a failure 6 | 7 | Given a value 8 | 9 | Examples: 10 | |value| 11 | |bad| 12 | |good| 13 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/failing_after_stories.story: -------------------------------------------------------------------------------- 1 | We want to show that failures in @AfterStories methods will appear in the AfterStories report. 2 | 3 | Scenario: 4 | 5 | Given the alert status is OFF 6 | Given a trader of name Mauro 7 | And the alert status is OFF 8 | Given a stock of symbol STK1 and a threshold of 1.5 9 | When the stock is traded at price 2.0 10 | Then the alert status is ON 11 | When the trader sells all stocks 12 | Then the trader is left with no stocks -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/failing_before_after.story: -------------------------------------------------------------------------------- 1 | We want to show that failures in @BeforeScenario methods will not prevent rest of scenario steps to run (marked as NOT PERFORMED). 2 | Also, the @Before/AfterScenario, @Before/AfterStory failure messages should be displayed in the story reports, while 3 | the @BeforeAfterStories failures are displayed in the Before/AfterStories reports. 4 | 5 | Scenario: 6 | 7 | Given the alert status is OFF 8 | Given a trader of name Mauro 9 | And the alert status is OFF 10 | Given a stock of symbol STK1 and a threshold of 1.5 11 | When the stock is traded at price 2.0 12 | Then the alert status is ON 13 | When the trader sells all stocks 14 | Then the trader is left with no stocks -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/failing_before_stories.story: -------------------------------------------------------------------------------- 1 | We want to show that failures in @BeforeStories methods will mark rest of steps as NOT PERFORMED, if story and scenario state is not reset via the StoryControls 2 | 3 | Scenario: 4 | 5 | Given the alert status is OFF 6 | Given a trader of name Mauro 7 | And the alert status is OFF 8 | Given a stock of symbol STK1 and a threshold of 1.5 9 | When the stock is traded at price 2.0 10 | Then the alert status is ON 11 | When the trader sells all stocks 12 | Then the trader is left with no stocks -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/failure_correlation_one.story: -------------------------------------------------------------------------------- 1 | Scenario: Fail on a step in story 1 2 | 3 | When a failure occurs in story 1 4 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/failure_correlation_two.story: -------------------------------------------------------------------------------- 1 | Scenario: Fail on a step in story 2 2 | 3 | When a failure occurs in story 2 4 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/failure_followed_by_given_stories.story: -------------------------------------------------------------------------------- 1 | Story: Showing that using given stories in a passing scenario following a scenario where are a failure occurred resets the overall 2 | build result of the story 3 | 4 | Scenario: Fail on a step 5 | 6 | Given I do nothing 7 | Then I fail 8 | 9 | Scenario: Pass after given stories 10 | 11 | GivenStories: org/jbehave/examples/core/stories/do_nothing.story 12 | 13 | Given I do nothing 14 | Then I pass 15 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/given_non_successful.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario that depends on a non successful story 2 | 3 | GivenStories: org/jbehave/examples/core/stories/failing/non_successful.story 4 | 5 | Given the traders: 6 | |name |rank | 7 | |Larry|Stooge 3| 8 | |Moe |Stooge 1| 9 | |Curly|Stooge 2| 10 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/lifecycle.story: -------------------------------------------------------------------------------- 1 | Story: Showing lifecycle behaviour 2 | 3 | Lifecycle: 4 | Before: 5 | 6 | Given I have a bank account 7 | And my balance is 100 8 | 9 | After: 10 | Outcome: ANY 11 | Then my balance is printed 12 | 13 | Outcome: SUCCESS 14 | Then my balance is archived 15 | 16 | Outcome: FAILURE 17 | MetaFilter: +non-archiving 18 | Then my balance is not archived 19 | 20 | Scenario: Failing archiving scenario 21 | Meta: @archiving 22 | 23 | When I withdraw 10 24 | Then my bank account balance should be 100 25 | 26 | Scenario: Failing non-archiving scenario 27 | Meta: @non-archiving 28 | 29 | When I withdraw 10 30 | Then my bank account balance should be 100 31 | 32 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/non_successful.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario with failed step 2 | 3 | Then I fail 4 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/skip_scenarios_after_failure.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario with failed step 2 | 3 | Given I do nothing 4 | Then I fail 5 | 6 | Scenario: A scenario that is not executed because if followed a failed scenario 7 | 8 | Given I do nothing 9 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/skip_story_if_given_story_failed.story: -------------------------------------------------------------------------------- 1 | GivenStories: org/jbehave/examples/core/stories/failing/non_successful.story 2 | 3 | Scenario: A scenario that is not executed because it followed a failed given story 4 | 5 | Given I do nothing 6 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/failing/traders_can_be_searched.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: Traders search fails 3 | 4 | Given the trader ranks: 5 | |name |rank | 6 | |Larry|Stooge 3| 7 | |Moe |Stooge 1| 8 | |Curly|Stooge 2| 9 | !-- Verification fails 10 | Then the traders returned are: 11 | |name |rank | 12 | |Moe |Stooge 1| 13 | |Curly|Stooge 2| 14 | 15 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given/GivenStoriesLoadedByRelativePath.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories.given; 2 | 3 | import org.jbehave.core.configuration.Configuration; 4 | import org.jbehave.core.io.RelativePathCalculator; 5 | import org.jbehave.examples.core.CoreStory; 6 | 7 | public class GivenStoriesLoadedByRelativePath extends CoreStory { 8 | 9 | @Override 10 | public Configuration configuration() { 11 | return super.configuration().usePathCalculator(new RelativePathCalculator()); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given/given_stories_loaded_by_relative_path.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | @theme parametrisation 4 | 5 | Scenario: A scenario that depends on a story loaded with relative path 6 | 7 | GivenStories: parametrised.story#{0} 8 | 9 | When the stock is traded at price 1.1 10 | Then the alert status is ON 11 | 12 | Examples: 13 | |symbol|threshold| 14 | |STK1 |1.0| 15 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given/parametrised.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | @theme parametrisation 4 | 5 | Scenario: 6 | 7 | Given the asset class 8 | Given a stock of and a 9 | 10 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given/scenarios.story: -------------------------------------------------------------------------------- 1 | Scenarios that are used as preconditions, used via given stories /path/to/story#{idX:scenarioX} 2 | 3 | Scenario: Scenario 1 4 | 5 | Meta: @id1 scenario1 6 | 7 | Given a stock of symbol XXX and a threshold of 1.0 8 | 9 | Scenario: Scenario 2 10 | 11 | Meta: @id2 scenario2 12 | 13 | Given a stock of symbol XXX and a threshold of 2.0 14 | 15 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given_stories_filtered_by_meta.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario that depends on a given scenario that does not have matching meta info, 2 | but the meta filter is ignored in the given story 3 | Meta: @run 4 | 5 | GivenStories: org/jbehave/examples/core/stories/given/scenarios.story#{id1:scenario1} 6 | 7 | When the stock is traded at price 1.1 8 | Then the alert status is ON 9 | 10 | Scenario: A scenario that depends on another given scenario 11 | Meta: @skip 12 | 13 | GivenStories: org/jbehave/examples/core/stories/given/scenarios.story#{id2:scenario2} 14 | 15 | When the stock is traded at price 1.1 16 | Then the alert status is OFF 17 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given_stories_filtered_by_scenario_id.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario that depends on a given scenario 2 | 3 | GivenStories: org/jbehave/examples/core/stories/given/scenarios.story#{id1:scenario1} 4 | 5 | When the stock is traded at price 1.1 6 | Then the alert status is ON 7 | 8 | Scenario: A scenario that depends on another given scenario 9 | 10 | GivenStories: org/jbehave/examples/core/stories/given/scenarios.story#{id2:scenario2} 11 | 12 | When the stock is traded at price 1.1 13 | Then the alert status is OFF 14 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given_stories_parametrised_by_anchor.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario that depends on a given story with parameters specified as anchor pointing to specific examples row. 2 | The presence of the anchor implies that the scenario is executed normally and not parametrised by examples, i.e. that the scenario is not executed for each examples row. 3 | 4 | Meta: @theme parametrisation 5 | @assetClass FX 6 | 7 | GivenStories: org/jbehave/examples/core/stories/given/parametrised.story#{0} 8 | 9 | When the stock is traded at price 1.1 10 | Then the alert status is ON 11 | 12 | Examples: 13 | |symbol|threshold| 14 | |STK1 |1.0| 15 | |STK2 |2.0| 16 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given_stories_parametrised_by_examples.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario that depends on given stories parametrised by examples. 2 | Here the entire scenario is parametrised by examples, i.e. the scenario is executed for each examples row. 3 | 4 | Meta: @assetClass FX 5 | 6 | GivenStories: org/jbehave/examples/core/stories/select_stock_exchange.story 7 | 8 | Given a stock of symbol and a threshold of 9 | When the stock is traded at price 10 | Then the alert status is 11 | 12 | Examples: 13 | |stockExchange|symbol|threshold|price|status| 14 | |NASDAQ|STK1|10.0|5.0|OFF| 15 | |FTSE|STK1|10.0|11.0|ON| -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/given_stories_parametrised_by_meta.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario that is executed after the given stories parametrised by meta 2 | 3 | Meta: @theme parametrisation 4 | @assetClass FX @symbol STK1 @threshold 1.0 5 | 6 | GivenStories: org/jbehave/examples/core/stories/given/parametrised.story 7 | 8 | When the stock is traded at price 1.1 9 | Then the alert status is ON 10 | 11 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/ignoring.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: Ignoring steps after first 3 | 4 | Given a successful step 5 | When ignore steps failure occurs 6 | Then step is ignored 7 | Then step is ignored 8 | 9 | Scenario: A new step of steps 10 | 11 | Given a successful step 12 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/lifecycle_scope.story: -------------------------------------------------------------------------------- 1 | Story: Showing lifecycle behaviour with both scenario and story scope 2 | 3 | Lifecycle: 4 | Before: 5 | Scope: STORY 6 | Given I have a bank account 7 | 8 | Scope: SCENARIO 9 | Given my balance is 100 10 | 11 | Scope: STEP 12 | When I withdraw 2 13 | 14 | After: 15 | Scope: STORY 16 | Then my balance is archived 17 | 18 | Scope: SCENARIO 19 | Then my balance is in credit 20 | 21 | Scope: STEP 22 | When I withdraw 1 23 | 24 | Scenario: First scenario 25 | When I withdraw 10 26 | Then my bank account balance should be 85 27 | 28 | Scenario: Second scenario 29 | When I withdraw 20 30 | Then my bank account balance should be 75 31 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/meta_filtering.story: -------------------------------------------------------------------------------- 1 | A story description 2 | over multiple lines 3 | 4 | Meta: 5 | 6 | !-- A first ignored comment 7 | @theme filtering 8 | !-- Another ignored comment 9 | @author Mauro 10 | 11 | Scenario: A scenario to be skipped 12 | and not executed 13 | 14 | Meta: 15 | 16 | @skip 17 | 18 | Given I do nothing 19 | 20 | Scenario: A scenario with an author 21 | 22 | Meta: 23 | 24 | Given I do nothing 25 | 26 | Scenario: A scenario with examples whose rows can be filtered on meta 27 | 28 | Meta: @run 29 | 30 | Given I do nothing 31 | 32 | Examples: 33 | |Meta:|Parameter| 34 | |@run yes|value| 35 | |@run not|value| 36 | 37 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/meta_parametrisation.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | @theme parameters 4 | 5 | Scenario: scenario with explicitly mentioned meta params 6 | 7 | Meta: 8 | 9 | @variant named 10 | 11 | Given I have specified the 12 | And a 13 | Then the theme is 'parameters' with variant 'named' 14 | 15 | 16 | Scenario: scenario with hidden meta params 17 | 18 | Meta: 19 | 20 | @variant foo 21 | 22 | Given I have some step that implicitly requires meta params 23 | Then the theme is 'parameters' with variant 'foo' 24 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/named_parameters.story: -------------------------------------------------------------------------------- 1 | Scenario: We want to verify that parameters can be matched by name preserving the natural order 2 | 3 | Given parameters matched by name in natural order one and two 4 | Then parameters values are one and two 5 | 6 | Scenario: We want to verify that parameters can be matched by name inverting the natural order 7 | 8 | Given parameters matched by name in inverse order one and two 9 | Then parameters values are one and two 10 | 11 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/parameter_delimiters.story: -------------------------------------------------------------------------------- 1 | Scenario: I want to show that different parameter delimiters can be configured via the ParameterControls 2 | 3 | Given a [parameter] 4 | 5 | Examples: 6 | |parameter| 7 | |value| 8 | 9 | Scenario: I want to show that parameter values are correctly delimited, even when the values are overlapping 10 | 11 | Given a stock of symbol 10ABCDEF and a threshold of 10 12 | Given a stock of symbol ABC10DEF and a threshold of 10 13 | Given a stock of symbol ABCDEF10 and a threshold of 10 14 | 15 | Scenario: I want to show that parameter values are correctly delimited, but not in the table parameter 16 | 17 | Given the traders: 18 | |name | rank | 19 | |joe | topdog | 20 | And a stock of symbol topdog and a threshold of 10 21 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/parametrised_scenario.story: -------------------------------------------------------------------------------- 1 | Scenario: Parameter does match examples table header 2 | 3 | Given that I am on Google's Homepage 4 | When I enter the search term and proceed 5 | Then I should see ridiculous things 6 | 7 | Examples: 8 | |ridiculousSearchTerm| 9 | |Hello Kitty| 10 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/parametrised_table.story: -------------------------------------------------------------------------------- 1 | 2 | Given a parametrised table: 3 | |name|value| 4 | |name1|scheme| 5 | 6 | Examples: 7 | |scheme| 8 | |scheme1| 9 | |scheme2| 10 | |scheme3| -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/pending/MetaFiltering.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.stories.pending; 2 | 3 | import java.util.Arrays; 4 | 5 | import org.jbehave.examples.core.CoreStory; 6 | 7 | public class MetaFiltering extends CoreStory { 8 | 9 | public MetaFiltering() { 10 | // Uncomment to set meta filter, which can also be set via Ant or Maven 11 | configuredEmbedder().useMetaFilters(Arrays.asList("+run yes")); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/pending/meta_filtering.story: -------------------------------------------------------------------------------- 1 | A story description 2 | over multiple lines 3 | 4 | Meta: 5 | 6 | !-- A first ignored comment 7 | @theme filtering 8 | !-- Another ignored comment 9 | @author Mauro 10 | 11 | 12 | Scenario: A parametrised scenario that is yet to be implemented 13 | 14 | Meta: 15 | @run pending 16 | 17 | When I lookup my 18 | Then I will see 19 | 20 | Examples: 21 | | car reservation | car type | 22 | | 1223395844 | midsize | 23 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/pending/parametrised_scenario.story: -------------------------------------------------------------------------------- 1 | Scenario: Parameter does not match examples table header and step is marked as pending 2 | 3 | Given that I am on Google's Homepage 4 | When I enter the search term and proceed 5 | Then I should see ridiculous things 6 | 7 | Examples: 8 | |ridiculoussearchterm| 9 | |Hello Kitty| -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/pending/pending_stats.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: A scenario with no steps 3 | 4 | Scenario: A scenario with some pending steps 5 | 6 | Given I am pending 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/pending/step_composition.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | @theme parametrisation 4 | 5 | Scenario: Using a composite step where one of the composed steps is not found. 6 | The composed step not found should be reported as pending and the subsequent composed steps not performed. 7 | 8 | !-- Annotated method: 9 | !-- @Given("%customer returns to cart") 10 | !-- @Composite(steps = { "Given step not found", 11 | !-- "Given has a cart", }) 12 | !-- public void compositeStep(@Named("customer") String customer) { // composed steps use these named parameters 13 | !-- } 14 | 15 | Given Mr Jones returns to cart 16 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/priority_matching.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario that verifies priority matching of steps, with the less-greedy pattern given higher priority 2 | 3 | !-- Matching regex "a step that has %param" 4 | Given a step that has a parameter 5 | Then the parameter value is "a parameter" 6 | !-- Matching regex "a step that has exactly one %param" 7 | Given a step that has exactly one of the parameters 8 | Then the parameter value is "of the parameters" -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/restarting.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: Restarting scenario 3 | 4 | When I restart scenario 5 | Then scenario has been executed two times 6 | 7 | Scenario: Restarting story 8 | 9 | When I restart story 10 | Then story has been executed two times 11 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/select_stock_exchange.story: -------------------------------------------------------------------------------- 1 | 2 | Given the stock exchange 3 | And the asset class -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/skip_before_and_after_scenario_steps_if_given_story.story: -------------------------------------------------------------------------------- 1 | Scenario: A scenario where before and after steps are executed only once even if there is a given story 2 | 3 | GivenStories: org/jbehave/examples/core/stories/given/parametrised.story#{0} 4 | 5 | When the stock is traded at price 1.1 6 | Then the alert status is ON 7 | 8 | Examples: 9 | |symbol|threshold| 10 | |STK1 |1.0| -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/step_composition_from_definition_file.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | @theme parametrisation 4 | 5 | Scenario: Using a composite step with normal parameter matching 6 | 7 | Given I have a bank account with balance 50 8 | When I withdraw 10 9 | Then my bank account balance should be 40 10 | 11 | 12 | Scenario: Using a composite step in a parameterised scenario 13 | 14 | Given I have a bank account with balance 15 | When I withdraw 15 16 | Then my bank account balance should be 25 17 | 18 | Examples: 19 | |startBalance| 20 | |40 | 21 | 22 | 23 | Scenario: Composite nested steps in action. 24 | 25 | Given I have a balance 80 and withdraw 20 26 | Then my bank account balance should be 60 27 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/step_nested_composition.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: Composite nested steps in action. 3 | 4 | Then all buttons are enabled -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/steps_context.story: -------------------------------------------------------------------------------- 1 | Narrative: 2 | In order to share variables between steps classes 3 | As a scenario writer 4 | I want to use a steps context to handle it for me 5 | 6 | Scenario: Steps Context in action 7 | 8 | When a variable with value myValue is stored in steps context 9 | Then the steps context includes the value myValue -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/table_parameters.story: -------------------------------------------------------------------------------- 1 | Scenario: Table parameters 2 | 3 | Given the table as parameter: 4 | |name |rank | 5 | |Larry|Stooge 1| 6 | |Moe |Stooge 2| 7 | |Curly|Stooge 3| 8 | Given the table of type TYPE as parameter: 9 | |name |rank | 10 | |Larry|Stooge 1| 11 | |Moe |Stooge 2| 12 | |Curly|Stooge 3| 13 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/table_transformers.story: -------------------------------------------------------------------------------- 1 | Scenario: Table can be in landscape format 2 | 3 | Given the table: 4 | |name |Larry |Moe |Curly | 5 | |rank |Stooge 1|Stooge 2|Stooge 3| 6 | Then the table transformed by FROM_LANDSCAPE is: 7 | |name|rank| 8 | |Larry|Stooge 1| 9 | |Moe|Stooge 2| 10 | |Curly|Stooge 3| 11 | 12 | Scenario: Table can be formatted 13 | 14 | Given the table: 15 | | name | rank | 16 | | Larry|Stooge 1 | 17 | | Moe | Stooge 2 | 18 | | Curly| Stooge 3| 19 | Then the table transformed by FORMATTING is: 20 | |name |rank | 21 | |Larry|Stooge 1| 22 | |Moe |Stooge 2| 23 | |Curly|Stooge 3| 24 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/trade_types.story: -------------------------------------------------------------------------------- 1 | Trade Types 2 | 3 | Scenario: Trader uses enums to identify trade types 4 | 5 | Given a trade type SELL 6 | Then the current trade type is SELL 7 | And the list of trade types is BUY,SELL 8 | 9 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/traders.table: -------------------------------------------------------------------------------- 1 | |name |rank | 2 | |Larry|Stooge 3| 3 | |Moe |Stooge 1| 4 | |Curly|Stooge 2| 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/trades.table: -------------------------------------------------------------------------------- 1 | |symbol|threshold|price|status| 2 | |STK1 |15.0|5.0 |OFF| 3 | |STK1 |15.0|11.0|OFF| 4 | |STK1 |15.0|16.0|ON | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/trades_transposed.table: -------------------------------------------------------------------------------- 1 | {transformer=FROM_LANDSCAPE, headerSeparator=!, valueSeparator=!} 2 | !symbol !STK1!STK1!STK1! 3 | !threshold!15.0!15.0!15.0! 4 | !price !5.0 !11.0!16.0! 5 | !status !OFF !OFF !ON ! 6 | -------------------------------------------------------------------------------- /examples/core/src/main/java/org/jbehave/examples/core/stories/verbatim.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: Rendering verbatim content in steps 3 | 4 | Given a verbatim content: 5 | Some content I want to render 6 | as is, without any changes 7 | -------------------------------------------------------------------------------- /examples/core/src/main/resources/alias/aliases.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Given a plan with calendar date of ", 4 | "aliases" : [ 5 | { 6 | "name": "Given a plan with Google calendar date of " 7 | } 8 | ] 9 | }, 10 | { 11 | "name": "Then the claimant should receive an amount of ", 12 | "aliases" : [ 13 | { 14 | "name": "Then the complainant should receive an amount of " 15 | }, 16 | { 17 | "name": "Then the petitioner should receive an amount of " 18 | } 19 | ] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /examples/core/src/main/resources/i18n/custom_en.properties: -------------------------------------------------------------------------------- 1 | And=And|With 2 | -------------------------------------------------------------------------------- /examples/executable-jar/src/main/java/org/jbehave/examples/executablejar/steps/MySteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.executablejar.steps; 2 | 3 | import org.jbehave.core.annotations.Alias; 4 | import org.jbehave.core.annotations.Then; 5 | import org.jbehave.core.annotations.When; 6 | 7 | public class MySteps { 8 | @When("I run this as executable jar") 9 | @Alias("this") 10 | public void whenIRunThisAsExecutableJar() { 11 | // we don't do anything 12 | } 13 | 14 | @Then("this story should run") 15 | @Alias("that") 16 | public void thenThisStoryShouldRun() { 17 | // we don't do anything 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/executable-jar/src/main/resources/org/jbehave/examples/executablejar/stories/jar.story: -------------------------------------------------------------------------------- 1 | Scenario: This should work as executable jar 2 | 3 | When I run this as executable jar 4 | Then this story should run 5 | 6 | -------------------------------------------------------------------------------- /examples/executable-jar/src/main/resources/org/jbehave/examples/executablejar/stories/jar2.story: -------------------------------------------------------------------------------- 1 | Scenario: This should work as executable jar 2 | 3 | When this 4 | Then that 5 | 6 | -------------------------------------------------------------------------------- /examples/gherkin/src/main/java/org/jbehave/examples/gherkin/features/using_gherkin.feature: -------------------------------------------------------------------------------- 1 | @feature 2 | Feature: Hello Car 3 | 4 | Background: 5 | 6 | Given I have a license 7 | 8 | @scenario 9 | Scenario: Car can drive 10 | 11 | Given I have a car 12 | Then I can drive them according to wheels: 13 | | wheels | can_drive | 14 | | 1 | false | 15 | | 2 | false | 16 | | 3 | false | 17 | | 4 | true | 18 | -------------------------------------------------------------------------------- /examples/google/src/main/java/org/jbehave/examples/google/steps/a_story.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/examples/google/src/main/java/org/jbehave/examples/google/steps/a_story.odt -------------------------------------------------------------------------------- /examples/google/src/main/java/org/jbehave/examples/google/steps/a_story.txt: -------------------------------------------------------------------------------- 1 | Narrative: 2 | In order to communicate better 3 | As a story writer 4 | I want to be able to use ODT format 5 | 6 | Scenario: a plain scenario 7 | Given a step 8 | When a step has failed 9 | Then the scenario is visualized as failed 10 | 11 | Scenario: a scenario with a given story 12 | 13 | GivenStories: stories/a_successful_story.odt 14 | 15 | Given a step 16 | And the step is successful 17 | Then the scenario is visualized as succeeded 18 | 19 | Scenario: a scenario with examples 20 | 21 | Given a 22 | When the is executed 23 | Then the result is 24 | 25 | Examples: 26 | |step|result| 27 | |one|1| 28 | |two|2| 29 | -------------------------------------------------------------------------------- /examples/google/src/main/java/org/jbehave/examples/google/stories/load_odt_from_google.story: -------------------------------------------------------------------------------- 1 | 2 | Scenario: A document is loaded from Google Docs. 3 | The credentials are provided via env vars GOOGLE_USER and GOOGLE_PASSWORD. 4 | The doc a_story.odt must be loaded to Google Docs. 5 | 6 | Given Google feed https://docs.google.com/feeds/default/private/full/ 7 | When story a_story is loaded from feed 8 | Then content is same as org/jbehave/examples/google/steps/a_story.txt -------------------------------------------------------------------------------- /examples/grid/src/main/java/org/jbehave/examples/grid/domain/Cell.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.grid.domain; 2 | 3 | import org.apache.commons.lang3.builder.EqualsBuilder; 4 | import org.apache.commons.lang3.builder.HashCodeBuilder; 5 | 6 | public class Cell { 7 | 8 | private final int column; 9 | private final int row; 10 | 11 | public Cell(int column, int row) { 12 | this.column = column; 13 | this.row = row; 14 | } 15 | 16 | @Override 17 | public int hashCode() { 18 | return HashCodeBuilder.reflectionHashCode(this, false); 19 | } 20 | 21 | @Override 22 | public boolean equals(Object obj) { 23 | return EqualsBuilder.reflectionEquals(this, obj, false); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /examples/grid/src/main/java/org/jbehave/examples/grid/domain/Grid.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.grid.domain; 2 | 3 | public interface Grid { 4 | 5 | Grid NULL = new Grid() { 6 | @Override 7 | public int getHeight() { 8 | return 0; 9 | } 10 | 11 | @Override 12 | public int getWidth() { 13 | return 0; 14 | } 15 | 16 | @Override 17 | public boolean cellToggledAt(int column, int row) { 18 | return false; 19 | } 20 | }; 21 | 22 | int getWidth(); 23 | 24 | int getHeight(); 25 | 26 | boolean cellToggledAt(int column, int row); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /examples/grid/src/main/java/org/jbehave/examples/grid/domain/GridObserver.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.grid.domain; 2 | 3 | public interface GridObserver { 4 | 5 | GridObserver NULL = new GridObserver() { 6 | @Override 7 | public void gridChanged(Grid grid) { 8 | } 9 | }; 10 | 11 | void gridChanged(Grid grid); 12 | } 13 | -------------------------------------------------------------------------------- /examples/grid/src/main/java/org/jbehave/examples/grid/stories/grid_cells_can_be_toggled.story: -------------------------------------------------------------------------------- 1 | Scenario: The grid starts empty 2 | 3 | Given a new game: 5 by 5 4 | Then the grid should be 5 | ..... 6 | ..... 7 | ..... 8 | ..... 9 | ..... 10 | 11 | Scenario: The grid cells can be toggled 12 | 13 | Given a 5 by 5 game 14 | When I toggle the cell at (2, 3) 15 | Then the grid should look like 16 | ..... 17 | ..... 18 | ..... 19 | ..X.. 20 | ..... 21 | When I toggle the cell at (2, 4) 22 | Then the grid should look like 23 | ..... 24 | ..... 25 | ..... 26 | ..X.. 27 | ..X.. 28 | When I toggle the cell at (2, 3) 29 | Then the grid should look like 30 | ..... 31 | ..... 32 | ..... 33 | ..... 34 | ..X.. 35 | -------------------------------------------------------------------------------- /examples/groovy/src/main/groovy/org/jbehave/examples/groovy/configuration/MyReporterBuilder.groovy: -------------------------------------------------------------------------------- 1 | import org.jbehave.core.reporters.StoryReporterBuilder 2 | 3 | import static org.jbehave.core.reporters.StoryReporterBuilder.Format.* 4 | 5 | class MyReportBuilder extends StoryReporterBuilder { 6 | public MyReportBuilder() { 7 | this.withFormats(CONSOLE, TXT, HTML, XML).withDefaultFormats(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/groovy/src/main/java/org/jbehave/examples/groovy/stories/using_groovy.story: -------------------------------------------------------------------------------- 1 | Scenario: We show that the following steps can be implemented using groovy 2 | (in src/main/groovy) 3 | 4 | Meta: @lang groovy 5 | 6 | Given a date of 10/16/2010 7 | When 2 days pass 8 | Then the date is 10/18/2010 9 | And some otherwise ambiguous two string step, with one and two as strings 10 | -------------------------------------------------------------------------------- /examples/guice/src/main/java/org/jbehave/examples/core/guice/GuiceCoreSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.guice; 2 | 3 | import com.google.inject.Inject; 4 | 5 | import org.jbehave.examples.core.service.TradingService; 6 | import org.jbehave.examples.core.steps.TraderSteps; 7 | 8 | /** 9 | * POJO annotated to allow Guice injection. 10 | */ 11 | public class GuiceCoreSteps extends TraderSteps { 12 | 13 | @Inject 14 | public GuiceCoreSteps(TradingService service) { 15 | super(service); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/i18n/src/main/java/org/jbehave/examples/trader/i18n/DeStories.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.trader.i18n; 2 | 3 | import java.util.Locale; 4 | 5 | import org.jbehave.core.junit.JUnit4StoryRunner; 6 | import org.jbehave.examples.trader.i18n.steps.DeSteps; 7 | import org.junit.runner.RunWith; 8 | 9 | @RunWith(JUnit4StoryRunner.class) 10 | public class DeStories extends LocalizedStories { 11 | 12 | @Override 13 | protected Locale locale() { 14 | return new Locale("de"); 15 | } 16 | 17 | @Override 18 | protected String storyPattern() { 19 | return "**/*.geschichte"; 20 | } 21 | 22 | @Override 23 | protected Object localizedSteps() { 24 | return new DeSteps(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /examples/i18n/src/main/java/org/jbehave/examples/trader/i18n/FrStories.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.trader.i18n; 2 | 3 | import java.util.Locale; 4 | 5 | import org.jbehave.core.junit.JUnit4StoryRunner; 6 | import org.jbehave.examples.trader.i18n.steps.FrSteps; 7 | import org.junit.runner.RunWith; 8 | 9 | @RunWith(JUnit4StoryRunner.class) 10 | public class FrStories extends LocalizedStories { 11 | 12 | @Override 13 | protected Locale locale() { 14 | return new Locale("fr"); 15 | } 16 | 17 | @Override 18 | protected String storyPattern() { 19 | return "**/*.histoire"; 20 | } 21 | 22 | @Override 23 | protected Object localizedSteps() { 24 | return new FrSteps(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /examples/i18n/src/main/java/org/jbehave/examples/trader/i18n/ItStories.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.trader.i18n; 2 | 3 | import java.util.Locale; 4 | 5 | import org.jbehave.core.junit.JUnit4StoryRunner; 6 | import org.jbehave.examples.trader.i18n.steps.ItSteps; 7 | import org.junit.runner.RunWith; 8 | 9 | @RunWith(JUnit4StoryRunner.class) 10 | public class ItStories extends LocalizedStories { 11 | 12 | @Override 13 | protected Locale locale() { 14 | return new Locale("it"); 15 | } 16 | 17 | @Override 18 | protected String storyPattern() { 19 | return "**/*.storia"; 20 | } 21 | 22 | @Override 23 | protected Object localizedSteps() { 24 | return new ItSteps(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /examples/i18n/src/main/java/org/jbehave/examples/trader/i18n/PtStories.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.trader.i18n; 2 | 3 | import java.util.Locale; 4 | 5 | import org.jbehave.core.junit.JUnit4StoryRunner; 6 | import org.jbehave.examples.trader.i18n.steps.PtSteps; 7 | import org.junit.runner.RunWith; 8 | 9 | @RunWith(JUnit4StoryRunner.class) 10 | public class PtStories extends LocalizedStories { 11 | 12 | @Override 13 | protected Locale locale() { 14 | return new Locale("pt"); 15 | } 16 | 17 | @Override 18 | protected String storyPattern() { 19 | return "**/*.historia"; 20 | } 21 | 22 | @Override 23 | protected Object localizedSteps() { 24 | return new PtSteps(); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /examples/i18n/src/main/java/org/jbehave/examples/trader/i18n/SvStories.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.trader.i18n; 2 | 3 | import java.util.Locale; 4 | 5 | import org.jbehave.core.junit.JUnit4StoryRunner; 6 | import org.jbehave.examples.trader.i18n.steps.SvSteps; 7 | import org.junit.runner.RunWith; 8 | 9 | @RunWith(JUnit4StoryRunner.class) 10 | public class SvStories extends LocalizedStories { 11 | 12 | @Override 13 | protected Locale locale() { 14 | return new Locale("sv"); 15 | } 16 | 17 | @Override 18 | protected String storyPattern() { 19 | return "**/*.story"; 20 | } 21 | 22 | @Override 23 | protected Object localizedSteps() { 24 | return new SvSteps(); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /examples/i18n/src/main/java/org/jbehave/examples/trader/i18n/steps/SvSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.trader.i18n.steps; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | 5 | public class SvSteps { 6 | 7 | @Given("att vi finns") 8 | public void exist() { 9 | System.out.println("Exists"); 10 | } 11 | 12 | @Given("att det har startat") 13 | public void started() { 14 | System.out.println("Started"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /examples/i18n/src/main/java/org/jbehave/examples/trader/i18n/stories/sv_and_step.story: -------------------------------------------------------------------------------- 1 | Givet att vi finns 2 | Och att vi finns 3 | Och att det har startat 4 | 5 | -------------------------------------------------------------------------------- /examples/jruby/src/main/java/org/jbehave/examples/jruby/stories/using_jruby.story: -------------------------------------------------------------------------------- 1 | Scenario: We want to show how steps can be implemented in a class written in JRuby 2 | 3 | Given a date of 10/16/2010 4 | When 2 days pass 5 | Then the date is 10/18/2010 6 | -------------------------------------------------------------------------------- /examples/jruby/src/main/ruby/JRubySteps.rb: -------------------------------------------------------------------------------- 1 | require 'java' 2 | 3 | java_package 'org.jbehave.examples.jruby' 4 | 5 | class JRubySteps 6 | 7 | java_annotation 'org.jbehave.core.annotations.Given("a date of $date")' 8 | java_signature 'void givenDate(java.util.Date)' 9 | def date(date) 10 | org.junit.Assert.assertNotNull(date) 11 | end 12 | 13 | java_annotation 'org.jbehave.core.annotations.When("$days days pass")' 14 | java_signature 'void whenDaysPass(int)' 15 | def daysPass(days) 16 | org.junit.Assert.assertNotNull(days) 17 | end 18 | 19 | java_annotation 'org.jbehave.core.annotations.Then("the date is $date")' 20 | java_signature 'void thenTheDate(java.util.Date)' 21 | def theDate(date) 22 | org.junit.Assert.assertNotNull(date) 23 | end 24 | 25 | end 26 | -------------------------------------------------------------------------------- /examples/meta/src/main/java/org/jbehave/examples/core/meta/StepsScanner.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.meta; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.ComponentScan; 5 | import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; 6 | 7 | @ComponentScan({ "org.jbehave.examples.core.meta.steps" }) 8 | public class StepsScanner { 9 | 10 | @Bean 11 | public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { 12 | return new PropertySourcesPlaceholderConfigurer(); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /examples/meta/src/main/java/org/jbehave/examples/core/meta/steps.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/meta/src/main/java/org/jbehave/examples/core/meta/steps/InputSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.meta.steps; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class InputSteps { 8 | 9 | @Given("some input $input") 10 | public void someInput(final String input) { 11 | System.out.println(input); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /examples/meta/src/main/java/org/jbehave/examples/core/meta/stories/meta_by_row.story: -------------------------------------------------------------------------------- 1 | Scenario: a scenario with examples 2 | 3 | Given some input 4 | 5 | Examples: 6 | {metaByRow=true} 7 | |Meta: |param | 8 | |@regression|hi there!| 9 | |@regression|hello | 10 | |@smoke |bye bye | 11 | -------------------------------------------------------------------------------- /examples/needle/src/main/java/org/jbehave/examples/core/needle/steps/NeedleTraderSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.needle.steps; 2 | 3 | import javax.inject.Inject; 4 | 5 | import org.jbehave.examples.core.service.TradingService; 6 | import org.jbehave.examples.core.steps.TraderSteps; 7 | 8 | /** 9 | * POJO annotated to allow Needle injection. 10 | */ 11 | public class NeedleTraderSteps extends TraderSteps { 12 | 13 | @Inject 14 | public NeedleTraderSteps(final TradingService service) { 15 | super(service); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/needle/src/test/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | appender.console.type = Console 2 | appender.console.name = STDOUT 3 | appender.console.layout.type = PatternLayout 4 | appender.console.layout.pattern = %d{HH:mm:ss,SSS} %-5p [%t] %c{3} %3x - %m%n 5 | 6 | rootLogger.level = DEBUG 7 | rootLogger.appenderRefs = console 8 | rootLogger.appenderRef.console.ref = STDOUT 9 | 10 | # package specific 11 | logger.freemarker.name = freemarker.cache 12 | logger.freemarker.level = ERROR 13 | 14 | logger.needle.name = org.needle4j 15 | logger.needle.level = ERROR 16 | -------------------------------------------------------------------------------- /examples/performance/src/main/java/org/jbehave/examples/performance/stories/generate.story: -------------------------------------------------------------------------------- 1 | When a scenario is generated to parsing.story with a tabular argument of 2000 lines and an examples table of 20 lines 2 | 3 | -------------------------------------------------------------------------------- /examples/rest/README.md: -------------------------------------------------------------------------------- 1 | The REST example requires an XWiki instance. 2 | 3 | Download it from http://xwiki.org and setup: 4 | 5 | - User with username/password: jbehave/jbehave 6 | 7 | REST Root URI available in Main space: http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages 8 | 9 | To use Maven plugin, see script rest.sh. 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/rest/rest.sh: -------------------------------------------------------------------------------- 1 | ACTION=$1 2 | 3 | if [ "$ACTION" == "" ] ; then 4 | echo "usage: rest.sh [import|export]" 5 | exit; 6 | fi 7 | 8 | PLUGIN="org.jbehave:jbehave-rest:5.1-SNAPSHOT" 9 | PARAMS="-Djbehave.rest.rootURI=http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages -Djbehave.rest.username=jbehave -Djbehave.rest.password=jbehave" 10 | 11 | if [ "$ACTION" == "export" ] ; then 12 | mvn $PLUGIN:export-from-filesystem $PARAMS -Djbehave.rest.resourcesSyntax=jbehave/3.0 13 | else 14 | mvn $PLUGIN:import-to-filesystem $PARAMS 15 | fi 16 | -------------------------------------------------------------------------------- /examples/rest/src/main/java/org/jbehave/examples/core/rest/stories/export.story: -------------------------------------------------------------------------------- 1 | Scenario: Stories are exported to REST provider 2 | 3 | Given REST provider is XWiki 4 | When stories in src/main/resources/stories are exported to http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/rest/src/main/java/org/jbehave/examples/core/rest/stories/index.story: -------------------------------------------------------------------------------- 1 | Scenario: Story index is retrieved from REST provider. Stories are loaded and uploaded. 2 | 3 | Given REST provider is XWiki 4 | When index is retrieved from http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages 5 | Then the index is not empty 6 | When story first text contains 'first' 7 | When story second text contains 'second' 8 | When story first is uploaded appending 'a modification' 9 | When story first text contains 'a modification' 10 | -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/domain/first.story: -------------------------------------------------------------------------------- 1 | A first domain story -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/domain/second.story: -------------------------------------------------------------------------------- 1 | A second domain story -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/domain/subdomain/third.story: -------------------------------------------------------------------------------- 1 | A third subdomain story -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/main.stories/a_story.story: -------------------------------------------------------------------------------- 1 | another_story 2 | 3 | Narrative: 4 | 5 | .... a modification -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/main.stories/another_story.story: -------------------------------------------------------------------------------- 1 | another_story 2 | 3 | Narrative: 4 | 5 | .... -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/main.webhome/welcome.story: -------------------------------------------------------------------------------- 1 | It's an easy-to-edit website that will help you work better together. This Wiki is made of //pages// sorted by //spaces//. You're currently in the **Main** space, looking at its home page (**WebHome**). 2 | 3 | Learn how to use XWiki with the {{velocity}}[[Getting Started Guide>>http://enterprise.xwiki.org/xwiki/bin/view/GettingStarted/WebHome?version=$xwiki.version]]{{/velocity}}. 4 | 5 | {{velocity}} 6 | #if($hasEdit)You can then use the [[Sandbox space>>Sandbox.WebHome]] to try out your wiki's features.#end 7 | {{/velocity}} 8 | -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/parent_story.story: -------------------------------------------------------------------------------- 1 | The stories containers -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/some_story.story: -------------------------------------------------------------------------------- 1 | Narrative -------------------------------------------------------------------------------- /examples/rest/src/main/resources/stories/webhome.story: -------------------------------------------------------------------------------- 1 | {{include document="Dashboard.WebHome" context="new"/}} -------------------------------------------------------------------------------- /examples/scala/src/main/java/org/jbehave/examples/scala/stories/using_scala.story: -------------------------------------------------------------------------------- 1 | Scenario: We want to show how steps can be implemented in a class written in Scala 2 | 3 | Given a date of 10/16/2010 4 | When 2 days pass 5 | Then the date is 10/18/2010 6 | -------------------------------------------------------------------------------- /examples/scala/src/main/scala/ScalaSteps.scala: -------------------------------------------------------------------------------- 1 | class ScalaSteps { 2 | 3 | @org.jbehave.core.annotations.Given("a date of $date") 4 | def date(date: java.util.Date) { 5 | org.junit.Assert.assertNotNull(date) 6 | } 7 | 8 | @org.jbehave.core.annotations.When("$days days pass") 9 | def daysPass(days: Int) { 10 | org.junit.Assert.assertNotNull(days) 11 | } 12 | 13 | @org.jbehave.core.annotations.Then("the date is $date") 14 | def theDate(date: java.util.Date) { 15 | org.junit.Assert.assertNotNull(date) 16 | } 17 | 18 | override def toString(): String = "ScalaSteps"; 19 | 20 | } -------------------------------------------------------------------------------- /examples/spring-security/src/main/java/org/jbehave/example/spring/security/dao/OrganizationDao.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.example.spring.security.dao; 2 | 3 | import org.jbehave.example.spring.security.domain.Organization; 4 | 5 | public interface OrganizationDao { 6 | 7 | public Organization load(Long id); 8 | 9 | public Organization persist(Organization organization); 10 | 11 | public Organization findByName(String orgName); 12 | } 13 | -------------------------------------------------------------------------------- /examples/spring-security/src/main/java/org/jbehave/example/spring/security/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.example.spring.security.dao; 2 | 3 | import org.jbehave.example.spring.security.domain.User; 4 | 5 | public interface UserDao { 6 | 7 | public User load(Long id); 8 | 9 | public User persist(User user); 10 | 11 | public User findUserByOrganizationAndUsername(Long organizationId, String username); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /examples/spring-security/src/main/java/org/jbehave/example/spring/security/util/DateUtils.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.example.spring.security.util; 2 | 3 | import java.util.Date; 4 | 5 | public abstract class DateUtils { 6 | 7 | public static long getElapsedDays(Date earlyDate, Date laterDate) { 8 | long durationMillis = laterDate.getTime() - earlyDate.getTime(); 9 | return durationMillis / (1000 * 60 * 60 * 24); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/spring-security/src/main/java/org/jbehave/example/spring/security/util/SecurityUtils.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.example.spring.security.util; 2 | 3 | import org.springframework.security.crypto.factory.PasswordEncoderFactories; 4 | import org.springframework.security.crypto.password.PasswordEncoder; 5 | 6 | public abstract class SecurityUtils { 7 | private static final PasswordEncoder PASSWORD_ENCODER = PasswordEncoderFactories.createDelegatingPasswordEncoder(); 8 | 9 | public static String encodePassword(String passwordCleartext) { 10 | return PASSWORD_ENCODER.encode(passwordCleartext); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/spring-security/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | appender.console.type = Console 2 | appender.console.name = STDOUT 3 | appender.console.layout.type = PatternLayout 4 | appender.console.layout.pattern = %-4r [%t] %-5p %c %x - %m%n 5 | 6 | rootLogger.level = ERROR 7 | rootLogger.appenderRefs = console 8 | rootLogger.appenderRef.console.ref = STDOUT 9 | -------------------------------------------------------------------------------- /examples/spring/src/main/java/org/jbehave/examples/core/spring/CoreStoriesUsingSpringWithAnnotationConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.spring; 2 | 3 | import org.jbehave.core.steps.spring.SpringApplicationContextFactory; 4 | import org.springframework.context.ApplicationContext; 5 | 6 | /** 7 | * Using Spring's annotation configuration 8 | */ 9 | public class CoreStoriesUsingSpringWithAnnotationConfiguration extends CoreStoriesUsingSpring { 10 | 11 | @Override 12 | protected ApplicationContext createContext() { 13 | return new SpringApplicationContextFactory("org.jbehave.examples.core.spring.SpringAnnotationConfiguration") 14 | .createApplicationContext(); 15 | } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/threads/README.md: -------------------------------------------------------------------------------- 1 | Have a look ath the element within the pom.xml of this example. 2 | 3 | By default, two threads are going to execute stories. There are three stories, so two will go in parallel, followed by the third on its own. 4 | 5 | If you do mvn install -Dthreads=1 you're overiding the setting of the pom file. -------------------------------------------------------------------------------- /examples/threads/src/main/java/org/jbehave/examples/threads/stories/a_failed.story: -------------------------------------------------------------------------------- 1 | Scenario: A failing scenario 2 | 3 | Meta: 4 | 5 | @outcome failed 6 | 7 | When something bad happens 8 | -------------------------------------------------------------------------------- /examples/threads/src/main/java/org/jbehave/examples/threads/stories/a_long.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | @theme Twain 4 | @actor Huck 5 | 6 | Scenario: Huck counts 7 | 8 | When Huck counts to 5 Mississippi 9 | -------------------------------------------------------------------------------- /examples/threads/src/main/java/org/jbehave/examples/threads/stories/another_long.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | @theme Twain 4 | @actor Tom 5 | 6 | Scenario: Tom counts 7 | 8 | When Tom counts to 10 Mississippi 9 | -------------------------------------------------------------------------------- /examples/upload-reports.sh: -------------------------------------------------------------------------------- 1 | 2 | EXAMPLE=$1 3 | 4 | if [ "$EXAMPLE" == "" ]; then 5 | echo "usage: upload-reports.sh " 6 | exit; 7 | fi 8 | 9 | cd target 10 | 11 | cp -r jbehave-reports/view $EXAMPLE 12 | 13 | zip -r $EXAMPLE.zip $EXAMPLE 14 | 15 | scp $EXAMPLE.zip jbehave.org: 16 | 17 | EXAMPLES="/var/www/jbehave.org/reference/examples" 18 | 19 | ssh jbehave.org "rm -r $EXAMPLE; unzip -uo $EXAMPLE.zip; mkdir -p $EXAMPLES; rm -r $EXAMPLES/$EXAMPLE; mv -f $EXAMPLE $EXAMPLES" 20 | -------------------------------------------------------------------------------- /examples/urls/src/main/java/org/jbehave/examples/core/urls/URLCoreEmbedder.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.urls; 2 | 3 | import org.jbehave.core.configuration.Configuration; 4 | import org.jbehave.core.io.LoadFromURL; 5 | import org.jbehave.examples.core.CoreStoriesEmbedders.CoreEmbedder; 6 | 7 | /** 8 | * Specifies the Embedder for the core example, using URL story loading. It 9 | * extends CoreEmbedder simply for convenience, in order to avoid 10 | * duplicating common configuration. 11 | */ 12 | public class URLCoreEmbedder extends CoreEmbedder { 13 | 14 | @Override 15 | public Configuration configuration() { 16 | return super.configuration().useStoryLoader(new LoadFromURL()); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /examples/weld/src/main/java/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /examples/weld/src/main/java/org/jbehave/examples/core/weld/WeldCoreSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.examples.core.weld; 2 | 3 | import javax.inject.Inject; 4 | import javax.inject.Singleton; 5 | 6 | import org.jbehave.core.annotations.weld.WeldStep; 7 | import org.jbehave.examples.core.service.TradingService; 8 | import org.jbehave.examples.core.steps.TraderSteps; 9 | 10 | 11 | /** 12 | * POJO annotated to allow Weld injection. 13 | */ 14 | @WeldStep 15 | @Singleton 16 | public class WeldCoreSteps extends TraderSteps { 17 | 18 | @Inject 19 | public WeldCoreSteps(TradingService service) { 20 | super(service); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/InjectableEmbedder.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core; 2 | 3 | import org.jbehave.core.embedder.Embedder; 4 | 5 | /** 6 | *

7 | * Abstract implementation of {@link Embeddable} which allows to inject 8 | * the {@link Embedder} used to run the story or stories. 9 | *

10 | */ 11 | public abstract class InjectableEmbedder implements Embeddable { 12 | 13 | private Embedder embedder = new Embedder(); 14 | 15 | @Override 16 | public void useEmbedder(Embedder embedder) { 17 | this.embedder = embedder; 18 | } 19 | 20 | public Embedder injectedEmbedder() { 21 | return embedder; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/AfterStories.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface AfterStories { 13 | 14 | /** 15 | * Lifecycle hooks with the higher order will be executed last 16 | * 17 | * @return order value 18 | */ 19 | int order() default 0; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/AfterStory.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface AfterStory { 13 | 14 | boolean uponGivenStory() default false; 15 | 16 | /** 17 | * Lifecycle hooks with the higher order will be executed last 18 | * 19 | * @return order value 20 | */ 21 | int order() default 0; 22 | } 23 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Alias.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface Alias { 13 | 14 | String value(); 15 | 16 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Aliases.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface Aliases { 13 | 14 | String[] values(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/AsJson.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.TYPE) 11 | @Documented 12 | public @interface AsJson { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/AsParameterConverter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface AsParameterConverter { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/AsParameters.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.TYPE) 11 | @Documented 12 | public @interface AsParameters { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/BeforeStories.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface BeforeStories { 13 | 14 | /** 15 | * Lifecycle hooks with the higher order will be executed first 16 | * 17 | * @return order value 18 | */ 19 | int order() default 0; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/BeforeStory.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface BeforeStory { 13 | 14 | boolean uponGivenStory() default false; 15 | 16 | /** 17 | * Lifecycle hooks with the higher order will be executed first 18 | * 19 | * @return order value 20 | */ 21 | int order() default 0; 22 | } 23 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Composite.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface Composite { 13 | 14 | String[] steps() default {}; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/FromContext.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.PARAMETER) 11 | @Documented 12 | public @interface FromContext { 13 | 14 | String value(); 15 | 16 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Given.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface Given { 13 | 14 | String value(); 15 | 16 | int priority() default 0; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Named.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.PARAMETER) 11 | @Documented 12 | public @interface Named { 13 | 14 | String value(); 15 | 16 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Parameter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.FIELD) 11 | @Documented 12 | public @interface Parameter { 13 | 14 | String name(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Pending.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface Pending { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/ScenarioType.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | public enum ScenarioType { 4 | 5 | /** 6 | * Any type of scenario 7 | */ 8 | ANY, 9 | 10 | /** 11 | * Scenario that is part of normal story execution 12 | */ 13 | NORMAL, 14 | 15 | /** 16 | * Scenario that is parametrised by example 17 | */ 18 | EXAMPLE 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Scope.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | public enum Scope { 4 | 5 | /** 6 | * Step 7 | */ 8 | STEP, 9 | 10 | /** 11 | * Scenario 12 | */ 13 | SCENARIO, 14 | 15 | /** 16 | * Story 17 | */ 18 | STORY 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/Then.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface Then { 13 | 14 | String value(); 15 | 16 | int priority() default 0; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/ToContext.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import static org.jbehave.core.annotations.ToContext.RetentionLevel.EXAMPLE; 4 | 5 | import java.lang.annotation.Documented; 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target(ElementType.METHOD) 13 | @Documented 14 | public @interface ToContext { 15 | 16 | enum RetentionLevel { 17 | STORY, SCENARIO, EXAMPLE 18 | } 19 | 20 | String value(); 21 | 22 | RetentionLevel retentionLevel() default EXAMPLE; 23 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/UsingPaths.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Inherited; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | import org.jbehave.core.io.StoryFinder; 11 | 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target({ ElementType.TYPE }) 14 | @Inherited 15 | @Documented 16 | public @interface UsingPaths { 17 | 18 | String searchIn(); 19 | String[] includes() default {"**/*.story"}; 20 | String[] excludes() default {}; 21 | Class storyFinder() default StoryFinder.class; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/UsingSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Inherited; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Target({ ElementType.TYPE }) 12 | @Inherited 13 | @Documented 14 | public @interface UsingSteps { 15 | 16 | Class[] instances() default {}; 17 | 18 | String[] packages() default {}; 19 | 20 | String matchingNames() default ".*"; 21 | 22 | String notMatchingNames() default ""; 23 | 24 | boolean inheritInstances() default true; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/annotations/When.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.METHOD) 11 | @Documented 12 | public @interface When { 13 | 14 | String value(); 15 | 16 | int priority() default 0; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/condition/StepConditionMatchException.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.condition; 2 | 3 | public class StepConditionMatchException extends Exception { 4 | 5 | private static final long serialVersionUID = -4614724300184207452L; 6 | 7 | public StepConditionMatchException(Throwable cause) { 8 | super(cause); 9 | } 10 | 11 | public StepConditionMatchException(String message) { 12 | super(message); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/condition/StepConditionMatcher.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.condition; 2 | 3 | import java.util.function.Predicate; 4 | 5 | public interface StepConditionMatcher { 6 | 7 | /** 8 | * Checks whether the condition matches the input value 9 | * @param condition a class with the implementation of the condition 10 | * @param value the argument to be matched against the condition 11 | * @return the condition evaluation result 12 | * @throws StepConditionMatchException if any error during match process occur 13 | */ 14 | boolean matches(Class> condition, Object value) throws StepConditionMatchException; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/configuration/AnnotationMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.configuration; 2 | 3 | import java.lang.annotation.Annotation; 4 | 5 | public interface AnnotationMonitor { 6 | 7 | void elementCreationFailed(Class elementClass, Exception cause); 8 | 9 | void annotationNotFound(Class annotation, Object annotatedInstance); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/configuration/AnnotationRequired.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.configuration; 2 | 3 | import java.lang.annotation.Annotation; 4 | 5 | /** 6 | * Thrown when an annotation is required and not found. 7 | */ 8 | @SuppressWarnings("serial") 9 | public class AnnotationRequired extends RuntimeException { 10 | 11 | /** 12 | * Used when an annotation is required and not found 13 | * 14 | * @param annotatedClass the annotated Class 15 | * @param missingAnnotation the missing Annotation class 16 | */ 17 | public AnnotationRequired(Class annotatedClass, 18 | Class missingAnnotation) { 19 | super(annotatedClass + " requires to be annotated by " + missingAnnotation + "."); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/configuration/NullAnnotationMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.configuration; 2 | 3 | import java.lang.annotation.Annotation; 4 | 5 | /** 6 | * Null Object 7 | * Pattern implementation of {@link AnnotationMonitor}. Can be extended to 8 | * override only the methods of interest. 9 | */ 10 | public class NullAnnotationMonitor implements AnnotationMonitor { 11 | 12 | @Override 13 | public void elementCreationFailed(Class elementClass, Exception cause) { 14 | // Do nothing by default 15 | } 16 | 17 | @Override 18 | public void annotationNotFound(Class annotation, Object annotatedInstance) { 19 | // Do nothing by default 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/configuration/ParanamerConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.configuration; 2 | 3 | import com.thoughtworks.paranamer.BytecodeReadingParanamer; 4 | import com.thoughtworks.paranamer.CachingParanamer; 5 | import com.thoughtworks.paranamer.Paranamer; 6 | 7 | /** 8 | * The configuration that uses: 9 | *
    10 | *
  • {@link Paranamer}: {@link CachingParanamer}
  • 11 | *
12 | */ 13 | public class ParanamerConfiguration extends MostUsefulConfiguration { 14 | 15 | public ParanamerConfiguration() { 16 | useParanamer(new CachingParanamer(new BytecodeReadingParanamer())); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/context/ContextView.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.context; 2 | 3 | /** 4 | * ContextView allows the viewing of context-related messages. 5 | */ 6 | public interface ContextView { 7 | 8 | void show(String story, String scenario, String step); 9 | 10 | void close(); 11 | 12 | public static class NULL implements ContextView { 13 | @Override 14 | public void show(String story, String scenario, String step) { 15 | } 16 | 17 | @Override 18 | public void close() { 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/embedder/DuplicateCandidateFound.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.embedder; 2 | 3 | import static java.text.MessageFormat.format; 4 | 5 | import org.jbehave.core.steps.StepCandidate; 6 | 7 | public class DuplicateCandidateFound extends RuntimeException { 8 | 9 | private static final long serialVersionUID = -4210169420292605056L; 10 | 11 | private static final String DUPLICATE_FORMAT = "{0} {1}"; 12 | 13 | public DuplicateCandidateFound(StepCandidate candidate) { 14 | super(format(DUPLICATE_FORMAT, candidate.getStepType(), candidate.getPatternAsString())); 15 | } 16 | 17 | public DuplicateCandidateFound(String step) { 18 | super(step); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/embedder/SilentEmbedderMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.embedder; 2 | 3 | /** 4 | * Monitor that reports nothing 5 | */ 6 | public class SilentEmbedderMonitor extends PrintingEmbedderMonitor { 7 | 8 | @Override 9 | protected void print(String format, Object... args) { 10 | } 11 | 12 | @Override 13 | protected void printStackTrace(Throwable e) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/embedder/executors/DirectExecutorService.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.embedder.executors; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | 5 | import com.google.common.util.concurrent.MoreExecutors; 6 | 7 | import org.jbehave.core.embedder.EmbedderControls; 8 | 9 | /** 10 | * Creates instances of {@link MoreExecutors#newDirectExecutorService()}. 11 | */ 12 | public class DirectExecutorService implements ExecutorServiceFactory { 13 | 14 | @Override 15 | public ExecutorService create(EmbedderControls controls) { 16 | return MoreExecutors.newDirectExecutorService(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/embedder/executors/ExecutorServiceFactory.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.embedder.executors; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | 5 | import org.jbehave.core.embedder.EmbedderControls; 6 | 7 | public interface ExecutorServiceFactory { 8 | 9 | ExecutorService create(EmbedderControls controls); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/embedder/executors/FixedThreadExecutors.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.embedder.executors; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | import java.util.concurrent.Executors; 5 | 6 | import org.jbehave.core.embedder.EmbedderControls; 7 | 8 | /** 9 | * Creates instances of {@link Executors#newFixedThreadPool(int)}. 10 | */ 11 | public class FixedThreadExecutors implements ExecutorServiceFactory { 12 | 13 | @Override 14 | public ExecutorService create(EmbedderControls controls) { 15 | return Executors.newFixedThreadPool(controls.threads()); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/expressions/BiArgExpressionProcessor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.expressions; 2 | 3 | import java.util.function.BiFunction; 4 | 5 | public class BiArgExpressionProcessor extends MultiArgExpressionProcessor { 6 | 7 | public BiArgExpressionProcessor(String expressionName, BiFunction evaluator) { 8 | super(expressionName, 2, args -> evaluator.apply(args.get(0), args.get(1))); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/expressions/ExpressionProcessor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.expressions; 2 | 3 | import java.util.Optional; 4 | 5 | public interface ExpressionProcessor { 6 | Optional execute(String expression); 7 | } 8 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/expressions/ExpressionResolverMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.expressions; 2 | 3 | public interface ExpressionResolverMonitor { 4 | 5 | void onExpressionProcessingError(String stringWithExpressions, RuntimeException error); 6 | } 7 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/expressions/NullExpressionResolverMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.expressions; 2 | 3 | /** 4 | * Null Object Pattern 5 | * implementation of {@link ExpressionResolverMonitor}. Can be extended to override only the methods of interest. 6 | */ 7 | public class NullExpressionResolverMonitor implements ExpressionResolverMonitor { 8 | 9 | @Override 10 | public void onExpressionProcessingError(String stringWithExpressions, RuntimeException error) { 11 | // Do nothing by default 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/expressions/PrintingExpressionResolverMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.expressions; 2 | 3 | /** 4 | * Abstract monitor that reports to output which should be defined in child implementations. 5 | */ 6 | public abstract class PrintingExpressionResolverMonitor implements ExpressionResolverMonitor { 7 | 8 | @Override 9 | public void onExpressionProcessingError(String stringWithExpressions, RuntimeException error) { 10 | print("Unable to process expression(s) '%s'", stringWithExpressions); 11 | printStackTrace(error); 12 | } 13 | 14 | protected abstract void print(String format, Object... args); 15 | 16 | protected abstract void printStackTrace(Throwable e); 17 | } 18 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/expressions/SingleArgExpressionProcessor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.expressions; 2 | 3 | import java.util.function.Function; 4 | 5 | public class SingleArgExpressionProcessor extends MultiArgExpressionProcessor { 6 | 7 | public SingleArgExpressionProcessor(String functionName, Function evaluator) { 8 | super(functionName, 1, args -> evaluator.apply(args.get(0))); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/FailingUponPendingStep.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | public final class FailingUponPendingStep implements PendingStepStrategy { 4 | 5 | @Override 6 | public void handleFailure(Throwable throwable) throws Throwable { 7 | throw throwable; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/FailureStrategy.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | /** 4 | * FailureStrategy allows to define failure handling strategies. Two standard 5 | * strategies are provided: 6 | *
    7 | *
  • {@link SilentlyAbsorbingFailure}: silently absorbs the failure
  • 8 | *
  • {@link RethrowingFailure}: rethrows the failure
  • 9 | *
10 | */ 11 | public interface FailureStrategy { 12 | 13 | void handleFailure(Throwable throwable) throws Throwable; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/IgnoringStepsFailure.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | /** 4 | * Runtime exception thrown to indicate that the current and following steps should be ignored 5 | */ 6 | @SuppressWarnings("serial") 7 | public class IgnoringStepsFailure extends RuntimeException { 8 | 9 | public IgnoringStepsFailure(String message) { 10 | super(message); 11 | } 12 | 13 | public IgnoringStepsFailure(String message, Throwable cause) { 14 | super(message, cause); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/KnownFailure.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | /** 4 | * Runtime exception thrown to indicate the occurrence of a known failure. 5 | * A known failure will typically be handled with less verbose reporting. 6 | */ 7 | @SuppressWarnings("serial") 8 | public class KnownFailure extends RuntimeException { 9 | 10 | public KnownFailure() { 11 | } 12 | 13 | public KnownFailure(String message) { 14 | super(message); 15 | } 16 | 17 | public KnownFailure(Throwable cause) { 18 | super(cause); 19 | } 20 | 21 | public KnownFailure(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/PassingUponPendingStep.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | public final class PassingUponPendingStep implements PendingStepStrategy { 4 | 5 | @Override 6 | public void handleFailure(Throwable throwable) { 7 | // do nothing 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/PendingStepFound.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | /** 4 | * Thrown when a pending step is found 5 | */ 6 | @SuppressWarnings("serial") 7 | public class PendingStepFound extends UUIDExceptionWrapper { 8 | 9 | public PendingStepFound(String step) { 10 | super(step); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/PendingStepStrategy.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | /** 4 | * PendingStepStrategy allows to define how pending steps are handled. Two 5 | * standard strategies are provided: 6 | *
    7 | *
  • {@link PassingUponPendingStep}: passes upon pending step
  • 8 | *
  • {@link FailingUponPendingStep}: fails upon pending step
  • 9 | *
10 | */ 11 | public interface PendingStepStrategy extends FailureStrategy { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/PendingStepsFound.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.jbehave.core.steps.StepCreator.PendingStep; 7 | 8 | /** 9 | * Thrown when a pending step is found 10 | */ 11 | @SuppressWarnings("serial") 12 | public class PendingStepsFound extends UUIDExceptionWrapper { 13 | 14 | public PendingStepsFound(List steps) { 15 | super(asString(steps)); 16 | } 17 | 18 | private static String asString(List steps) { 19 | List list = new ArrayList<>(); 20 | for (PendingStep step : steps) { 21 | list.add(step.stepAsString()); 22 | } 23 | return list.toString(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/RestartingScenarioFailure.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | /** 4 | * Runtime exception thrown to indicate that the scenario should be restarted. 5 | */ 6 | @SuppressWarnings("serial") 7 | public class RestartingScenarioFailure extends RuntimeException { 8 | 9 | public RestartingScenarioFailure(String message) { 10 | super(message); 11 | } 12 | 13 | public RestartingScenarioFailure(String message, Throwable cause) { 14 | super(message, cause); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/RestartingStoryFailure.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | /** 4 | * Runtime exception thrown to indicate that the story should be restarted. 5 | */ 6 | @SuppressWarnings("serial") 7 | public class RestartingStoryFailure extends RuntimeException { 8 | 9 | public RestartingStoryFailure(String message) { 10 | super(message); 11 | } 12 | 13 | public RestartingStoryFailure(String message, Throwable cause) { 14 | super(message, cause); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/RethrowingFailure.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | public final class RethrowingFailure implements FailureStrategy { 4 | 5 | @Override 6 | public void handleFailure(Throwable throwable) throws Throwable { 7 | if (throwable instanceof UUIDExceptionWrapper) { 8 | throw throwable.getCause(); 9 | } 10 | throw throwable; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/SilentlyAbsorbingFailure.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | public final class SilentlyAbsorbingFailure implements FailureStrategy { 4 | 5 | @Override 6 | public void handleFailure(Throwable throwable) { 7 | // do nothing 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/failures/StepFailed.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.failures; 2 | 3 | import org.jbehave.core.model.OutcomesTable; 4 | 5 | /** 6 | * Thrown when a step execution has failed 7 | */ 8 | @SuppressWarnings("serial") 9 | public class StepFailed extends UUIDExceptionWrapper { 10 | 11 | public StepFailed(String step, Throwable cause) { 12 | super("'" + step + "': " + cause.getMessage(), cause); 13 | } 14 | 15 | public StepFailed(String step, OutcomesTable table) { 16 | super("'" + step + "': " + table, table.failureCause()); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/io/AbsolutePathCalculator.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io; 2 | 3 | /** 4 | * {@link PathCalculator} that returns the path provided 5 | */ 6 | public class AbsolutePathCalculator implements PathCalculator { 7 | @Override 8 | public String calculate(String root, String path) { 9 | return path; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/io/InvalidStoryResource.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io; 2 | 3 | /** 4 | * Thrown when a story resource is not valid 5 | */ 6 | @SuppressWarnings("serial") 7 | public class InvalidStoryResource extends RuntimeException { 8 | 9 | public InvalidStoryResource(String storyPath, Throwable cause) { 10 | super("Invalid story resource for " + storyPath, cause); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/io/PathCalculator.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io; 2 | 3 | /** 4 | * Calculates the paths to given stories. 5 | */ 6 | public interface PathCalculator { 7 | String calculate(String root, String path); 8 | } 9 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/io/ResourceLoader.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io; 2 | 3 | public interface ResourceLoader { 4 | 5 | String loadResourceAsText(String resourcePath); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/io/StoryLoader.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io; 2 | 3 | public interface StoryLoader extends ResourceLoader { 4 | 5 | String loadStoryAsText(String storyPath); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/io/StoryNameResolver.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io; 2 | 3 | /** 4 | *

5 | * Resolves story names from their paths. 6 | *

7 | */ 8 | public interface StoryNameResolver { 9 | 10 | String resolveName(String path); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/io/StoryPathResolver.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io; 2 | 3 | import org.jbehave.core.Embeddable; 4 | 5 | /** 6 | *

7 | * Resolves story paths converting the Java {@link Embeddable} class to a resource 8 | * path. 9 | *

10 | */ 11 | public interface StoryPathResolver { 12 | 13 | String resolve(Class embeddableClass); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/io/StoryResourceNotFound.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Thrown when a story resource is not found 7 | */ 8 | @SuppressWarnings("serial") 9 | public class StoryResourceNotFound extends RuntimeException { 10 | 11 | public StoryResourceNotFound(String storyPath, ClassLoader classLoader) { 12 | super("Story path '" + storyPath + "' not found by class loader " + classLoader); 13 | } 14 | 15 | public StoryResourceNotFound(String storyPath, List traversalPaths) { 16 | super("Story path '" + storyPath + "' not found while looking in '" + traversalPaths + "'"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/junit/JUnitStories.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.junit; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | *

7 | * JUnit-runnable entry-point to run multiple stories specified by {@link #storyPaths()}. 8 | * The {@link #run()} method is annotated as JUnit {@link Test}. 9 | *

10 | */ 11 | public abstract class JUnitStories extends JupiterStories { 12 | 13 | @Override 14 | @Test 15 | public void run() { 16 | super.run(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/junit/JUnitStory.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.junit; 2 | 3 | import static java.util.Arrays.asList; 4 | 5 | import java.util.List; 6 | 7 | import org.jbehave.core.io.StoryPathResolver; 8 | 9 | /** 10 | *

11 | * JUnit-runnable entry-point to run a single story using the configured {@link StoryPathResolver} 12 | * to resolve the story path from the instance class name. 13 | *

14 | */ 15 | public abstract class JUnitStory extends JUnitStories { 16 | 17 | @Override 18 | public List storyPaths() { 19 | StoryPathResolver pathResolver = configuredEmbedder().configuration().storyPathResolver(); 20 | String storyPath = pathResolver.resolve(this.getClass()); 21 | return asList(storyPath); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/junit/JUnitStoryMaps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.junit; 2 | 3 | import java.util.List; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | *

9 | * JUnit-runnable entry-point to map stories specified by {@link #storyPaths()}, 10 | * using the meta filters specified by {@link #metaFilters()}. 11 | *

12 | */ 13 | public abstract class JUnitStoryMaps extends JupiterStories { 14 | 15 | @Override 16 | @Test 17 | public void run() { 18 | configuredEmbedder().mapStoriesAsPaths(storyPaths()); 19 | } 20 | 21 | public abstract List metaFilters(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/model/AliasVariant.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.model; 2 | 3 | public class AliasVariant { 4 | 5 | private final String value; 6 | 7 | public AliasVariant(String value) { 8 | this.value = value; 9 | } 10 | 11 | public String getValue() { 12 | return value; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/model/Description.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.model; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | public class Description { 7 | 8 | public static final Description EMPTY = new Description(""); 9 | 10 | private final String descriptionAsString; 11 | 12 | public Description(String descriptionAsString) { 13 | this.descriptionAsString = descriptionAsString; 14 | } 15 | 16 | public String asString() { 17 | return descriptionAsString; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/model/TableTransformerMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.model; 2 | 3 | import org.jbehave.core.model.ExamplesTable.TableProperties; 4 | 5 | /** 6 | * Interface to monitor table transformer events 7 | */ 8 | public interface TableTransformerMonitor { 9 | 10 | void beforeTransformerApplying(String transformerName, TableProperties properties, String inputTable); 11 | 12 | void afterTransformerApplying(String transformerName, TableProperties properties, String outputTable); 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/parsers/AliasParser.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.parsers; 2 | 3 | import java.util.Collection; 4 | import java.util.Set; 5 | 6 | import org.jbehave.core.model.Alias; 7 | 8 | public interface AliasParser { 9 | 10 | Collection parse(Set aliasesAsStrings); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/parsers/CompositeParser.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.parsers; 2 | 3 | import java.util.List; 4 | 5 | import org.jbehave.core.model.Composite; 6 | 7 | /** 8 | *

9 | * Parses the composite steps from their textual representation. 10 | *

11 | * @author Valery Yatsynovich 12 | */ 13 | public interface CompositeParser { 14 | 15 | /** 16 | * Parses composite steps from their textual representation 17 | * 18 | * @param compositesAsText the textual representation 19 | * @return The List of Composite 20 | */ 21 | List parseComposites(String compositesAsText); 22 | } 23 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/parsers/StepMatcher.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.parsers; 2 | 3 | import java.util.regex.Matcher; 4 | 5 | import org.jbehave.core.model.StepPattern; 6 | 7 | /** 8 | * A step matcher is responsible for matching steps against a given step pattern 9 | * and extracting the parameters for the step 10 | */ 11 | public interface StepMatcher { 12 | 13 | Matcher matcher(String stepWithoutStartingWord); 14 | 15 | String[] parameterNames(); 16 | 17 | StepPattern pattern(); 18 | } 19 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/parsers/StoryTransformer.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.parsers; 2 | 3 | public interface StoryTransformer { 4 | 5 | String transform(String storyAsText); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/reporters/ContextOutput.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.reporters; 2 | 3 | import org.jbehave.core.context.Context; 4 | 5 | public class ContextOutput extends Format { 6 | private final Context context; 7 | 8 | public ContextOutput(Context context) { 9 | super("CONTEXT"); 10 | this.context = context; 11 | } 12 | 13 | @Override 14 | public StoryReporter createStoryReporter( 15 | FilePrintStreamFactory filePrintStreamFactory, 16 | StoryReporterBuilder storyReporterBuilder) { 17 | return new ContextStoryReporter(context); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/reporters/ContextStoryReporter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.reporters; 2 | 3 | import org.jbehave.core.context.Context; 4 | import org.jbehave.core.model.Scenario; 5 | import org.jbehave.core.model.Story; 6 | 7 | public class ContextStoryReporter extends NullStoryReporter { 8 | private final Context context; 9 | 10 | public ContextStoryReporter(Context context) { 11 | this.context = context; 12 | } 13 | 14 | @Override 15 | public void beforeStory(Story story, boolean givenStory) { 16 | context.setCurrentStory(story.getPath()); 17 | } 18 | 19 | @Override 20 | public void beforeScenario(Scenario scenario) { 21 | context.setCurrentScenario(scenario.getTitle()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/reporters/PrintStreamFactory.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.reporters; 2 | 3 | import java.io.PrintStream; 4 | 5 | /** 6 | * Creates {@link PrintStream} instances. 7 | *

8 | * Implementations will be responsible for providing all the parameters 9 | * required by the factory. E.g. the {@link FilePrintStreamFactory} provides 10 | * the file path and configuration for the creation. 11 | */ 12 | public interface PrintStreamFactory { 13 | 14 | PrintStream createPrintStream(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/reporters/PrintStreamStepdocReporter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.reporters; 2 | 3 | import java.io.PrintStream; 4 | 5 | public class PrintStreamStepdocReporter extends PrintingStepdocReporter { 6 | 7 | private PrintStream output; 8 | 9 | public PrintStreamStepdocReporter() { 10 | this(System.out); 11 | } 12 | 13 | public PrintStreamStepdocReporter(PrintStream output) { 14 | this.output = output; 15 | } 16 | 17 | @Override 18 | protected void output(String format, Object... args) { 19 | Format.println(output, format, args); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/reporters/StepdocReporter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.reporters; 2 | 3 | import java.util.List; 4 | 5 | import org.jbehave.core.steps.Stepdoc; 6 | 7 | public interface StepdocReporter { 8 | 9 | void stepdocs(List stepdocs, List stepsInstances); 10 | 11 | void stepdocsMatching(String stepAsString, List matching, List stepsIntances); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/reporters/TemplateProcessor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.reporters; 2 | 3 | import java.io.Writer; 4 | import java.util.Map; 5 | 6 | public interface TemplateProcessor { 7 | void process(String resource, Map dataModel, Writer writer); 8 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/reporters/ThreadSafeReporter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.reporters; 2 | 3 | public interface ThreadSafeReporter { 4 | } 5 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/steps/InjectableStepsFactory.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Interface abstracting the creation of {@link CandidateSteps}. 7 | * Concrete implementations will provide different mechanisms 8 | * to create the steps instances. 9 | */ 10 | public interface InjectableStepsFactory { 11 | 12 | List createCandidateSteps(); 13 | 14 | Object createInstanceOfType(Class type); 15 | 16 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/steps/PrintStreamStepMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | import java.io.PrintStream; 4 | 5 | import org.jbehave.core.reporters.Format; 6 | 7 | /** 8 | * StepMonitor that prints to a {@link PrintStream}, defaulting to {@link System#out}. 9 | */ 10 | public class PrintStreamStepMonitor extends PrintingStepMonitor { 11 | 12 | private final PrintStream output; 13 | 14 | public PrintStreamStepMonitor() { 15 | this(System.out); 16 | } 17 | 18 | public PrintStreamStepMonitor(PrintStream output) { 19 | this.output = output; 20 | } 21 | 22 | @Override 23 | protected void print(String format, Object... args) { 24 | Format.println(output, format, args); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/steps/Row.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | import java.util.Map; 4 | 5 | import org.jbehave.core.model.ExamplesTable; 6 | 7 | /** 8 | * Represents a row in an {@link ExamplesTable}. 9 | */ 10 | public interface Row { 11 | 12 | /** 13 | * Returns the values as a Map, where the key is the column name and the value is the row value. 14 | * 15 | * @return The Map of values 16 | */ 17 | Map values(); 18 | 19 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/steps/SilentStepMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | /** 4 | * StepMonitor that prints nothings. 5 | */ 6 | public class SilentStepMonitor extends PrintingStepMonitor { 7 | 8 | @Override 9 | protected void print(String format, Object... args) { 10 | // print nothing 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/steps/Step.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | import java.util.List; 4 | 5 | import org.jbehave.core.configuration.Keywords; 6 | import org.jbehave.core.failures.UUIDExceptionWrapper; 7 | import org.jbehave.core.reporters.StoryReporter; 8 | 9 | /** 10 | * A Step represents a runnable portion of a Scenario, which matches methods annotated in {@link CandidateSteps} 11 | * instances. 12 | */ 13 | public interface Step { 14 | 15 | StepResult perform(StoryReporter storyReporter, UUIDExceptionWrapper storyFailureIfItHappened); 16 | 17 | StepResult doNotPerform(StoryReporter storyReporter, UUIDExceptionWrapper storyFailureIfItHappened); 18 | 19 | String asString(Keywords keywords); 20 | 21 | List getComposedSteps(); 22 | } 23 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/steps/StepResult.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | import org.jbehave.core.failures.UUIDExceptionWrapper; 4 | import org.jbehave.core.reporters.StoryReporter; 5 | 6 | public interface StepResult { 7 | 8 | enum Type { 9 | FAILED, 10 | NOT_PERFORMED, 11 | PENDING, 12 | SUCCESSFUL, 13 | SILENT, 14 | IGNORABLE, 15 | COMMENT, 16 | SKIPPED 17 | } 18 | 19 | String parametrisedStep(); 20 | 21 | StepResult withParameterValues(String parametrisedStep); 22 | 23 | StepResult setTimings(Timer timer); 24 | 25 | void describeTo(StoryReporter reporter); 26 | 27 | UUIDExceptionWrapper getFailure(); 28 | } 29 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/steps/StepType.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | /** 4 | * Enum representing the step types 5 | */ 6 | public enum StepType { 7 | 8 | /** 9 | * Represents a precondition to an event 10 | */ 11 | GIVEN, 12 | 13 | /** 14 | * Represents an event 15 | */ 16 | WHEN, 17 | 18 | /** 19 | * Represents an outcome of an event 20 | */ 21 | THEN, 22 | 23 | /** 24 | * Represents repetition of previous step 25 | */ 26 | AND, 27 | 28 | /** 29 | * Represents an ignorable step 30 | */ 31 | IGNORABLE 32 | } 33 | -------------------------------------------------------------------------------- /jbehave-core/src/main/java/org/jbehave/core/steps/Timer.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | public class Timer { 4 | private long start; 5 | private long end; 6 | 7 | public Timer start() { 8 | start = System.currentTimeMillis(); 9 | return this; 10 | } 11 | 12 | public Timer stop() { 13 | end = System.currentTimeMillis(); 14 | return this; 15 | } 16 | 17 | public long getStart() { 18 | return start; 19 | } 20 | 21 | public long getEnd() { 22 | return end; 23 | } 24 | 25 | public long getDuration() { 26 | return end - start; 27 | } 28 | } -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Modules/tf_populateCheckList.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Modules/tf_populateCheckList.js -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Modules/tf_populateSelect.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Modules/tf_populateSelect.js -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/bg_infDiv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/bg_infDiv.jpg -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/bg_th.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/bg_th.jpg -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_eraser.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_eraser.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_first_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_first_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_last_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_last_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_next_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_next_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_eraser.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_eraser.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_first_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_first_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_last_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_last_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_next_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_next_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_previous_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_over_previous_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_previous_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/btn_previous_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/img_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/Default/images/img_loading.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/bg_headers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/bg_headers.jpg -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/bg_infDiv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/bg_infDiv.jpg -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_filter.png -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_first_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_first_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_last_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_last_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_next_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_next_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_previous_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/btn_previous_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/img_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/MyTheme/images/img_loading.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/bg_skyblue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/bg_skyblue.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/btn_first_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/btn_first_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/btn_last_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/btn_last_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/btn_next_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/btn_next_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/btn_prev_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/btn_prev_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/icn_clear_filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/icn_clear_filters.png -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/img_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/SkyBlue/images/img_loading.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/blank.png -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_clear_filters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_clear_filters.png -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_filter.png -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_first_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_first_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_last_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_last_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_next_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_next_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_previous_page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/btn_previous_page.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/downsimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/downsimple.png -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/icn_filter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/icn_filter.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/icn_filterActive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/icn_filterActive.gif -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/TF_Themes/upsimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/TF_Themes/upsimple.png -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/tablefilter.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/tablefilter.js -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/TableFilter/tablefilter_all.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/main/resources/TableFilter/tablefilter_all.js -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/ftl/jbehave-report-decorated.ftl: -------------------------------------------------------------------------------- 1 | <#ftl strip_whitespace=true> 2 | 3 | 4 | ${name} 5 | 8 | 9 | 10 | <#if format == "html"> 11 | ${body} 12 | <#else> 13 | <#assign brushFormat = format> <#if format == "stats" || format == "json"><#assign brushFormat = "plain"> 14 | ")><#else> 17 | ${body?html} 18 | 19 | 20 | 21 | <#include "./sh.ftl"> 22 | 23 | -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/ftl/jbehave-report-non-decorated.ftl: -------------------------------------------------------------------------------- 1 | <#ftl strip_whitespace=true> 2 | ${body} -------------------------------------------------------------------------------- /jbehave-core/src/main/resources/jbehave.version: -------------------------------------------------------------------------------- 1 | ${project.version} -------------------------------------------------------------------------------- /jbehave-core/src/test/java/DefaultPackageEmbeddable.java: -------------------------------------------------------------------------------- 1 | import org.jbehave.core.Embeddable; 2 | import org.jbehave.core.embedder.Embedder; 3 | 4 | 5 | public class DefaultPackageEmbeddable implements Embeddable { 6 | 7 | @Override 8 | public void run() { 9 | } 10 | 11 | @Override 12 | public void useEmbedder(Embedder embedder) { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/configuration/ParanamerConfigurationBehaviour.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.configuration; 2 | 3 | import static org.hamcrest.MatcherAssert.assertThat; 4 | import static org.hamcrest.Matchers.instanceOf; 5 | 6 | import com.thoughtworks.paranamer.CachingParanamer; 7 | 8 | import org.junit.jupiter.api.Test; 9 | 10 | class ParanamerConfigurationBehaviour { 11 | 12 | @Test 13 | void shouldUseCachingParanamer() { 14 | assertThat(new ParanamerConfiguration().paranamer(), instanceOf(CachingParanamer.class)); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/embedder/a_long.story: -------------------------------------------------------------------------------- 1 | 2 | When Mauro counts to 3 Mississippi 3 | When Paul counts to 3 Mississippi -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/embedder/a_short.story: -------------------------------------------------------------------------------- 1 | 2 | When Mauro counts to 1 Mississippi -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/embedder/another_long.story: -------------------------------------------------------------------------------- 1 | 2 | When Mauro counts to 5 Mississippi 3 | When Paul counts to 5 Mississippi -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/embedder/executors/ExecutorsBehaviour.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.embedder.executors; 2 | 3 | import static org.hamcrest.MatcherAssert.assertThat; 4 | import static org.hamcrest.Matchers.instanceOf; 5 | 6 | import java.util.concurrent.ExecutorService; 7 | 8 | import org.jbehave.core.embedder.EmbedderControls; 9 | import org.junit.jupiter.api.Test; 10 | 11 | class ExecutorsBehaviour { 12 | 13 | @Test 14 | void shouldCreateExecutors() { 15 | assertThat(new FixedThreadExecutors().create(new EmbedderControls()), instanceOf(ExecutorService.class)); 16 | assertThat(new DirectExecutorService().create(new EmbedderControls()), instanceOf(ExecutorService.class)); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/MyGroovyStory.groovy: -------------------------------------------------------------------------------- 1 | class MyGroovyStory{ 2 | 3 | } -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/MyPendingStory.txt: -------------------------------------------------------------------------------- 1 | Given my step -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/[mage_hg]/MyPendingStory.txt: -------------------------------------------------------------------------------- 1 | Given my step -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/foldername has spaces/MyPendingStory.txt: -------------------------------------------------------------------------------- 1 | Given my step -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/my_dependent_story: -------------------------------------------------------------------------------- 1 | Scenario: the dependent scenario 2 | 3 | GivenScenario my_given_scenario 4 | Given my other step 5 | 6 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/my_given_story: -------------------------------------------------------------------------------- 1 | Scenario: the given scenario 2 | 3 | Given my step 4 | 5 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/my_multiple_story: -------------------------------------------------------------------------------- 1 | Scenario: the first scenario 2 | 3 | Given my step 4 | 5 | Scenario: the second scenario 6 | 7 | Given my second step -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/my_pending_story: -------------------------------------------------------------------------------- 1 | Given my step -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/io/stories/my_pending_story.txt: -------------------------------------------------------------------------------- 1 | Given my step -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/model/LifecycleBehaviour.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.model; 2 | 3 | import static org.hamcrest.MatcherAssert.assertThat; 4 | import static org.hamcrest.Matchers.is; 5 | 6 | import org.junit.jupiter.api.Test; 7 | 8 | class LifecycleBehaviour { 9 | 10 | @Test 11 | void shouldCreateEmptyLifecycleWithDefaultConstructor() { 12 | Lifecycle lifecycle = new Lifecycle(); 13 | assertThat(lifecycle.isEmpty(), is(true)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/reporters/reports/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/test/java/org/jbehave/core/reporters/reports/index.html -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/reporters/reports/report1.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/test/java/org/jbehave/core/reporters/reports/report1.html -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/reporters/reports/report1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/test/java/org/jbehave/core/reporters/reports/report1.txt -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/reporters/reports/report2.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/test/java/org/jbehave/core/reporters/reports/report2.html -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/reporters/reports/report2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/test/java/org/jbehave/core/reporters/reports/report2.txt -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/reporters/surefire-breadcrumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/reporters/surefire-simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/AnnotationNamedParameterSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | import org.jbehave.core.annotations.Named; 4 | 5 | class AnnotationNamedParameterSteps extends Steps { 6 | String ith; 7 | String nth; 8 | 9 | public void methodWithNamedParametersInNaturalOrder(@Named("ith") String ithName, @Named("nth") String nthName) { 10 | this.ith = ithName; 11 | this.nth = nthName; 12 | } 13 | 14 | public void methodWithNamedParametersInInverseOrder(@Named("nth") String nthName, @Named("ith") String ithName) { 15 | this.ith = ithName; 16 | this.nth = nthName; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/JBehaveMatchers.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | import static org.mockito.internal.progress.ThreadSafeMockingProgress.mockingProgress; 4 | 5 | import org.jbehave.core.model.Step; 6 | import org.jbehave.core.steps.StepCreator.StepExecutionType; 7 | import org.mockito.ArgumentMatcher; 8 | 9 | public final class JBehaveMatchers { 10 | private JBehaveMatchers() { 11 | } 12 | 13 | public static Step step(StepExecutionType type, String name) { 14 | ArgumentMatcher matcher = arg -> name.equals(arg.getStepAsString()) 15 | && type.equals(arg.getExecutionType()); 16 | mockingProgress().getArgumentMatcherStorage().reportMatcher(matcher); 17 | return null; 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/Jsr330AnnotationNamedParameterSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | import javax.inject.Named; 4 | 5 | class Jsr330AnnotationNamedParameterSteps extends Steps { 6 | String ith; 7 | String nth; 8 | 9 | public void methodWithNamedParametersInNaturalOrder(@Named("ith") String ithName, @Named("nth") String nthName) { 10 | this.ith = ithName; 11 | this.nth = nthName; 12 | } 13 | 14 | public void methodWithNamedParametersInInverseOrder(@Named("nth") String nthName, @Named("ith") String ithName) { 15 | this.ith = ithName; 16 | this.nth = nthName; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/ParanamerNamedParameterSteps.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps; 2 | 3 | class ParanamerNamedParameterSteps extends Steps { 4 | String ith; 5 | String nth; 6 | 7 | public void methodWithNamedParametersInNaturalOrder(String ith, String nth) { 8 | this.ith = ith; 9 | this.nth = nth; 10 | } 11 | 12 | public void methodWithNamedParametersInInverseOrder(String nth, String ith) { 13 | this.ith = ith; 14 | this.nth = nth; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/scan/GivenOnly.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps.scan; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | 5 | public class GivenOnly { 6 | 7 | @Given("") 8 | public void given() { 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/scan/GivenWhen.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps.scan; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | import org.jbehave.core.annotations.When; 5 | 6 | public class GivenWhen { 7 | 8 | @Given("") 9 | public void given() { 10 | } 11 | 12 | @When("") 13 | public void when() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/scan/GivenWhenThen.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps.scan; 2 | 3 | import org.jbehave.core.annotations.Given; 4 | import org.jbehave.core.annotations.Then; 5 | import org.jbehave.core.annotations.When; 6 | 7 | public class GivenWhenThen { 8 | 9 | @Given("") 10 | public void given() { 11 | } 12 | 13 | @When("") 14 | public void when() { 15 | } 16 | 17 | @Then("") 18 | public void then() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/scan/NotAnnotated.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps.scan; 2 | 3 | public class NotAnnotated { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /jbehave-core/src/test/java/org/jbehave/core/steps/scan2/NotAnnotated.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps.scan2; 2 | 3 | public class NotAnnotated { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /jbehave-core/src/test/log4j2.properties: -------------------------------------------------------------------------------- 1 | appender.console.type = Console 2 | appender.console.name = STDOUT 3 | appender.console.layout.type = PatternLayout 4 | appender.console.layout.pattern = %d [%t] %-5p %c - %m%n 5 | 6 | rootLogger.level = INFO 7 | rootLogger.appenderRefs = console 8 | rootLogger.appenderRef.console.ref = STDOUT 9 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/composite.steps: -------------------------------------------------------------------------------- 1 | Composite: Given $customer has previously bought a $product 2 | Given is logged in 3 | When a is added to the cart 4 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/data-reference.table: -------------------------------------------------------------------------------- 1 | {transformer=REPLACING, replacing=15.0, replacement=17.0} 2 | data.table 3 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/data-simple-reference.table: -------------------------------------------------------------------------------- 1 | data-simple.table 2 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/data-simple.table: -------------------------------------------------------------------------------- 1 | |Language| 2 | |Java | 3 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/data.table: -------------------------------------------------------------------------------- 1 | {transformer=REPLACING, replacing=11.0, replacement=10.0, headerSeparator=!, valueSeparator=!} 2 | {transformer=FROM_LANDSCAPE, headerSeparator=!, valueSeparator=!} 3 | !symbol !STK1!STK1!STK1! 4 | !threshold!15.0!15.0!15.0! 5 | !price !5.0 !11.0!16.0! 6 | !status !OFF !OFF !ON ! 7 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/i18n/keywords_mk.properties: -------------------------------------------------------------------------------- 1 | Scenario=Scenario\: 2 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/i18n/keywords_sy.properties: -------------------------------------------------------------------------------- 1 | Given=Given|Giveth 2 | When=When 3 | Then=Then 4 | And=And|With 5 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/i18n/synonyms_en.properties: -------------------------------------------------------------------------------- 1 | Given=Given|Giveth 2 | And=And|With 3 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/Empty.story: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/test/resources/org/jbehave/core/junit/story/Empty.story -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/Greetings.story: -------------------------------------------------------------------------------- 1 | Scenario: Greetings to Earthlings 2 | 3 | Given a Greeting to Earthlings 4 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/GreetingsFromExtraterrestrials.story: -------------------------------------------------------------------------------- 1 | GivenStories: org/jbehave/core/junit/story/Greetings.story 2 | 3 | Scenario: Greetings from Extraterrestrials to Earthlings 4 | 5 | Given a Greeting to Earthlings 6 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/Init.story: -------------------------------------------------------------------------------- 1 | Scenario: Do some initialization 2 | 3 | Given some initialization -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/ParameterizedGreetings.story: -------------------------------------------------------------------------------- 1 | Scenario: Greetings to Earthlings 2 | 3 | Given a Greeting to Earthlings 4 | And a Greeting to -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/failed_step_in_first_scenario_and_second_scenario_passes_j_unit_story.story: -------------------------------------------------------------------------------- 1 | Scenario: Middle step fails and AfterStories shows as passed 2 | because there isn't a method annotated with AfterStories 3 | hence AfterStories can only be treated as passed 4 | 5 | Given a variable x with value 2 6 | When this step fails 7 | Then this step is not executed 8 | 9 | Scenario: Only interested that each step passes so that scenario shows as green in IDE 10 | 11 | Given a variable x with value 2 12 | When I multiply x by 2 13 | Then x should equal 4 14 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/failed_step_in_scenario_j_unit_story.story: -------------------------------------------------------------------------------- 1 | Scenario: Middle step fails and AfterStories shows as passed 2 | because there isn't a method annotated with AfterStories 3 | hence AfterStories can only be treated as passed 4 | 5 | Given a variable x with value 2 6 | When this step fails 7 | Then this step is not executed -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/filtered_out_scenarios_not_story.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | @all 3 | 4 | Narrative: 5 | As a user 6 | I want to perform an action 7 | So that I can achieve a business goal 8 | 9 | Scenario: First scenario filtered by tag first 10 | Meta: @first 11 | Given a variable x with value 2 12 | When I multiply x by 2 13 | Then x should equal 4 14 | 15 | Scenario: Second scenario filtered by tag second 16 | Meta: @second 17 | Then this step is not executed -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/lifecycle_steps_story.story: -------------------------------------------------------------------------------- 1 | Lifecycle: 2 | Before: 3 | Scope: STORY 4 | Given a variable x with value 2 5 | Scope: SCENARIO 6 | When I multiply x by 3 7 | Scope: STEP 8 | When I multiply x by 4 9 | After: 10 | Scope: STEP 11 | When I multiply x by 6 12 | Scope: SCENARIO 13 | Outcome: ANY 14 | When I multiply x by 7 15 | Outcome: SUCCESS 16 | When I multiply x by 8 17 | Scope: STORY 18 | Outcome: ANY 19 | When I multiply x by 9 20 | Outcome: SUCCESS 21 | Then x should equal 362880 22 | 23 | Scenario: x multiplied by 5 24 | When I multiply x by 5 25 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/junit/story/show_ignored_scenarios_as_ignored_and_not_passed_story.story: -------------------------------------------------------------------------------- 1 | Meta: 2 | 3 | Narrative: 4 | As a user 5 | I want to perform an action 6 | So that I can achieve a business goal 7 | 8 | Scenario: Only interested that each step passes so that scenario shows as green in IDE 9 | Given a variable x with value 2 10 | When I multiply x by 2 11 | Then x should equal 4 12 | 13 | Scenario: This scenario is ignored and not executed because it is filtered out using a meta tag 14 | Meta: @skip 15 | Then this step is not executed 16 | 17 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/parsers/aliases-main.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "When I write hello world in JVM language", 4 | "aliases": [ 5 | { 6 | "name": "When I write hello world in Groovy" 7 | }, 8 | { 9 | "name": "When I write hello world in Java" 10 | } 11 | ] 12 | }, 13 | { 14 | "name": "Given java compiler", 15 | "aliases": [ 16 | { 17 | "name": "Given javac" 18 | } 19 | ] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/parsers/aliases-with-same-step.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "When I write hello world in JVM language", 4 | "aliases": [ 5 | { 6 | "name": "When I write hello world in Scala" 7 | }, 8 | { 9 | "name": "When I write hello world in Java" 10 | } 11 | ] 12 | }, 13 | { 14 | "name": "Given HotStop JVM", 15 | "aliases": [ 16 | { 17 | "name": "Given system with HotStop JVM" 18 | } 19 | ] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/org/jbehave/core/parsers/aliases-wrong-step-type-in-alias.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "When I write hello world in JVM language", 4 | "aliases": [ 5 | { 6 | "name": "Then I write hello world in Java" 7 | } 8 | ] 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/stories.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-core/src/test/resources/stories.jar -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/stream-story-excluded.html: -------------------------------------------------------------------------------- 1 |
2 |

An interesting story

3 |
/path/to/story
4 |
5 |
Meta:
6 |
@author Mauro
7 |
@theme testing
8 |
9 |
10 |

Scenario: A scenario

11 |
-theme testing
12 |

start 1

13 |

end 2

14 |
15 |
16 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/stream-story-excluded.txt: -------------------------------------------------------------------------------- 1 | An interesting story 2 | (/path/to/story) 3 | Meta: 4 | @author Mauro 5 | @theme testing 6 | 7 | Scenario: A scenario 8 | -theme testing 9 | 10 | 11 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/stream-story-excluded.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -theme testing 8 | 1 9 | 2 10 | 11 | 12 | -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/test+dir/dummy.story: -------------------------------------------------------------------------------- 1 | dummy story file -------------------------------------------------------------------------------- /jbehave-core/src/test/resources/testfile: -------------------------------------------------------------------------------- 1 | ########## -------------------------------------------------------------------------------- /jbehave-groovy/src/test/java/org/jbehave/core/configuration/groovy/fooSteps.groovy: -------------------------------------------------------------------------------- 1 | import org.jbehave.core.annotations.Given 2 | 3 | class FooSteps { 4 | 5 | @Given("a step with a \$param") 6 | def stepWithAParam(String param) { 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /jbehave-groovy/src/test/java/org/jbehave/core/steps/groovy/annotatedSteps.groovy: -------------------------------------------------------------------------------- 1 | import org.jbehave.core.annotations.Given 2 | import org.jbehave.core.annotations.Then 3 | import org.jbehave.core.annotations.When 4 | 5 | import static junit.framework.Assert.assertNotNull; 6 | 7 | class AnnotatedSteps { 8 | 9 | @Given("a date of \$date") 10 | def date(Date date) { 11 | assertNotNull(date); 12 | } 13 | 14 | @When("\$days days pass") 15 | def daysPass(int days) { 16 | assertNotNull(days); 17 | } 18 | 19 | @Then("the date is \$date") 20 | def theDate(Date date) { 21 | assertNotNull(date); 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /jbehave-groovy/src/test/java/org/jbehave/core/steps/groovy/invalidSteps.groovy: -------------------------------------------------------------------------------- 1 | class InvalidSteps { 2 | 3 | InvalidSteps(){ 4 | throw new RuntimeException("bum!") 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /jbehave-groovy/src/test/java/org/jbehave/core/steps/groovy/notAnnotatedSteps.groovy: -------------------------------------------------------------------------------- 1 | class NotAnnotatedSteps { 2 | 3 | def date(Date date) { 4 | assertNotNull(date); 5 | } 6 | 7 | def daysPass(int days) { 8 | assertNotNull(days); 9 | } 10 | 11 | def theDate(Date date) { 12 | assertNotNull(date); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-guice/src/main/java/org/jbehave/core/annotations/guice/UsingGuice.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations.guice; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | import com.google.inject.Module; 10 | 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target(ElementType.TYPE) 13 | @Inherited 14 | public @interface UsingGuice { 15 | 16 | Class[] modules() default {}; 17 | 18 | boolean inheritModules() default true; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jbehave-io/src/main/java/org/jbehave/io/FileArchiveFailedException.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.io; 2 | 3 | import java.io.File; 4 | 5 | @SuppressWarnings("serial") 6 | public final class FileArchiveFailedException extends 7 | RuntimeException { 8 | 9 | public FileArchiveFailedException(File archive, File directory, 10 | Exception cause) { 11 | super("Failed to archive dir " + directory + " to " + archive, 12 | cause); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-io/src/main/java/org/jbehave/io/FileArchiver.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.io; 2 | 3 | import java.io.File; 4 | import java.util.List; 5 | 6 | /** 7 | * Allows to archive and unarchive a file and list its content. 8 | */ 9 | public interface FileArchiver { 10 | 11 | boolean isArchive(File file); 12 | 13 | void archive(File archive, File directory); 14 | 15 | void unarchive(File archive, File directory); 16 | 17 | List listContent(File directory); 18 | 19 | File directoryOf(File archive); 20 | 21 | File relativeTo(File file, File directory); 22 | 23 | } -------------------------------------------------------------------------------- /jbehave-io/src/main/java/org/jbehave/io/FileMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.io; 2 | 3 | import java.io.File; 4 | import java.util.List; 5 | 6 | import org.apache.commons.fileupload.FileItem; 7 | 8 | public interface FileMonitor { 9 | 10 | void contentListed(String path, File directory, 11 | boolean relativePaths, List content); 12 | 13 | void filesListed(File uploadDirectory, List files); 14 | 15 | void fileUploaded(File file); 16 | 17 | void fileUploadFailed(FileItem item, Exception cause); 18 | 19 | void fileUnarchived(File file, File directory); 20 | 21 | void fileDeleted(File file); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jbehave-io/src/main/java/org/jbehave/io/FileUnarchiveFailedException.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.io; 2 | 3 | import java.io.File; 4 | 5 | @SuppressWarnings("serial") 6 | public final class FileUnarchiveFailedException extends 7 | RuntimeException { 8 | 9 | public FileUnarchiveFailedException(File archive, File directory, 10 | Exception cause) { 11 | super("Failed to unarchive " + archive + " to dir " + directory, 12 | cause); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /jbehave-io/src/main/java/org/jbehave/io/SilentFileMonitor.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.io; 2 | 3 | public class SilentFileMonitor extends PrintStreamFileMonitor { 4 | 5 | @Override 6 | protected void print(String format, Object... args) { 7 | // print nothing 8 | } 9 | 10 | @Override 11 | protected void printStackTrace(Throwable e) { 12 | // print nothing 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jbehave-io/src/test/java/org/jbehave/io/resource.txt: -------------------------------------------------------------------------------- 1 | A test resource -------------------------------------------------------------------------------- /jbehave-io/src/test/resources/archive.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-io/src/test/resources/archive.zip -------------------------------------------------------------------------------- /jbehave-maven-plugin/src/test/java/org/jbehave/mojo/stories/Embeddable1.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.mojo.stories; 2 | 3 | public class Embeddable1 { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /jbehave-maven-plugin/src/test/java/org/jbehave/mojo/stories/Embeddable2.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.mojo.stories; 2 | 3 | public class Embeddable2 { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /jbehave-maven-plugin/src/test/java/org/jbehave/mojo/stories/first.story: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-maven-plugin/src/test/java/org/jbehave/mojo/stories/first.story -------------------------------------------------------------------------------- /jbehave-maven-plugin/src/test/java/org/jbehave/mojo/stories/second.story: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-maven-plugin/src/test/java/org/jbehave/mojo/stories/second.story -------------------------------------------------------------------------------- /jbehave-needle/src/main/resources/needle.properties: -------------------------------------------------------------------------------- 1 | mock.provider = org.needle4j.mock.MockitoProvider 2 | -------------------------------------------------------------------------------- /jbehave-needle/src/test/java/org/jbehave/core/steps/needle/ValueGetter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.steps.needle; 2 | 3 | public interface ValueGetter { 4 | 5 | public static final String VALUE = "Simple Value"; 6 | 7 | Object getValue(); 8 | } -------------------------------------------------------------------------------- /jbehave-needle/src/test/resources/jbehave-needle.properties: -------------------------------------------------------------------------------- 1 | custom.injection.provider.classes = 2 | -------------------------------------------------------------------------------- /jbehave-needle/src/test/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | appender.console.type = Console 2 | appender.console.name = STDOUT 3 | appender.console.layout.type = PatternLayout 4 | appender.console.layout.pattern = %d %5p [%t] (%F:%L) - %m%n 5 | 6 | rootLogger.level = INFO 7 | rootLogger.appenderRefs = console 8 | rootLogger.appenderRef.console.ref = STDOUT 9 | 10 | # log levels by package 11 | logger.jbehave.name = org.jbehave 12 | logger.jbehave.level = DEBUG 13 | -------------------------------------------------------------------------------- /jbehave-odf/src/main/java/org/jbehave/core/io/odf/LoadOdtFromURL.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io.odf; 2 | 3 | import static org.jbehave.core.io.odf.OdfUtils.loadOdt; 4 | import static org.jbehave.core.io.odf.OdfUtils.parseOdt; 5 | 6 | import org.jbehave.core.io.InvalidStoryResource; 7 | import org.jbehave.core.io.LoadFromURL; 8 | 9 | /** 10 | * Loads ODT story resources from URL 11 | */ 12 | public class LoadOdtFromURL extends LoadFromURL { 13 | 14 | @Override 15 | public String loadResourceAsText(String resourcePath) { 16 | try { 17 | return parseOdt(loadOdt(resourceAsStream(resourcePath))); 18 | } catch (Exception cause) { 19 | throw new InvalidStoryResource(resourcePath, cause); 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jbehave-odf/src/test/java/org/jbehave/core/io/odf/stories/a_story.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbehave/jbehave-core/9c593a132f4530368a4f8b6dd816c0ecbbb6fa09/jbehave-odf/src/test/java/org/jbehave/core/io/odf/stories/a_story.odt -------------------------------------------------------------------------------- /jbehave-odf/src/test/java/org/jbehave/core/io/odf/stories/a_story.txt: -------------------------------------------------------------------------------- 1 | Narrative: 2 | In order to communicate better 3 | As a story writer 4 | I want to be able to use ODT format 5 | 6 | Scenario: a plain scenario 7 | Given a step 8 | When a step has failed 9 | Then the scenario is visualized as failed 10 | 11 | Scenario: a scenario with a given story 12 | 13 | GivenStories: stories/a_successful_story.odt 14 | 15 | Given a step 16 | And the step is successful 17 | Then the scenario is visualized as succeeded 18 | 19 | Scenario: a scenario with examples 20 | 21 | Given a 22 | When the is executed 23 | Then the result is 24 | 25 | Examples: 26 | |step|result| 27 | |one|1| 28 | |two|2| 29 | -------------------------------------------------------------------------------- /jbehave-pico/src/main/java/org/jbehave/core/configuration/pico/PicoModule.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.configuration.pico; 2 | 3 | import org.picocontainer.MutablePicoContainer; 4 | 5 | public interface PicoModule { 6 | 7 | void configure(MutablePicoContainer container); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /jbehave-rest/src/main/java/org/jbehave/core/io/rest/ResourceExporter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io.rest; 2 | 3 | /** 4 | * Exports resources to a REST root URI. Each implementation 5 | * can export from different source systems, e.g. a filesystem. 6 | * 7 | * @author Mauro Talevi 8 | */ 9 | public interface ResourceExporter { 10 | 11 | void exportResources(String rootURI); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-rest/src/main/java/org/jbehave/core/io/rest/ResourceImporter.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io.rest; 2 | 3 | /** 4 | * Imports a resource index retrieved from the REST root URI. Each implementation 5 | * can import to different target systems, e.g. a filesystem. 6 | * 7 | * @author Mauro Talevi 8 | */ 9 | public interface ResourceImporter { 10 | 11 | void importResources(String rootURI); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /jbehave-rest/src/main/java/org/jbehave/core/io/rest/ResourceNameResolver.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io.rest; 2 | 3 | public interface ResourceNameResolver { 4 | 5 | String resolve(String input); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /jbehave-rest/src/main/java/org/jbehave/core/io/rest/ResourceUploader.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.io.rest; 2 | 3 | /** 4 | * Uploads text resource to REST path. 5 | * 6 | * @author Mauro Talevi 7 | */ 8 | public interface ResourceUploader { 9 | 10 | void uploadResource(Resource resource); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /jbehave-rest/src/test/resources/redmine-index.json: -------------------------------------------------------------------------------- 1 | {"wiki_pages":[ 2 | {"parent":{"title":"Stories"},"title":"A_story","created_on":"2013-11-11T11:11:11Z","updated_on":"2013-11-11T11:11:11+01:00","version":1}, 3 | {"parent":{"title":"Stories"},"title":"Another_story","created_on":"2013-11-11T11:11:11Z","updated_on":"2013-11-11T11:11:11+01:00","version":1}, 4 | {"title":"Stories","created_on":"2013-11-11T11:11:11Z","updated_on":"2013-11-11T11:11:11+01:00","version":1}, 5 | {"title":"Wiki","created_on":"2013-11-11T11:11:11Z","updated_on":"2013-11-11T11:11:11+01:00","version":1} 6 | ]} -------------------------------------------------------------------------------- /jbehave-rest/src/test/resources/redmine.json: -------------------------------------------------------------------------------- 1 | {"wiki_page":{"comments":"","text":"Narrative: \r\n\r\nIn order to ensure secure access\r\nAs a security officer\r\nI want to authenticate users\r\n","parent":{"title":"Login"},"created_on":"2011-11-11T11:11:11Z","title":"User_authentication","author":{"name":"Mauro","id":1},"updated_on":"2011-11-11T11:11:11Z","version":1}} -------------------------------------------------------------------------------- /jbehave-rest/src/test/resources/redmine.xml: -------------------------------------------------------------------------------- 1 | User_pin_authenticationNarrative: 2 | In order to ensure secure access 3 | As a security officer 4 | I want to authenticate users 5 | 12011-11-11T11:11:11Z2011-11-11T11:11:11Z -------------------------------------------------------------------------------- /jbehave-rest/src/test/resources/stories/A_first.story: -------------------------------------------------------------------------------- 1 | A story -------------------------------------------------------------------------------- /jbehave-rest/src/test/resources/stories/A_second.story: -------------------------------------------------------------------------------- 1 | Another story -------------------------------------------------------------------------------- /jbehave-rest/src/test/resources/stories/domain/A_third.story: -------------------------------------------------------------------------------- 1 | A third story -------------------------------------------------------------------------------- /jbehave-scala/src/test/scala/AnnotatedSteps.scala: -------------------------------------------------------------------------------- 1 | class AnnotatedSteps { 2 | 3 | @org.jbehave.core.annotations.Given("given") 4 | def given() { 5 | } 6 | 7 | @org.jbehave.core.annotations.When("when") 8 | def when() { 9 | } 10 | 11 | @org.jbehave.core.annotations.Then("then") 12 | def then() { 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /jbehave-scala/src/test/scala/NonAnnotatedSteps.scala: -------------------------------------------------------------------------------- 1 | class NonAnnotatedSteps { 2 | 3 | def given() { 4 | } 5 | 6 | def when() { 7 | } 8 | 9 | def then() { 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /jbehave-spring/src/main/java/org/jbehave/core/annotations/spring/UsingSpring.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations.spring; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target({ ElementType.TYPE }) 11 | @Inherited 12 | public @interface UsingSpring { 13 | 14 | String[] resources() default {}; 15 | 16 | boolean inheritResources() default true; 17 | 18 | boolean ignoreContextFailure() default true; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jbehave-spring/src/test/java/org/jbehave/core/steps/spring/steps-with-dependency.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jbehave-spring/src/test/java/org/jbehave/core/steps/spring/steps-with-missing-dependency.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /jbehave-spring/src/test/java/org/jbehave/core/steps/spring/steps.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /jbehave-weld/src/main/java/org/jbehave/core/annotations/weld/WeldConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations.weld; 2 | 3 | import static java.lang.annotation.ElementType.FIELD; 4 | import static java.lang.annotation.ElementType.METHOD; 5 | import static java.lang.annotation.ElementType.PARAMETER; 6 | import static java.lang.annotation.ElementType.TYPE; 7 | 8 | import java.lang.annotation.Inherited; 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.RetentionPolicy; 11 | import java.lang.annotation.Target; 12 | import javax.inject.Qualifier; 13 | 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Target({ TYPE, METHOD, PARAMETER, FIELD }) 16 | @Inherited 17 | @Qualifier 18 | public @interface WeldConfiguration { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jbehave-weld/src/main/java/org/jbehave/core/annotations/weld/WeldStep.java: -------------------------------------------------------------------------------- 1 | package org.jbehave.core.annotations.weld; 2 | 3 | import static java.lang.annotation.ElementType.FIELD; 4 | import static java.lang.annotation.ElementType.METHOD; 5 | import static java.lang.annotation.ElementType.PARAMETER; 6 | import static java.lang.annotation.ElementType.TYPE; 7 | 8 | import java.lang.annotation.Inherited; 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.RetentionPolicy; 11 | import java.lang.annotation.Target; 12 | import javax.inject.Qualifier; 13 | 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Target({ TYPE, METHOD, PARAMETER, FIELD }) 16 | @Inherited 17 | @Qualifier 18 | public @interface WeldStep { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jbehave-weld/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /jbehave-weld/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | --------------------------------------------------------------------------------