URL Parameters for Custom Runners

38 views
Skip to first unread message

Jamie Jackson

unread,
Jun 7, 2014, 11:57:29 PM6/7/14
to mxu...@googlegroups.com
According to the following, I can add arbitrary URL parameters:

http://wiki.mxunit.org/display/default/Ant+Task+Doc

defaultrunnerThe testrunner responsible for accepting requests. 
"As of v1.0.5"
You can append arbitrary URL parameters (for custom runners) to the defaultrunner
Example:
defaultrunner="/foo/bar/my_runner.cfc?param1=123&param2=abc"

No/mxunit/runner/HttpAntRunner.cfc

However, if I add, say:

defaultrunner="/test/HttpAntRunner.cfc?foo=bar"

Ant ends up running 
https://mysite:443/test/HttpAntRunner.cfc?foo=bar?method=run...

...which obviously yields a "foo" URL variable with the value "bar?method=run"

Am I misunderstanding this "arbitrary URL parameters" thing?

Thanks,
Jamie

Jamie Jackson

unread,
Jun 8, 2014, 10:16:16 AM6/8/14
to mxu...@googlegroups.com
I'm away from my development machine, but I can see that this is taken into consideration in source:

http://mxunit.googlecode.com/svn/org.mxunit.ant.idea/trunk/src/org/mxunit/ant/HttpHelper.java
    public int runTest(String server, int port, String path, String queryString) throws Exception {
        try {
            //Build the URL for HttpClient
        	String sep = path.indexOf("?") > 0 ? "&" : "?";
            this.url = this.protocol + "://" + server + ":" + port + path + sep + URIUtil.encodePath(queryString);
So maybe this didn't get included in the release somehow?
Ah, yes--confirmed. Decompiling the HTTPHelper.class from the downloaded release gives:
  public int runTest(String paramString1, int paramInt, String paramString2, String paramString3)
throws Exception
{
if (paramInt == 443) {
this.protocol = "https";
}
try
{
this.url = (this.protocol + "://" + paramString1 + ":" + paramInt + paramString2 + "?" + URIUtil.encodePath(paramString3));
System.out.println("[HttpHelper] Running URL : " + this.url);
this.method = new GetMethod(this.url);
this.method.setDoAuthentication(this.doAuthentication);
It looks like this was packaged with an mxunit-ant.jar built from older code, so it seems the MXUnit team will need to re-build the downloadable release.
Thanks,
Jamie


--
You received this message because you are subscribed to the Google Groups "mxunit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mxunit+un...@googlegroups.com.
To post to this group, send email to mxu...@googlegroups.com.
Visit this group at http://groups.google.com/group/mxunit.
For more options, visit https://groups.google.com/d/optout.

Marc Esher

unread,
Jun 21, 2014, 12:28:40 PM6/21/14
to mxu...@googlegroups.com
Uggg. That's exactly it. I'll get it rebuilt and update this when it's ready

Marc Esher

unread,
Jun 21, 2014, 1:09:51 PM6/21/14
to mxu...@googlegroups.com
Please give this jar a shot. It's working as expected for me, so please confirm and I'll push it out.

Marc
mxunit-ant.jar
Reply all
Reply to author
Forward
0 new messages