Open RichardWarburton opened 11 years ago
In the old framework it the actually Junit test and the test verticle where different things which meant you had to maintain at least two classes for each test.
In the new framework the test IS the verticle so declaring the verticle that actually gets deployed in an annotation is redundant.
Here's a motivating scenario. I've got some code which tests a verticle called Foo. Foo talks to the mongo persistor which is a module. So before I run any tests on Foo i need to deploy mod-mongo-persistor and wait for it to come up, using the completion handler before I run the test. I don't want to put code in every test I write in order to download the module - I'd simply like to declare that I need a module to be loaded.
Oh I see, you don't need to put the code that deploys mongopersistor in each test - you could add this in the start() method of the test verticle and it ill be executed for each test.
Thanks Tim, but that's what I'm doing already as a workaround. The issue is that if you want to have more than one modules or dependent verticles to deploy then the code gets quite nasty quite rapidly and it feels like the kind of concern that the testing framework should take care of for me.
If you're happy to accept this as an issue then I don't mind looking into writing a fix.
Right, I can see that what you suggest could be useful. Sure please go ahead and implement it if you like :)
This issue is pretty old, but looks valuable to me.
The old test annotations project had a way of declaring which verticles and modules you wanted to have deployed, ie what your test depended upon, before a test was run. This has been removed in testtools in favour of manual deployment.
The freedom given by manual deployment is good, but it would be helpful if there was some support for declaring things you want to deploy. This could come in the form of an annotation or it could come in the form of a method, for example:
At the moment when using testtools we're finding we do this a lot. Its a requirement that verticles are brought up and deployed before tests start executing.