diff --git a/.gitignore b/.gitignore index 2612fb9..a30147f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ classes/ *.ear *.iml .idea +_build/ + diff --git a/README.md b/README.md index a510370..6403dcf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ substeps-runner =============== -Runners to execute substeps, currently includes an ANT runner, a Maven plugin and a Junit runner. \ No newline at end of file +Runners to execute substeps, currently includes an ANT runner, a Maven plugin and a Junit runner. Project documentation can be found [here](http://technophobia.github.com/substeps-runner/ "Substeps Runner documentation") diff --git a/build-gh-pages.sh b/build-gh-pages.sh new file mode 100755 index 0000000..416dfe5 --- /dev/null +++ b/build-gh-pages.sh @@ -0,0 +1,27 @@ +#! /bin/bash + +# build the latest set of docs +cd docs +make html +cd .. + +# checkout gh-pages +git checkout gh-pages + +# delete content +rm *.html +rm *.inv +rm *.js +rm -rf _static + + +# move content over from the _build dir + +cp docs/_build/html _static +cp docs/_build/html/*.html . +cp docs/_build/html/*.inv . +cp docs/_build/html/*.js . + +git add . +git commit -m"new build of gh-pages" +git checkout master diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..46075a8 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Substeps.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Substeps.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Substeps" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Substeps" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/docs/compatibility.rst b/docs/compatibility.rst new file mode 100644 index 0000000..3cd17ba --- /dev/null +++ b/docs/compatibility.rst @@ -0,0 +1,19 @@ +Substeps Runner - Compatibility +=============================== + +- A list of compatible substep libraries and versions + +0.0.6 +----- + ++---------------------------+----------+-+ +| Substeps Library | Versions | | ++===========================+==========+=+ +| susbteps-core | 0.0.7 | | ++---------------------------+----------+-+ +| substeps-glossary-builder | N/A | | ++---------------------------+----------+-+ +| webdriver-substeps | 0.0.5 | | ++---------------------------+----------+-+ + + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..fb321ec --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,242 @@ +# -*- coding: utf-8 -*- +# +# Substeps documentation build configuration file, created by +# sphinx-quickstart on Fri Jun 22 12:10:47 2012. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Substeps' +copyright = u'2012, Technophobia' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '' +# The full version, including alpha/beta/rc tags. +release = '' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'haiku' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Substepsdoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'Substeps-runner.tex', u'Substeps Runner Documentation', + u'Technophobia', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'substeps-runner', u'Substeps Runner Documentation', + [u'Technophobia'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'Substeps', u'Substeps Runner Documentation', + u'Technophobia', 'Substeps', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..5a974a3 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,27 @@ +Welcome to Substeps Runner! +=========================== + +- `Substeps `_ is an open-source Behaviour Driven Development (`BDD `_) test framework created by `Technophobia `_. +- These pages describe the maven plugin that can be used to execute suites of Substeps tests. +- For full instructions as to how to setup a substeps project, please refer to the main susbteps pages for more details. + +Overview +-------- +- The substeps maven plugin can execute a number of configurations as part of an integration test. + Each configuration can be tailored to use specific properties, sets of tests or alternate + initialisation classes and or step implementations. + +- On completion of the maven plugin execution, a report is generated with details of the tests executed, + passed and failed, along with any details of the failure. + +.. toctree:: + :maxdepth: 2 + :glob: + + using* + release* + compatibility* + +.. Note:: + `*` Some features are currently in development and may not be available at the time of reading! + diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..4c7fb7c --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,190 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Substeps.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Substeps.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end diff --git a/docs/release_notes.rst b/docs/release_notes.rst new file mode 100644 index 0000000..49bd851 --- /dev/null +++ b/docs/release_notes.rst @@ -0,0 +1,19 @@ +Substeps Runner - Release Notes +=============================== + +- A list of changes per release + +1.0.0 +----- +- changes to support new reporting changes and the 1.0.0 release of substeps-core + +0.0.6 +----- +- BUG: Non Fatal failures were still causing the build to fail + +0.0.5 +----- +- Changes as a result of core changes to Notifications. +- BUG: failures in @BeforeAllFeatures not failing the maven build +- Doc changes clarified use of tags +- Report builder no longer essential diff --git a/docs/using.rst b/docs/using.rst new file mode 100644 index 0000000..f8e33f7 --- /dev/null +++ b/docs/using.rst @@ -0,0 +1,159 @@ +Using Substeps Runner +===================== + +Plugin Configuration +-------------------- + +- Below is a fragment of a maven pom file to configure the susbteps-runner plugin. +- An SLF4J logging implementation is required as a dependency, the plugin adds all of the test dependencies of the project + to it's own set of dependencies to avoid duplication in the pom. + +.. code-block:: xml + + + com.technophobia.substeps + substeps-runner + 0.0.4 + + + + SubSteps Test + integration-test + + run-features + + + + + + + + + + + + + + + + org.slf4j + slf4j-log4j12 + 1.6.4 + + + + + + +Execution Configuration +----------------------- + +- The Substeps runner plugin can execute the tests specified by a number of configurations. +- This can be useful in order to break up test suites into smaller chunks, use different configurations etc. + +Below is a table of the execution configuration parameters and their meaning. + ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| Field | Description | | ++==============================+========================================================================================================================================================================================================+=+ +| description | A descriptive name for the configuration, this is used in the test execution report. | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| featureFile | path to the feature file, or directory containing the feature files | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| subStepsFileName | path to directory of substep files, or a single substep file | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| stepImplementationClassNames | List of classes containing step implementations | | +| | eg com.technophobia.substeps.StepImplmentations | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| initialisationClass | <**optional**> Ordered list of classes containing setup and tear down methods | | +| | eg com.technophobia.substeps.MySetup. By default the initialisation classes associated with the step implementations will be used. | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| tags | <**optional**> If the feature or scenario has these tags, then it will be | | +| | included, otherwise it won't. multiple tags are space seperated. Tags can be excluded by prefixing with -- | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| nonFatalTags | <**optional**> If a scenario (and therefore a feature) that has this tag fails to pass, then the build will not fail. This is useful for scenarios | | +| | where tests are written and are included in a CI build in advance of completed functionality, this allows the build and therefore maven releases to succeed. Over the course of | | +| | a project this list should be reduced as confidence in the delivery grows. Format is the same for | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| fastFailParseErrors | <**optional**> if true any parse errors will fail the build immediately, rather than attempting to execute as much as possible and fail those tests that can't be parsed | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| strict | <**optional**> defaults to true, if false, Substeps will use the nonStrictKeywordPrecedence to look for alternate expressions if an exact match can't be found. Useful for porting Cucumber features. | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ +| nonStrictKeywordPrecedence | <**optional**> required if strict is false. An parameter list of keywords to use if an exact match can't be found. | | +| | eg. Given | | +| | When ... | | +| | Then if a step was defined in a feature or substep as "When I login", but implemented as "Given I login", the feature would parse correctly. | | ++------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-+ + +Example Pom fragment + +.. code-block:: xml + + + + Self Test Features + + ${basedir}/target/test-classes/features + + ${basedir}/target/test-classes/substeps + + + com.technophobia.webdriver.substeps.impl.BaseWebdriverSubStepImplementations + com.technophobia.webdriver.substeps.example.ExampleCustomWebdriverStepImplementations + + + + + + com.technophobia.webdriver.substeps.runner.DefaultExecutionSetupTearDown + com.technophobia.webdriver.substeps.example.ExampleSetupAndTearDown + + + @all + + @new_phase + + false + + false + + + Given + When + Then + And + + + + + + +Reporting +--------- +- The Susbteps runner plugin can create an HTML test execution report with the following configuration at plugin level. +- Results from multiple execution configurations are combined. +- alter the outputDirectory to write the html report elsewhere. +- Typically we use a 'post-build' task to move the HTML report elsewhere and create a permanent link. (In Jenkins this can be achieved with the HTMLPublisher plugin). + +.. code-block:: xml + + + ... + + ${project.build.directory} + + + + +- Alternative report builders can be used provided that they implement ``com.technophobia.substeps.report.ExecutionReportBuilder`` + + + + + +.. Note:: + Check `Maven Central `_ for the latest versions of the plugin. diff --git a/pom.xml b/pom.xml index 77dec5b..505062e 100755 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.technophobia.substeps substeps-runner-parent - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT pom @@ -21,8 +21,8 @@ - 1.1.0-SNAPSHOT - 1.1.0-SNAPSHOT + 1.1.0 + 1.1.0 10.0 UTF-8 @@ -85,8 +85,9 @@ developer - - + + + rickybarefield Ricky Barefield Technophobia @@ -236,7 +237,7 @@ - + internalDev @@ -255,15 +256,13 @@ - - + - ${substeps-core.scm} - ${substeps-core.scm} - ${substeps-core.scm.url} - HEAD - - + ${substeps-runner.scm} + ${substeps-runner.scm} + ${substeps-runner.scm.url} + + diff --git a/src/main/java/com/technophobia/substeps/runner/IncludeProjectDependenciesComponentConfigurator.java b/src/main/java/com/technophobia/substeps/runner/IncludeProjectDependenciesComponentConfigurator.java new file mode 100644 index 0000000..09f4162 --- /dev/null +++ b/src/main/java/com/technophobia/substeps/runner/IncludeProjectDependenciesComponentConfigurator.java @@ -0,0 +1,112 @@ +/* + * NB. Although this file is part of the Technophobia SubSteps runner, this implementation was taken from + * http://maven.40175.n5.nabble.com/Adding-project-dependencies-and-generated-classes-to-classpath-of-my-plugin-td110119.html + */ +package com.technophobia.substeps.runner; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +import org.codehaus.classworlds.ClassRealm; +import org.codehaus.plexus.component.configurator.AbstractComponentConfigurator; +import org.codehaus.plexus.component.configurator.ComponentConfigurationException; +import org.codehaus.plexus.component.configurator.ConfigurationListener; +import org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter; +import org.codehaus.plexus.component.configurator.converters.special.ClassRealmConverter; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; +import org.codehaus.plexus.configuration.PlexusConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A custom ComponentConfigurator which adds the project's runtime classpath + * elements to the + * + * @author Brian Jackson + * @since Aug 1, 2008 3:04:17 PM + * + * @plexus.component + * role="org.codehaus.plexus.component.configurator.ComponentConfigurator" + * role-hint="include-project-dependencies" + * @plexus.requirement role= + * "org.codehaus.plexus.component.configurator.converters.lookup.ConverterLookup" + * role-hint="default" + */ +public class IncludeProjectDependenciesComponentConfigurator extends AbstractComponentConfigurator { + + private static final Logger logger = LoggerFactory + .getLogger(IncludeProjectDependenciesComponentConfigurator.class); + + + @Override + public void configureComponent(final Object component, final PlexusConfiguration configuration, + final ExpressionEvaluator expressionEvaluator, final ClassRealm containerRealm, + final ConfigurationListener listener) throws ComponentConfigurationException { + + addProjectDependenciesToClassRealm(expressionEvaluator, containerRealm); + + converterLookup.registerConverter(new ClassRealmConverter(containerRealm)); + + final ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter(); + + converter.processConfiguration(converterLookup, component, containerRealm.getClassLoader(), + configuration, expressionEvaluator, listener); + } + + + private void addProjectDependenciesToClassRealm(final ExpressionEvaluator expressionEvaluator, + final ClassRealm containerRealm) throws ComponentConfigurationException { + + List testClasspathElements = null; + + try { + // noinspection unchecked + + testClasspathElements = (List) expressionEvaluator + .evaluate("${project.testClasspathElements}"); + + } catch (final ExpressionEvaluationException e) { + throw new ComponentConfigurationException( + "There was a problem evaluating: ${project.runtimeClasspathElements}", e); + } + + if (testClasspathElements != null) { + // Add the project test dependencies to the ClassRealm + final URL[] testUrls = buildURLs(testClasspathElements); + for (final URL url : testUrls) { + containerRealm.addConstituent(url); + + } + } + + } + + + private URL[] buildURLs(final List runtimeClasspathElements) + throws ComponentConfigurationException { + // Add the projects classes and dependencies + final List urls = new ArrayList(runtimeClasspathElements.size()); + for (final String element : runtimeClasspathElements) { + try { + final URL url = new File(element).toURI().toURL(); + urls.add(url); + + // System.out.println("Added to project class loader: " + url); + if (logger.isDebugEnabled()) { + logger.debug("Added to project class loader: " + url); + } + } catch (final MalformedURLException e) { + throw new ComponentConfigurationException("Unable to access project dependency: " + + element, e); + } + } + + // Add the plugin's dependencies (so Trove stuff works if Trove isn't on + return urls.toArray(new URL[urls.size()]); + } + +} \ No newline at end of file diff --git a/src/main/java/com/technophobia/substeps/runner/SubstepsRunnerMojo.java b/src/main/java/com/technophobia/substeps/runner/SubstepsRunnerMojo.java new file mode 100644 index 0000000..7018be8 --- /dev/null +++ b/src/main/java/com/technophobia/substeps/runner/SubstepsRunnerMojo.java @@ -0,0 +1,151 @@ +/* + * Copyright Technophobia Ltd 2012 + * + * This file is part of Substeps Maven Runner. + * + * Substeps Maven Runner is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Substeps Maven Runner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Substeps. If not, see . + */ +package com.technophobia.substeps.runner; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import junit.framework.Assert; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.project.MavenProject; + +import com.technophobia.substeps.execution.ExecutionNode; +import com.technophobia.substeps.report.ExecutionReportBuilder; +import com.technophobia.substeps.report.ReportData; + +/** + * Mojo to run a number SubStep features, each contained within any number of + * executionConfigs, encapsulating the required config and setup and tear down + * details + * + * @goal run-features + * @requiresDependencyResolution test + * @phase integration-test + * + * @configurator include-project-dependencies + */ +public class SubstepsRunnerMojo extends AbstractMojo { + + + + /** + * Location of the file. + * + * @parameter expression="${project.build.directory}" + * @required + */ + private File outputDirectory; + + /** + * @parameter default-value="${project.build.directory}" + */ + private File outputDir; + + /** + * @parameter default-value="${project}" + * @required + * @readonly + */ + private MavenProject project; + + /** + * @parameter + */ + private Properties systemProperties; + + /** + * @parameter + */ + private List executionConfigs; + + /** + * @parameter + */ + private final ExecutionReportBuilder executionReportBuilder = null; + + public void execute() throws MojoExecutionException, MojoFailureException { + + final BuildFailureManager buildFailureManager = new BuildFailureManager(); + + executeInternal(buildFailureManager, executionConfigs); + } + + private void executeInternal(final BuildFailureManager buildFailureManager, + final List executionConfigList) throws MojoFailureException { + + final ReportData data = new ReportData(); + + Assert.assertNotNull("executionConfigs cannot be null", executionConfigList); + Assert.assertFalse("executionConfigs can't be empty", executionConfigList.isEmpty()); + + + for (final ExecutionConfig executionConfig : executionConfigList) { + + final List failures = new ArrayList(); + + final ExecutionNode rootNode = runExecutionConfig(executionConfig, failures); + + if (executionConfig.getDescription() != null) { + + rootNode.setLine(executionConfig.getDescription()); + } + + data.addRootExecutionNode(rootNode); + + buildFailureManager.sortFailures(failures); + } + + if (executionReportBuilder != null) { + executionReportBuilder.buildReport(data); + } + + + if(buildFailureManager.testSuiteFailed()){ + + throw new MojoFailureException("Substep Execution failed:\n" + buildFailureManager.getBuildFailureInfo()); + + } + else if (!buildFailureManager.testSuiteCompletelyPassed()){ + // print out the failure string (but won't include any failures) + getLog().info(buildFailureManager.getBuildFailureInfo()); + } + // else - we're all good + + } + + private ExecutionNode runExecutionConfig(final ExecutionConfig theConfig, + final List failures ) { + + final ExecutionNodeRunner runner = new ExecutionNodeRunner(); + + final ExecutionNode rootNode = runner.prepareExecutionConfig(theConfig); + + final List localFailures = runner.run(); + + failures.addAll(localFailures); + + return rootNode; + } + +} diff --git a/src/main/resources/COPYING.LESSER b/src/main/resources/COPYING.LESSER new file mode 100644 index 0000000..65c5ca8 --- /dev/null +++ b/src/main/resources/COPYING.LESSER @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/src/test/java/com/technophobia/substeps/mojo/runner/MojoTest.java b/src/test/java/com/technophobia/substeps/mojo/runner/MojoTest.java new file mode 100644 index 0000000..867bd7a --- /dev/null +++ b/src/test/java/com/technophobia/substeps/mojo/runner/MojoTest.java @@ -0,0 +1,58 @@ +/* + * Copyright Technophobia Ltd 2012 + * + * This file is part of Substeps Maven Runner. + * + * Substeps Maven Runner is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Substeps Maven Runner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Substeps. If not, see . + */ +package com.technophobia.substeps.mojo.runner; + +import java.io.File; + +import org.apache.maven.plugin.testing.AbstractMojoTestCase; +import org.junit.Ignore; + +import com.technophobia.substeps.runner.SubstepsRunnerMojo; + +/** + * @author ian + * + */ +@Ignore +public class MojoTest extends AbstractMojoTestCase { + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + + // required for mojo lookups to work + super.setUp(); + } + + + /** + * @throws Exception + */ + public void testMojoGoal() throws Exception { + final File testPom = new File(getBasedir(), + "src/test/resources/basic-test-plugin-config.xml"); + + final SubstepsRunnerMojo mojo = (SubstepsRunnerMojo) lookupMojo("integration-test", testPom); + + // TODO + + assertNotNull(mojo); + } +} diff --git a/src/test/java/com/technophobia/substeps/mojo/runner/SubstepsRunnerMojoTest.java b/src/test/java/com/technophobia/substeps/mojo/runner/SubstepsRunnerMojoTest.java new file mode 100644 index 0000000..59a9d70 --- /dev/null +++ b/src/test/java/com/technophobia/substeps/mojo/runner/SubstepsRunnerMojoTest.java @@ -0,0 +1,97 @@ +/* + * Copyright Technophobia Ltd 2012 + * + * This file is part of Substeps Maven Runner. + * + * Substeps Maven Runner is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Substeps Maven Runner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Substeps. If not, see . + */ +package com.technophobia.substeps.mojo.runner; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; + +import junit.framework.Assert; + +import org.junit.Ignore; +import org.junit.Test; + +import com.technophobia.substeps.execution.ExecutionNode; +import com.technophobia.substeps.runner.BuildFailureManager; +import com.technophobia.substeps.runner.ExecutionConfig; +import com.technophobia.substeps.runner.SubstepsRunnerMojo; + +/** + * + * + * + * @author imoore + * + */ +public class SubstepsRunnerMojoTest { + + //@Test + public void testNonCriticalFailures() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException{ + + + + final SubstepsRunnerMojo mojo = new SubstepsRunnerMojo(); + + final Method executeInternalMethod = mojo.getClass().getMethod("executeInternal", + BuildFailureManager.class, List.class); + + Assert.assertNotNull(executeInternalMethod); + executeInternalMethod.setAccessible(true); + + final BuildFailureManager bfm = null; + final List cfgList = null; + + executeInternalMethod.invoke(bfm, cfgList); + + } + + @Ignore("incomplete test") + @Test + public void testCriticalNonCriticalFailures() throws SecurityException, NoSuchMethodException, + IllegalArgumentException, IllegalAccessException, InvocationTargetException, + NoSuchFieldException { + + final SubstepsRunnerMojo mojo = new SubstepsRunnerMojo(); + + final Method method = mojo.getClass().getMethod("checkRootNodeForFailure", + ExecutionNode.class, ExecutionConfig.class); + + final Field failedNodesField = mojo.getClass().getField("failedNodes"); + final Field nonFatalFailedNodesField = mojo.getClass().getField("nonFatalFailedNodes"); + + failedNodesField.setAccessible(true); + nonFatalFailedNodesField.setAccessible(true); + + Assert.assertNotNull(method); + method.setAccessible(true); + + final ExecutionConfig execConfig = new ExecutionConfig(); + + final ExecutionNode rootNode = new ExecutionNode(); + + method.invoke(mojo, rootNode, execConfig); + + final List failedNodes = (List) failedNodesField.get(mojo); + final List nonFatalFailedNodes = (List) nonFatalFailedNodesField + .get(mojo); + + } + +} diff --git a/src/test/resources/basic-test-plugin-config.xml b/src/test/resources/basic-test-plugin-config.xml new file mode 100644 index 0000000..e06f4b5 --- /dev/null +++ b/src/test/resources/basic-test-plugin-config.xml @@ -0,0 +1,44 @@ + + 4.0.0 + test.group.id + test.artifact + jar + 0.0.1-SNAPSHOT + + + + + + + + + com.technophobia.substeps + substeps-runner + 0.0.1 + + + + SubSteps Test + test + + run-features + + + + + + + -Denvironment=jenkins -DverboseDescriptions=true + + **/OriginalCucumberTests.java + + + + + + + + + + \ No newline at end of file