File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes Singletons and testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Singletons and testing" Watch "Singletons and testing" New topic
Author

Singletons and testing

Pepe Papa
Greenhorn

Joined: Jul 26, 2007
Posts: 3
Hi!
i'd like to know if there is any problem with programatic Singletons at test time, which are them?

Thks!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

"pepepapa82"

Please check your private messages.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29249
    
139

Pepe,
It depends. If you want to mock out a class, a singleton makes things much harder than necessary.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Vilmantas Baranauskas
Ranch Hand

Joined: Dec 20, 2006
Posts: 89
Quite interesting article about singletons:
http://steve.yegge.googlepages.com/singleton-considered-stupid


Author of <a href="http://www.newsinjector.com" target="_blank" rel="nofollow">NewsInjector</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Singletons and testing
 
Similar Threads
Can we apply Spring AOP on non-singleton object ?
interview quetion on Singleton
How is Servlet a singleton?
Ilja - Singleton pattern in the faq ?
JMock with singleton object