#149 ServletUnit: server attributes, getResourcePaths()


Hi Russel,

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
temp area

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
done now.

I will supply a patch for both changes. Would be nice
to integrate it into a further build, to avoid my
personal branch.

ServletUnit is really cool !!!

Jochen Hiller


  • Jochen Hiller

    Jochen Hiller - 2006-03-04

    Logged In: YES

    Updated patch, as there was a bug when calling
    getResourcePaths() with a resourcePath with no files are in.

  • Wolfgang Fahl

    Wolfgang Fahl - 2008-03-31

    Logged In: YES
    Originator: NO

    Dear httpunit user!

    Thank you for your feature request. We appreciate the time and effort you are putting into this.

    Please supply a testcase with the expected result for the feature you are asking for and we'll look into implementing it. For a start you might want to get the trunk version from the
    subversion repository (see https://sourceforge.net/svn/?group_id=6550\)
    and have a look at the source code of some of the more than 700 JUnit based testcase in there.

    When you are ready you might want to attach the testcase (and if you already have started implementing it also the actual code) to your feature request.

    This should give you a clue on what a proper testcase for httpunit looks like. The main communication about further details of the development is via the httpunit developer mailinglist. You are most welcome to sign up via

    The httpunit developer team

    (Russell and Wolfgang as of 2008-03)

  • Wolfgang Fahl

    Wolfgang Fahl - 2008-03-31
    • assigned_to: nobody --> wolfgang_fahl
    • status: open --> pending
  • SourceForge Robot

    • status: pending --> closed
  • SourceForge Robot

    Logged In: YES
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks