开发者

Unit testing installation of services

开发者 https://www.devze.com 2022-12-30 01:30 出处:网络
Our installer program is going to be installing a number of system services, under both Windows and UNIX, using JavaServiceWrapper.There will be a class responsible for creating JavaServiceWrapper con

Our installer program is going to be installing a number of system services, under both Windows and UNIX, using JavaServiceWrapper. There will be a class responsible for creating JavaServiceWrapper config files, installing the services, etc.

开发者_如何学运维

Can I have some suggestions on how to unit-test this class?


I would not struggle too much with unit testing such a class, rather I would go for integration / smoke tests. You need these anyway to verify that your installation works properly - preferably not only on your own machine, but also in the target environment, in real life, before you are about to demonstrate it to your boss and most important client :-)

Update: I assume that the class in question would not contain much complicated logic, rather just gluing together different pieces supplied by other APIs. However, if this is not the case, and you feel you can't easily test a significant part of its functionality via integration tests, you can still try unit testing with good ol' mocks and/or dependency injection.


Lol! Found this last night. Environmentally Friendly Deployment. I really think as more complex your deployment, the more you need to validate your environment.

0

精彩评论

暂无评论...
验证码 换一张
取 消