Is there any way to generate a set of JWebUnit tests from an apache rewrite config?
Posted
by
robbbbbb
on Stack Overflow
See other posts from Stack Overflow
or by robbbbbb
Published on 2011-07-27T14:48:57Z
Indexed on
2012/11/17
17:01 UTC
Read the original article
Hit count: 157
Seems unlikely, but is there any way to generate a set of unit tests for the following rewrite rule:
RewriteRule ^/(user|group|country)/([a-z]+)/(photos|videos)$ http:/whatever?type=$1&entity=$2&resource=$3
From this I'd like to generate a set of urls of the form:
- /user/foo/photos
- /user/bar/photos
- /group/baz/videos
- /country/bar/photos
- etc...
The reason I don't want to just do this once by hand is that I'd like the bounded alternation groups (e.g. (user|group|country)
) to be able to grow and maintain coverage without having the update the tests by hand.
Is there a rewrite rule or regex parser that might be able to do this, or am I doing it by hand?
© Stack Overflow or respective owner