Play应用程序中测试的资源目录 [英] Resource directory for tests in a Play application
问题描述
在Scala Play 2.0应用程序中,我需要一些资源(文本文件)来进行测试.这些文件可以放在哪里?
I need some resources (text files) for my tests in a Scala Play 2.0 application. Where can I put these files?
在Maven应用程序中,我会将它们放入src/test/resources
,但在Play文档中找不到有关同等目录的任何内容.
In a maven app I would put them into src/test/resources
, but I cannot find anything about an equal directory in the Play documentation.
我可以将它们放在conf
目录中,但是只有在测试应用程序时才需要它们.
I can put them in the conf
directory, but I only need them when I test the application.
推荐答案
致电
play "show test:resource-directory"
在控制台中,它显示了在测试模式下资源目录的绝对路径. 它将在测试/资源"中.
in the console and it shows you the absolute path to your resource directory in test mode. It will be in "test/resources".
显示"是一个sbt命令(或任务),使您可以检索设置的值.
"show" is a sbt command (or task) that enables you to retrieve the values of settings.
这篇关于Play应用程序中测试的资源目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!