berkus / tumbler-glass

Automatically exported from code.google.com/p/tumbler-glass
0 stars 0 forks source link

SpringJUnit4ClassRunner #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I reopen this issue.

We need to have a Tumbler runner that extends SpringJUnit4ClassRunner, in order 
to wire the tests up with spring beans.

As you specified in 
http://code.google.com/p/tumbler-glass/wiki/IntroductionForDevelopers 
(paragraph "Running Tumbler stories together with Spring"), there's a trick 
which should do it.

BUT

It doesn't look good to me. I think (I have to check it, though) that the 
spring context is then loaded before every test method run, which is not always 
good (like in the case of @DirtiesContext).

I believe that a new runner should be created, which subclasses 
SpringJUnit4ClassRunner.

Original issue reported on code.google.com by al...@fastmail.net on 15 Jun 2011 at 8:46

GoogleCodeExporter commented 9 years ago
Ok. You're right. Dirties don't work.

Original comment by lipinski...@gmail.com on 15 Jun 2011 at 9:52

GoogleCodeExporter commented 9 years ago
Implemented (you can check it in the sources if you need it urgently). Will be 
released with the upcoming release.

Original comment by lipinski...@gmail.com on 15 Jun 2011 at 6:09

GoogleCodeExporter commented 9 years ago
Great!!

I had a quick look at the code. One question: is the SpringTumblerRunner 
supporting also JUnit annotations?

With SpringJUnit4ClassRunner I am often using @Before @After @BeforeClass and 
@Ignore - the latter is not that useful with @Scenario(pending = false), 
though. I believe these annotations should be supported by SpringTumblerRunner 
as well.

Original comment by al...@fastmail.net on 15 Jun 2011 at 6:50

GoogleCodeExporter commented 9 years ago
yep, everything should work, including @Before, rules and everything else.
Some specific Spring annotations will not (e.g. @Timed), but most will (like 
DirtiesContext)

Original comment by lipinski...@gmail.com on 15 Jun 2011 at 7:40