vert-x / testtools

Vert.x 2.x is deprecated - use instead
http://vertx.io/docs/vertx-unit/java/
Other
10 stars 10 forks source link

@Before and @After do not work #4

Open ewolff opened 11 years ago

ewolff commented 11 years ago

@Before and @After annotations as known from JUnit do not work @BeforeClass do work, however.

https://gist.github.com/ewolff/5894732 fails in beforeIsExecuted() https://gist.github.com/ewolff/5894741 fails in afterClass()

I am running the tests in the test-tools-tests project commit 493fa1314565173ecac2ed8fb5438e358cb687ce .

RichardWarburton commented 11 years ago

+1 for fixing this.

purplefox commented 11 years ago

We only support the @Test annotation and the Junit assert API in test tools. http://vert-x.github.io/dev_guide.html#integration-tests

RichardWarburton commented 11 years ago

Thanks for replying @purplefox

I appreciate that you're only supporting the @Test annotation at the moment, but are you saying that you would reject pull requests that implement @before and @after functionality as well?

purplefox commented 11 years ago

Pull requests are always welcome :)

RichardWarburton commented 11 years ago

@purplefox if I implement this, I've got an open design question:

Since the test class is now a verticle and thus performs comms/io etc asynchronously any implementation of the @Before and @After methods need to have a way of signalling that they complete. In normal tests this is achieved by a call to VertxAsserts.testComplete(). Would you want these methods to follow the same model?

ddossot commented 10 years ago

+1 for fixing this, at least for v3 :smile:

Supporting @Rule would be great too.