【发布时间】:2014-04-10 09:22:52
【问题描述】:
我正在开发一个测试 Web 服务的应用程序,我使用 JUnit parameterized tests。我想从资源文件中读取参数。 我想知道哪个是存储这些参数的最佳方式。
-
在 .properties 文件中?
test1.inputPath= C:\\Path test1.expectedOutputPath= C:\\Path test2.inputPath= C:\\Path2 test2.expectedOutputPath= C:\\Path2 -
在 xml 文件中?
<test> <inputPath> C:\Path <\inputPath> <expectedOutputPath> C:\Path <\expectedOutputPath> <\test> <test> <inputPath> C:\Path2 <\inputPath> <expectedOutputPath> C:\Path2 <\expectedOutputPath> <\test> 还有其他方法吗?
谢谢。
【问题讨论】:
-
我认为第一个效果很好
-
你知道我可以使用的另一种类型的资源文件,它比 .properties 文件更容易阅读吗?
标签: java xml properties-file resource-files