PowerMock is an extension for Mockito or EasyMock, which can mock really special things… static classes, Constructors, partial mocks,…
cool thing…. http://code.google.com/p/powermock/
PowerMock is an extension for Mockito or EasyMock, which can mock really special things… static classes, Constructors, partial mocks,…
cool thing…. http://code.google.com/p/powermock/
in our project we have a few templates… so the biggest question is, where to put them… there are a lot of simple answers, but consider this: 4 productive instances, 2 test and 1 dev… these platforms dont know each others… so the solution database, which they share, or localy on each machine… db is not a solution, because the main user has no access to it, and changing templates might happen at the beginning… so file system it is… and we dicided to put them in classpath… easier to roll out for the devs… so how access a file from the classpath?
String filenameOnClasspath = “/myfile.txt” // Located in a directory which is on the classpath
URL url = getClass().getResource(filename);
String fullyQualifiedFilename = url.getFile();