Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Markus Staeuble
Author
Greenhorn
Posts: 16
  • 0
  • 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.
 
Hong Anderson
Ranch Hand
Posts: 1936
  • 0
  • 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
Greenhorn
Posts: 16
  • 0
  • 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
  • 0
  • 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
Greenhorn
Posts: 16
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, got it.
 
Sven L├╝ppken
Author
Greenhorn
Posts: 6
  • 0
  • 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
 
Mourouganandame Arunachalam
Ranch Hand
Posts: 396
  • 0
  • 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
  • 0
  • 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: 396
  • 0
  • 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
  • 0
  • 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: 396
  • 0
  • 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
  • 0
  • 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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic