Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

[Spring Web Flow 2] Spring Web Flow 2 comes with direct support of Tests  RSS feed

 
Author
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The framework Spring Web Flow 2 offers an integrated mechanismn of testing the flows.
More information could be read here: http://static.springframework.org/spring-webflow/docs/2.0.x/reference/htmlsingle/spring-webflow-reference.html#testing

We have used that integration inside our project and it helps us to increase the quality of the flows.
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. To test flows, does it need to deploy application to Servlet container? Or we can test outside the container?

And how to run the test? From documentation, it doesn't explain how to run.

 
Markus Staeuble
Author
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tests could be run outside a servlet container. The tests are "simple" JUnit-Tests. The concept behind that tests is to test the flow itself. A description is provided here: http://static.springframework.org/spring-webflow/docs/2.0.x/reference/htmlsingle/spring-webflow-reference.html#testing
Additionally we have one chapter (chapter 5) in our book which is dedicated to testing a Spring Web Flow application.
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Markus.
Could you please to be more specific about how to run the tests?
Like in TestNG, there are 3 methods: run from Ant script, run from Eclipse (with TestNG plug-in), and run from command line.
 
Markus Staeuble
Author
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tests are JUnit (http://junit.org) - Tests. Therefore you can run it from Apache ANT (http://ant.apache.org), Maven (http://maven.apache.org). Additionally you can run it from the IDE of your choice, for example from eclipse. The commandline is possible, too.
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, got it.
 
Author
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion the chapter about testing your flows is fairly extensive...I hope you'll like it as much as I do! It explains how to test your flows, subflows, persistence contexts and also gives a short introduction to EasyMock, which helps you to create mock implementations of your interfaces.

Thanks,
Sven
 
Ranch Hand
Posts: 398
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kengkaj Sathianpantarit wrote:Thanks. To test flows, does it need to deploy application to Servlet container? Or we can test outside the container?



do we have any testing framework support testing after deploy the application on the servlet container?
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mourouganandame Arunachalam wrote:

Kengkaj Sathianpantarit wrote:Thanks. To test flows, does it need to deploy application to Servlet container? Or we can test outside the container?



do we have any testing framework support testing after deploy the application on the servlet container?


Yes. After deploy to servlet container, we can open a JSP page to run tests (logic to run test is in the JSP).
 
Mourouganandame Arunachalam
Ranch Hand
Posts: 398
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kengkaj Sathianpantarit wrote:Yes. After deploy to servlet container, we can open a JSP page to run tests (logic to run test is in the JSP).



Is there any testing framework enforces this type of testing....? just curious ...
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mourouganandame Arunachalam wrote:

Kengkaj Sathianpantarit wrote:Yes. After deploy to servlet container, we can open a JSP page to run tests (logic to run test is in the JSP).



Is there any testing framework enforces this type of testing....? just curious ...


I think every testing framework support running tests from command line. If we can run tests from command line, we can run from Java codes as well.
 
Mourouganandame Arunachalam
Ranch Hand
Posts: 398
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kengkaj Sathianpantarit wrote:

Mourouganandame Arunachalam wrote:

Kengkaj Sathianpantarit wrote:Yes. After deploy to servlet container, we can open a JSP page to run tests (logic to run test is in the JSP).



Is there any testing framework enforces this type of testing....? just curious ...


I think every testing framework support running tests from command line. If we can run tests from command line, we can run from Java codes as well.




I know testing frameworks provides way to test your java class either from command line or using some IDE.

However, I never heard of testing frameworks forces to test after deploying the code into servlet container. Am I missing something?
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mourouganandame Arunachalam wrote:
However, I never heard of testing frameworks forces to test after deploying the code into servlet container. Am I missing something?


Start Servlet container just means make the dependencies available to use.
There are two approaches when testing Java EE, in-container test and out-of-container test.

In case of out-of-container test, we have to simulate the container to make the dependencies available.
I was curious that if Spring Web Flow Test is a custom testing framework that offers simulated container, that was the reason why I asked, and after that I realized that they are JUnit tests (not a custom testing framework of Spring Web Flow).
 
I'm so happy! And I wish to make this tiny ad happy too:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!