-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.txt
77 lines (49 loc) · 2.83 KB
/
package.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
============== Project info ====================
Play Framework in a nutshell with a deep proof of concept
===> All project must be modularized:
- All Play projects in Play modules.
- Projects that belong to other stuff (data model, bbdd, general utilities, etc) should be in other modules.
- We need to perform a different configuration:
- Two route files:
.- One in the root and the others in each play module (s)
For example in our case :
.- conf/routes
.- modules/apirest/conf/apirest.routes
===> Sbt' structure :
We have used a deprecated structure of sbt with a principal module but it is simple to fix, you can place
every module with its own build.sbt file and then in the root project you can crete a build file that mix the
different modules. It will let you that every project has its own life.
We have a particular case: modules/apirest/build.sbt ===> in this file we are telling to the twirl templates the
way how it should be formatted. The template that has to generate csv files has to be formatted:
TwirlKeys.templateFormats += ("csv" -> "views.CsvFormat") we let to know the system who is responsible for.
===> Log files: /logs => Store the log file.
===> Basically json validations check:
- the size of the json, which in playframework has a maximum size from which to process the json if we want to treat the request.
- checks the content-type so that it only treats those bodies with a content-type text/json or application/json.
===> Testing:
Aspect tested:
- Implicit conversion: modules/dbmodule/com.ldg.model.test
- Controllers and actions: modules/apirest/com.ldg.play.test
Style: FlatSpec
ref.: http://www.scalatest.org/at_a_glance/FlatSpec
Anatomy of a Playframework project:
https://www.playframework.com/documentation/2.6.x/Anatomy
https://www.jetbrains.com/help/idea/viewing-code-coverage-results.html
===> Minimal requirement for run the project:
- jdk 1.8+ => if you want check version: java -version
- scala 2.11+ => if you want check version: scala -version
- sbt 0.13+ => if you want check version: sbt about
===> How run the project:
if you have (===> Minimal requirement for run the project)
- Download the project
- go to root of the project
- sbt run
===> How make request for test the project:
- go to play route file: root_project/modules/apirest/conf/apirest.routes
Each route have "# pattern:" and "# example:" so you can cut and paste the example, check your url host
and port number in case of any change.
===> How run test suites in the project:
- go to root of the project
- sbt test
===> Running in debug mode:
start sbt console in debug mode : sbt -jvm-debug 5005