It looks ike you are using asynchronous code in a synchronous context — your test just fires off to getUser, which initiated an async HTTP request (to be called back later), and then moves on.
Since you just have the one test, chances are the test completes and the executable is done, long before there HTTP request had a chance to complete. You cannot test async code in that way.
There’s two ways to solve this. well three. One is to use sync code (Http.ExecuteRequestSynchronous). The other is to wait and let the request complete before terminating the test. This could be achieved by using an
Event that gets triggered by the successfully completed request and gets waited for in the test or (less ideal and a hack, but easier for a simple test) by just putting the main/test thread to sleep for a time sufficient enough for the request to finish.
For example, simply putting a
ccws.getUser(email, host, gotUser.completion);
I see this log output:
errorInGetUser=java.net.ProtocolException: cannot write to a URLConnection if doOutput=false - call setDoOutput(true)