harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: local test server (Was: Re: [jira] Commented: (HARMONY-71) java.net.URLConnection.setUseCaches throws unspecified IllegalAccessError)
Date Wed, 22 Feb 2006 11:06:52 GMT
Stepan Mishura wrote:
> On 2/21/06, Tim Ellison <t.p.ellison@gmail.com> wrote:
>> Stepan Mishura wrote:
>>> I glanced through a local server code from HARMONY-57 contribution
>> without
>>> looking into implementation details and ... this made me think. I catch
>> hold
>>> of the following:
>>> 1) The server contains some testing code that looks not good for me
>> Care to explain?
> Support_HttpServer.java has the following code:
> class ServerThread implements Runnable {
>     public void run() {
>          ....
>         // call the test function based on the requested resource
>          if (resourceName.equals(CHUNKEDTEST))
>              chunkedTest();
>          <... lot of 'else if' ...>
>         ...
>        }
>        private void chunkedTest() {
>             <... construct server's respond and send it ...>
>        }
> I'd prefer to avoid this and to have a server implementation that provides a
> way for unit test to check received request and to configure a server's
> respond.

and I thought you wanted it simple ;-)

There is no way to force a server to send you a chunked response using
regular HTTP headers, so in this case the server and client have an
understanding that when the client asks for a particular resource the
server will send it back in chunks.

If that understanding was encoded differently, say in the search field
of the URL rather than the path would that make you happier?  do you
have some other idea?


>> Does it interfere with what you want to do?
> Sure, we have javax.security.auth.kerberos.KerberosTicket class that
> currently contains a stub. I was thinking about implementing the stub and
> how to test it. So I played a little bit with developing Kerberos stub
> server. When I saw that tests for URLConnection class failed because they
> need local stub server then I got interested how to solve this similar
> issue.

Not clear how that interferes.  You should feel free to reuse the server
code and extend it as you need to do a faux Kerberos server.



Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

View raw message