I wrote ServletUnit based test cases, and missed two
features compared with a "real" web container:
1. application rely on a server attribute, e.g.
"javax.servlet.context.tempdir", to get access to a
There is no way to call the setAttribute() on
ServletUnitServlerContext. I added therefore a
constructor to ServletRunner, where I can specify
serverAttributes (as Hashtable). In WebApplication, I
added an constructor to give with these attributes,
which will be filled during initialization into the
ServletUnitServletContext via setAttribute().
2. ServletUnitServletContext is missing getResourcePaths()
This method has not been implemented yet, which I had
I will supply a patch for both changes. Would be nice
to integrate it into a further build, to avoid my
ServletUnit is really cool !!!