thanneeruvenu / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

Allow extensions to access RunNotifier #322

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In order to integrate with Spock Arquillian better - , we need a way how to 
access JUnit RunNotifier to add a new RunListener for our annotation based 
extension. The idea is to "fire" BeforeSuite and AfterSuite events, which is 
not possible neither with current implementation.

This is currently not possible without modifying Sputnik class, hence creating 
new entry point.

See 
https://github.com/arquillian/arquillian-core/blob/master/junit/core/src/main/ja
va/org/jboss/arquillian/junit/Arquillian.java#L108 for more details.

Original issue reported on code.google.com by karel.pi...@gmail.com on 26 Jul 2013 at 9:04

GoogleCodeExporter commented 8 years ago
I've ended up with following code for extended Sputnik: 

https://github.com/arquillian/arquillian-testrunner-spock/blob/master/core/src/m
ain/java/org/jboss/arquillian/spock/ArquillianSputnik.java

This does exactly what I need in order to emulate BeforeSuite and AfterSuite 
events

Peter, what do you think about making more of Sputnik code protected instead of 
private? It would reduce amount of code I need to maintain. I'd file a new 
issue if you agree that's a good way forward.

Original comment by karel.pi...@gmail.com on 18 Sep 2013 at 3:37