hm.. I see the problem. But It's odd that we may not unjar "classes" directory depending on the pattern but still put it on the classpath. May be we should only put the workDir and the direct contents of it on the classpath? Thoughts? Any other ideas? Or leave the classpath alone?
I think we should leave the classpath alone. As this patch stands, it's not a breaking change, but getting rid of classes/ from the classpath would be. It's already also being put on the classpath even in the case when it doesn't exist, which doesn't cause any problems.
Either you can add dummy directories/files under src/test/mapred/testjar/ and build the jar(search for testjar in build.xml).
This only exists in the mapreduce build, not in common. This patch is now in common, so no such luck.
build a jar yourselves using JarOutputStream inside the test itself
Done. New patch attached that includes this unit test.