This test case fails:
WebRequest request = new
GetMethodWebRequest("http://localhost/pathinfo?queryString");
assertEquals("queryString", request.getQueryString());
It returns "" instead of "queryString" minus quotes
Using setParameter to workaround this:
WebRequest request = new
GetMethodWebRequest("http://localhost/pathinfo?queryString");
request.setParameter("queryString","");
assertEquals("queryString", request.getQueryString());
returns "queryString=" instead of "queryString" minus
quotes. This is probably correct behavior.
However, we need a way to just return the parameter and
not the equal sign. i.e.
WebRequest request = new
GetMethodWebRequest("http://localhost/pathinfo?queryString");
request.setParameter("queryString",(String)null);
assertEquals("queryString", request.getQueryString());
But this also fails, the returned value is:
"queryString=" instead of "queryString" minus quotes.
Attached is a patch to support Null values.
This also passes with this test case:
public void testGetQueryString() throws Exception {
WebRequest wr = new
GetMethodWebRequest("http://localhost?wsdl");
wr.setParameter("abc","def");
wr.setParameter("def","");
wr.setParameter("test",(String)null);
wr.setParameter("wsdl", (String)null);
assertEquals("wsdl&abc=def&def=&test",wr.getQueryString());
}
Patch to UncheckedParameterHolder to support null values for proper query string creation.
Logged In: YES
user_id=1220573
Originator: NO
Dear Brian,
thank you for your bug report I'll look into this now together with the upcoming 1.7/2.0 releases of httpunit
Yours
Wolfgang
Logged In: YES
user_id=1220573
Originator: NO
The change is now in the subversion repository and will be in the next build
Logged In: YES
user_id=1220573
Originator: NO
Dear Brian,
thank you - I've added your patch as follows:
http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=918
Your initial assertion still does not work - just the work-around.
Anybody got an improvement here?
Yours
Wolfgang