Tuesday, June 9, 2009

Day 1 - Looking at Grails

  1. Tried to get "Getting Started with Grails" from InfoQ, but could not.
  2. 6/9/09: Downloaded grails-1.1.1 and put it in c:\grails-1.1.1 directory.
  3. Set up GRAILS_HOME as "c:grails-1.1.1". (6/9/09: Done)
  4. Tried "grails" and it worked.
  5. Ran "grails create-app" and named app "addressBook" and got 91 file/directories.
  6. Moved to longer "Introduction to Grails" article and ran "grails create-app testapp" (p.2) and it worked (i think).
  7. Then I moved into "testapp" directory and ran "grails create-domain-class Person" (p.2)
  8. Added 3 lines to grails-app/domain/Person.groovy file. (p.3)
  9. Then ran " grails create-controller Person" (p.3)
  10. Then add "def scaffold = true" to grails-app/controllers/PersonController.groovy file. (p.3)
  11. Then ran "grails run-app" and opened "localhost:8080/testapp" and it worked. (p.4)
  12. Then ran "grails generate-all Person" and it appears to work. (p.4)
  13. Added listYoungPeople action to controller. (p.6)
  14. Then ran 'grails create-tag-lib TestApp" to create TagLib. (p.6)
  15. Had to add "myTestTag" to grails-app/taglib/TestAppLib.groovy file (p.6)
  17. Fixed a typo in TestAppLib.groovy and reRan it. Worked (p.7)
  18. Now tried the test-related grails options (create-integration-test, grails create-unit-test, grails test-app). They worked. Example: $ grails test-app
    Welcome to Grails 1.1.1 - http://grails.org/
    Licensed under Apache Standard License 2.0
    Grails home is set to: c:/grails-1.1.1
    Base Directory: C:\cygwin\home\jasnow\GROOVY\GRAILS\testapp
    Running script c:\grails-1.1.1\scripts\TestApp.groovy
    Environment set to test
    [groovyc] Compiling 1 source file to C:\Users\jasnow\.grails\1.1.1\projects\testapp\classes
    [mkdir] Created dir: C:\cygwin\home\jasnow\GROOVY\GRAILS\testapp\test\reports
    [mkdir] Created dir: C:\cygwin\home\jasnow\GROOVY\GRAILS\testapp\test\reports\html
    [mkdir] Created dir: C:\cygwin\home\jasnow\GROOVY\GRAILS\testapp\test\reports\plain
    Starting unit tests ...
    Running tests of type 'unit'
    [mkdir] Created dir: C:\Users\jasnow\.grails\1.1.1\projects\testapp\test-classes\unit
    [groovyc] Compiling 4 source files to C:\Users\jasnow\.grails\1.1.1\projects\testapp\test-classes\unit
    Running 4 unit tests...
    Running test PersonControllerTests...PASSED
    Running test PersonTests...PASSED
    Running test TestAppTagLibTests...PASSED
    Running test UtTestTests...PASSED
    Tests Completed in 705ms ...
    Tests passed: 4
    Tests failed: 0

    Starting integration tests ...
    [copy] Copying 1 file to C:\Users\jasnow\.grails\1.1.1\projects\testapp\test-classes\integration
    [copy] Copying 1 file to C:\Users\jasnow\.grails\1.1.1\projects\testapp\test-classes
    [groovyc] Compiling 1 source file to C:\Users\jasnow\.grails\1.1.1\projects\testapp\classes
    [groovyc] Compiling 1 source file to C:\Users\jasnow\.grails\1.1.1\projects\testapp\classes
    Running tests of type 'integration'
    [groovyc] Compiling 1 source file to C:\Users\jasnow\.grails\1.1.1\projects\testapp\test-classes\integration
    Running 1 integration test...
    Running test ItTestTests...PASSED
    Tests Completed in 35ms ...
    Tests passed: 1
    Tests failed: 0
    [junitreport] Processing C:\cygwin\home\jasnow\GROOVY\GRAILS\testapp\test\reports\TESTS-TestSuites.xml to c:\Users\jasnow\AppData\Local\Temp\null1060012370
    [junitreport] Loading stylesheet jar:file:/c:/grails-1.1.1/lib/ant-junit-1.7.0.jar/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
    [junitreport] Transform time: 974ms
    [junitreport] Deleting: c:\Users\jasnow\AppData\Local\Temp\null1060012370

    Tests PASSED - view reports in C:\cygwin\home\jasnow\GROOVY\GRAILS\testapp\test\reports.
  19. Started up Netbeans and opened testapp inside netbeans. Ran the tests and they worked.
  20. Found Google E-group for Grails: http://groups.google.com/group/grails/web/getting-started-with-grails
  21. Watched the grails and webtest screencast (Very Good). Then tried to install webtest (grails install-plugin webtest), then "grails create-webtest", then "grails run-webtest".
  22. Watched the "Intro to Grails with RESTful Web Services" (6/9/09: done/Very Good)
  23. Ran this; "grails install-plugin testing-labs", then "grails create-controller-integration-test Person".

No comments:

Post a Comment