Play 2.0's sample app which integrates JBehave & Spring frameworks.
- Install these following softwares in your machine:
- JDK 7 with latest updates version.
- Latest version of Play 2.1RC or above (www.playframework.org).
- Git client
- Intellij IDEA 11.x-12.x (Optional)
- Open command line box & change directory to the Sample.Play.Jbehave.Spring.Client.
- Type & enter: play clean compile
In the Sample.Play.Jbehave.Spring.Client directory (in command line mode), type & enter: play test.
- In the Sample.Play.Jbehave.Spring.Client directory, type & enter: play run (in command line mode).
- Open your browser and browse to: http://localhost:9000
- Change directory to the Sample.Play.Jbehave.Spring.Client (in command line mode).
- Type & enter: play idea
- Open the project using your Intellij IDEA.
- app folder - contains controllers & views packages. Each of the package contains the web's main controller (Application.java) & html page (index.scala.html).
- conf folder - The place of where Play's config, routes & Spring module config file (application-context.xml) reside.
- test folder - Contains 1 test package at the moment (sample.play.jbehave.spring.service.math.spec) where JBehave story file, JUnitStory & steps classes reside.
HOW TO - Prove that the dependency injection is working in the JBehave Test ( Intellij IDEA 11.x-12.x):
- Open the Sample.Play.Jbehave.Spring.Client project on Intellij IDEA.
- In the Project panel, rename the .jar library 'sample.play.jbehave.spring.services.jar' to 'sample.play.jbehave.spring.services.renamed'.
- Run the JBehave unit test in the command line. Confirm that 'org.springframework.beans.factory.BeanCreationException' error happens.
- Re-rename the .jar library in step #2 to its original name.
- Re-run the JBehave unit test in the command line. Ensure that the test is passed.
- Extend the sample to cover real-life problems or business processes (e.g. CRUD sample, Credentials check, reporting, etc).
- Add Runtime Integration testing using Webspec API ( http://watij.com/webspec-api/).
- Extend the current 2-tier app model to n-tier by moving the injected service into a REST resource.
- Improving the View pages by using Jqwidget, Knockout.js or Extjs.
- Utilising Akka actor as the service's wrapper-manager.
- And many more.
- "Dependency Injection with the Spring Framework - Tutorial" (http://bit.ly/MebzQd).
- "JBehave - quick BDD example" (http://bit.ly/qk5WpW).
- "Spring Module for Play 2.0" (http:http://bit.ly/TTK910)