开发者

How to reuse test code from open source project

I'm writing a unit test for a custom subclass of org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T> and I need a stub implementation of org.springframework.http.HttpInputMessage. Look开发者_如何学编程ing through the Spring unit tests in the SVN repository, I found the class MockHttpInputMessage, which does exactly what I want.

Now, I wonder what is the proper way to reuse this class?

Or is it generally a bad idea, because the class is not meant to be used outside of the Spring unit tests?


I'm not involved in the Spring project, but from the names I would assume that the class is not intended for reuse. Therefore, I would simply take the class in source form and add it to your project test sources.

Of course all this assumes, this is acceptable with respect to licenses.


I would simply copy it to my own repository, and use it to my hearts content. You want it under your own control so that you are not adversely affected by future changes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜