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

Day 1 - Looking at Griffon (GRails for Swing Apps)

  1. Download the latest Griffon release. (6/9/09: Done)
  2. Extract the archive into an appropriate location; typically C:\griffon on Windows or ~/griffon on Unix. (6/9/09: Installed in c:/griffon-0.0.1 directory)
  3. Create a GRIFFON_HOME environment variable that points to the path where you extracted the archive (eg C:\griffon on Windows or ~/griffon on Unix). (6/9/09: Set up system variable "GRIFFON_HOME=c:\griffon-0.0.1".
  4. If you have not set the JAVA_HOME environment variable yet, create JAVA_HOME environment variable that points to the path where you have installed Java. (6/9/09: Set up system variable "JAVA_HOME=C:\Program Files (x86)\Java\jre6".
  5. Append a reference to the "bin" directory within the Griffon directory to your PATH variable (eg %GRIFFON_HOME%\bin on Windows or $GRIFFON_HOME/bin on Unix). Note that, for Windows, both PATH and GRIFFON_HOME must be defined at the same environment variable level (eg. 'System variables') rather than across environment variable levels (eg. PATH under 'System variables' and GRIFFON_HOME under 'User variables'). (6/9/09: Done)
  6. Type "griffon" at the command line, if a help message is displayed you are ready to start using Griffon! (6/9/09: Tried/Worked)
  7. If you get an error message, try to chmod +x the griffon script inside the bin directory. (6/9/09: Step 6 so skipped this line)
  8. Then I added this: "export PATH=$PATH:/cygdrive/c/griffon-0.0.1/bin" to $HOME/.bash_profile file and tried griffon and it did not work. I had to do griffon.bat.
  9. Tried "griffon.bat run-app" and got an error that I think is caused by setting JAVA_HOME to JRE instead of JDK, so I updated my JDK and changed my $JAVA_HOME to "c:\Program Files\Java\jdk1.6.0_14" (64-bit version). (6/9/09: Ran "griffon.bat runapp" and the small window came up. ) (see page 2 of Griffon: Riding the Griffon article)
  10. Tried "griffon.bat stats" and scripts were not found. Check scripts directory and they was no scripts.
  11. Tried to use "tree \a" and it is a "cmd" command, not a cygwin command, so I used "find . -type d" and found that "out" and "staging" and "test" directories were gone.
  12. NO TEST directories.