cucumber/cucumber-jvm — pull request #672 by andryutz10 (2014-02-23 03:34:39+00:00)
Title: Add new hooks for global level (BeforeTests and AfterTests) that run onl...

Add new hooks for global level (@BeforeTests and @AfterTests) that run only once before all and after all existing features/scenarios, and new hooks for feature level (@BeforeFeature and @AfterFeature) that run only one before and after a feature(all scenarios in a feature file). Unit test and cucumber test to cover the new hooks and the running order between hooks.
An execution flow with the new hooks looks like this:
1 - @BeforeTests hook(s) (runs before all features once)
2 - @BeforeFeature hook(s) (runs before a feature, without tags or with tags for tagged features)
3 - @Before hook(s) (no change, same behavior - before every scenario or tagged scenarios)
4 - @After hook(s) (no change, same behavior - after every scenario or tagged scenarios)
5 - .... 3 and 4 for all scenarios in a feature
6 - @AfterFeature hook(s) (runs after a feature without tags or with tags for tagged features)
7 - ....2 to 6 for every feature
8 - @AfterTests hook(s) (runs once after all the features are run)

As test for the new hooks see/run:
- cucumber.runtime.java.hooks.RunWithAllHooksTest
- cucumber.runtime.java.hooks.HooksStepDefs
- test\resources\cucumber\runtime\java\hooks\feature-1.feature
- test\resources\cucumber\runtime\java\hooks\feature-2.feature

Added junit tests and cucumber tests for new code