Oh, and another (rather strange) note: When running the test using the
Eclipse JUnit plugin, it works (with both 1.2.5 and trunk versions).
I noted from the source that the powermock MockClassLoader doesn't
implement the findResource function. I'm not really familiar with how
classloaders work, but checking the javadocs state that "Class loader
implementations should override this method to specify where to find
resources."
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassLoader.html#findResource(java.lang.String)
My guess on this is that the powermock classloader fails to find the
resource, the request is passed to the parent classloader. In eclipse,
the parent classloader contains the whole project in the classpath, so
it finds the resource. But when running from Ant, the parent
classloader knows nothing about the project classpath and therefore
can't find the resource.
Just guessing, I might be way off on this :)