harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Harley <george.c.har...@googlemail.com>
Subject Re: svn commit: r407752 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
Date Mon, 22 May 2006 12:10:25 GMT
Stepan Mishura wrote:
> Hi George,
>
> On 5/19/06, George Harley wrote:
>
>> Stepan Mishura wrote:
>> [SNIP]
>> Hi Stepan,
>>
>> Is your preference to separate out all "remote server dependent" tests
>> (that could be made work with a locally installed server) from the
>> normal test flow ?
>
>
> Yes.
>
>
>
>> For instance, have them run in a separate junit batch
>> that was dependent on an Ant property value (e.g. run.net.tests) ?
>> Another possibility is to invoke the tests under discussion via a JUnit
>> TestSuite - again, perhaps depending on an Ant property.
>>
>> Basically I want to be sure here that we are talking about a logical
>> separation of the tests using Ant and JUnit techniques and not a
>> physical separation of files in the file system.
>
>
> We can separate them in any acceptable way. All I want that we clearly
> define which tests require 'remote server' to be run and keep these test
> separately from 'normal test flow'. For this particular case I believe 
> that
> there is no need in 'remote server' and we can use local server stub.
>
> Thanks,
> Stepan.
>

Hi Stepan,

I agree that we can modify this test so that there is no need for a 
remote server and that we can use something local. Jetty or equivalent 
is a good basis for such local server stubs. It is fast, it is 
lightweight, it can be started and stopped very simply from within Ant 
(so that it only runs for the duration of a specified batch of unit 
tests) and may also be completely controlled from Java test code so that 
we can configure its behaviour for any test case from within that test 
case. It's architecture means that we do not have to run it as a 
complete web server but can stub out any aspect of its runtime behaviour 
we wish in order to suit the purposes of the test(s).

I don't really understand why such network tests making use of a small, 
embedded server running locally would need to be considered as outside 
of the "normal test flow".


Best regards,
George


>
>
>> Best regards,
>> George
>>
>>
>> >
>> >
>> >> Best regards,
>> >> George
>> >>
>> >>
>> >>
>> >> Stepan Mishura wrote:
>> >> > Richard, George
>> >> >
>> >> > I'm not fan of tests that depend on network connection. Is it
>> >> > necessary for
>> >> > this test:
>> >> >
>> >> > + public void test_getOutputStream_afterConnection() throws
>> >> Exception {
>> >> > +     URLConnection uc = new
>> >> > URL("http://www.apache.org").openConnection<http://www.apache.org
>> >> ").openconnection/>
>> >> >
>> >> > ();
>> >> > +     uc.setDoOutput(true);
>> >> > +     uc.connect();
>> >> > +     assertNotNull(uc.getOutputStream());
>> >> > + }
>> >> >
>> >> > Thanks,
>> >> > Stepan Mishura
>>
>>
>
> ------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message