http://appfuse.org/display/APF/Using+Hibernate

I was looking at the above page and noticed a problem in the example
integration test.

Looks like the test is trying to do too much.  If your Dao save, get or
remove methods throw the exception, the test will pass.  I think you'd
either have to break it into multiple tests, or put a try/catch around the
save through remove lines and in the catch, manually fail the test.  Then
only if the very last line is the one to throw the exception does the test
pass.

I found this just searching for good integration test examples for Spring 3
/ Hibernate app.  I wonder if someone can answer my question?

I have my DaoIntegrationTests working nicely.  Using the line:

 // Manual flush is required to avoid false positive in test
       sessionFactory.getCurrentSession().flush();

as mentioned in the spring docs. 
(http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/testing.html)

My question is what about integration tests for Service and Controllers?  I
don't want those tests to know about sessionFactory, but wouldn't I need to
flush just the same as with the DaoTest?

Has anyone found any great resources that have detailed examples of
integration tests?  One last thing I'm fighting is the briefness of the
Spring 3 docs.  Have you converted your PropertyEditors over to their
Converter/Formatter API?



-- 
View this message in context: 
http://n4.nabble.com/Integration-Tests-tp1563151p1563151.html
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to