English 中文(简体)
AtUnit vs Junit,JMock and GUICE by hand -?
原标题:

How does AtUnit fare with respect to unit testing using DI and guice ?. Please share your experiences.

问题回答

I have found it works rather well and is very simple to use. In my case though, after a while, I decided to revert back to my old pattern of rarely using DI in unit tests, unless I m testing something functional. I found that all the extras that AtUnit was providing were simply not being used in my situation.

In the cases where I do use Guice in tests, my unit test class extends AbstractModule and I do the Guice initialization etc manually in my @Before method. I suppose using AtUnit here would be pretty much the same with the exception that all my manual stuff would mostly disappear.





相关问题
Run JUnit automatically when building Eclipse project

I want to run my unit tests automatically when I save my Eclipse project. The project is built automatically whenever I save a file, so I think this should be possible in some way. How do I do it? Is ...

Embedded jetty ServletTester serving single static file

I m unit testing with jetty and I want to serve not only my servlet under test but a static page as well. The static page is needed by my application. I m initializing jetty like this tester = new ...

Applying one test to two separate classes

I have two different classes that share a common interface. Although the functionality is the same they work very differently internally. So naturally I want to test them both. The best example I ...

热门标签