Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resource directory for tests in a Play application

I need some resources (text files) for my tests in a Scala Play 2.0 application. Where can I put these files?

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.

I can put them in the confdirectory, but I only need them when I test the application.

like image 454
Sonson123 Avatar asked Oct 06 '12 19:10

Sonson123


People also ask

Where do you put test resources?

what is a resource? a resource is a file in the class path folder structure for your project. this is important because your test resources will be put in your test-classes folder hierarchy and your main resources will be put in your classes folder hierarchy — both in your target folder.

In which directory are the play projects unmanaged libraries kept?

The lib/ directory The lib directory is optional and contains unmanaged library dependencies, ie. all JAR files you want to manually manage outside the build system.


1 Answers

Call

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".

"show" is a sbt command (or task) that enables you to retrieve the values of settings.

like image 61
Schleichardt Avatar answered Sep 20 '22 19:09

Schleichardt