Skip to content

Commit 7283a51

Browse files
adding doc
1 parent c7510cd commit 7283a51

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The design of this example differs in two significant ways from the traditional
2020
1. **Distinct model and form classes.** Most examples of form processing in Play "overload" the
2121
model classes to serve two tasks: (1) specify the database schema structure; and
2222
(2) provide the "backing class" for forms. Requiring a single class to perform these two tasks
23-
works well only when the models and forms are both simple and similar in structure. In this example system, the
23+
appears to work well only when the models and forms are both simple and similar in structure. In this example system, the
2424
[views.formdata package](https://github.com/ics-software-engineering/play-example-form/tree/master/app/views/formdata) provides
2525
classes for form processing, and the [models package](https://github.com/ics-software-engineering/play-example-form/tree/master/app/models) provides
2626
classes for database schemas. Since Play requires the backing classes for forms to have public fields,
@@ -37,16 +37,40 @@ The design of this example differs in two significant ways from the traditional
3737
Steps to understanding the system
3838
---------------------------------
3939

40-
**Play with the application.**
40+
**Play with the running application.**
4141

4242
Begin by downloading the code, invoking "play run" in your shell, then retrieving http://localhost:9000
4343
to retrieve the single form as illustrated at the top of this page. The form displays the fields
4444
associated with a "Student": Name, Password, Hobbies, Level, GPA, and Majors. Some of these
45-
are required, some are optional.
45+
are required, some are optional. Try filling out the form in both valid and invalid ways.
46+
4647

4748
When you submit a valid version of the form, the system will redisplay the form with exactly the
4849
same data that you entered.
4950

51+
**Run the tests.**
52+
53+
Next, type "control-D" in your shell to bring down the development server, and then "play test"
54+
to invoke the test cases. You should get output similar to the following:
55+
56+
[~/play-example-form]-> play test
57+
[info] Loading project definition from /Users/johnson/projecthosting/github/play-example-form/project
58+
[info] Set current project to play-example-form (in build file:/Users/johnson/projecthosting/github/play-example-form/)
59+
[info] tests.ViewTest
60+
[info] + tests.ViewTest.testIndexPageRetrieval
61+
[info] + tests.ViewTest.testIndexPageEmptySubmission
62+
[info] + tests.ViewTest.testIndexPageValidSubmission
63+
[info] + tests.ViewTest.testIndexPageFormFilledSubmission
64+
[info]
65+
[info]
66+
[info] Total for test tests.ViewTest
67+
[info] Finished in 0.015 seconds
68+
[info] 4 tests, 0 failures, 0 errors
69+
[info] Passed: : Total 4, Failed 0, Errors 0, Passed 4, Skipped 0
70+
[success] Total time: 8 s, completed Aug 16, 2013 10:05:33 AM
71+
72+
We'll come back to this later, but this step verifies that tests run correctly in your environment.
73+
5074
**Review the controller.**
5175

5276
Now review the controller class. [Application](https://github.com/ics-software-engineering/play-example-form/blob/master/app/controllers/Application.java)

0 commit comments

Comments
 (0)