Feature Requests item #1047329, was opened at 2004-10-14 22:59
Message generated for change (Settings changed) made by henryju
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497985&aid=1047329&group_id=61302
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: assertRegexPresent and assertRegexNotPresent would be great
Initial Comment:
This two methods would allow me to stop using my own
versions. Presumably jwebunit can require Java 1.4 to
make this easy to do.
----------------------------------------------------------------------
>Comment By: Julien HENRY (henryju)
Date: 2006-06-16 15:40
Message:
Logged In: YES
user_id=1235926
already done.
----------------------------------------------------------------------
Comment By: Matthew D. Cristantello (cristamd)
Date: 2005-08-30 20:38
Message:
Logged In: YES
user_id=839422
Here's some basic code to do this using the Java regex stuff:
protected void assertRegexPresent(String regex)
{
Pattern matchPattern = Pattern.compile(regex);
Matcher matcher =
matchPattern.matcher(getDialog().getResponseText());
assertTrue("Expected regualar expression not found in
response: ["+regex+"]",matcher.find());
}
I'd argue against asking the whole response to match the
regex, as I had a lot of trouble trying to deal with the
tags and linebreaks in the HTML code (.* does not match the
response, for some reason).
Hope this helps,
~Matt
----------------------------------------------------------------------
Comment By: Björn Beskow (bbeskow)
Date: 2004-10-19 08:37
Message:
Logged In: YES
user_id=444639
I definitely agree!
Perhaps an even better naming would be
assertMatch(String regex)
assertNoMatch(String regex)
assertMatchInElement(String elementID, String regex)
assertNoMatchInElement(String elementID, String regex)
assertMatchInTable(String tableSummaryOrId, String regex)
assertNoMatchInTable(String tableSummaryOrId, String regex)
assertMatchInTable(String tableSummaryOrId, String[] regex)
assertNoMatchInTable(String tableSummaryOrId, String[]
regex)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497985&aid=1047329&group_id=61302
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development