You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Kristian Koehler <Kr...@gmx.de> on 2003/08/28 17:12:50 UTC
DownloadTest Failure when working offline/ behind firewall
Hi
we have a problem when running the tests for the core module.
The org.apache.geronimo.deployment.repository.DownloadTest fails when
being executed offline or from behind a firewall. Since the VM can't
establish a connection to the remote URL (http://www.ibiblio.org/maven/)
the test fails causing the complete build to fail as well. Which means
that currently only compilation and testing is run. Building a
distribution requires local hacking (which is a bit annoying).
Or are we missing some local configuration, especially for working offline?
If not, we could image the following solutions and would provide them if
wanted.
1. Check if a Connection to the remote host can be establihed. If not
skip the testRemoteCopy() Test.
2. Start a tiny web server (like JWebUnit IIRC) on the local machine and
download the file from there.
3. Is the remote HTTP test actually necessary?
FFPX
Steffen and Kristian
Re: Failing Test Cases
Posted by Siva <si...@sivasundaram.com>.
Windows xp SP1
maven 1.0-beta-10
JDK changed from j2sdk1.4.0_01 to j2sdk1.4.2_01
Siva
----- Original Message -----
From: "Hiram Chirino" <hi...@coredevelopers.net>
To: <ge...@incubator.apache.org>
Sent: Tuesday, September 09, 2003 6:50 AM
Subject: Re: Failing Test Cases
> That's the kinda info that would be for a FAQ. Can you send me the info
> of what platform you were running on?
>
> Regards,
> Hiram
>
Re: Failing Test Cases
Posted by Hiram Chirino <hi...@coredevelopers.net>.
That's the kinda info that would be for a FAQ. Can you send me the info
of what platform you were running on?
Regards,
Hiram
On Mon, 2003-09-08 at 11:41, Siva wrote:
> I just updated my JDK from j2sdk1.4.0_01 to
> j2sdk1.4.2_01 and the remoting tests run.
>
> I guess the earlier Jdk had few bugs when close() method was called
> on the server.
>
> Siva
> ----- Original Message -----
> From: "Hiram Chirino" <hi...@coredevelopers.net>
> To: <ge...@incubator.apache.org>
> Sent: Saturday, August 30, 2003 7:08 AM
> Subject: Re: Failing Test Cases[Was Re: DownloadTest Failure when
> workingoffline/ behind firewall]
>
>
> > could you send me the test report .. to see if has any more detail to
> > track the problem down.
> >
> > Regards,
> > Hiram
> >
> > On Thu, 2003-08-28 at 13:59, Siva wrote:
> > > Failing test cases
> > > 1) org.apache.geronimo.naming.java.BasicContextTest - 1 Error
> > > 2) org.apache.geronimo.remoting.MarshalingInterceptorsTest - 8 Errors
> > >
> > > Hung test cases
> > > 1) org.apache.geronimo.remoting.RemotingInterceptorsTest
> > > 2) org.apache.geronimo.remoting.transport.AsyncTransportTest
> > >
> > > Siva
> > >
> > > ----- Original Message -----
> > > From: "Bodo Wippermann" <bo...@bodow.de>
> > > To: <ge...@incubator.apache.org>
> > > Sent: Thursday, August 28, 2003 10:58 PM
> > > Subject: Re: DownloadTest Failure when working offline/ behind firewall
> > >
> > >
> > > > Hi
> > > >
> > > > i didn't find out what the problem is or if it is the same problem,
> but
> > > > org.apache.geronimo.remoting.RemotingInterceptorsTest "hangs"
> > > > and
> > > > Running org.apache.geronimo.naming.java.BasicContextTest fails.
> > > >
> > > > Bodo
> > --
> > /**************************
> > * Hiram Chirino
> > * Partner
> > * Core Developers Network
> > **************************/
> >
--
/**************************
* Hiram Chirino
* Partner
* Core Developers Network
**************************/
Re: Failing Test Cases
Posted by Siva <si...@sivasundaram.com>.
I just updated my JDK from j2sdk1.4.0_01 to
j2sdk1.4.2_01 and the remoting tests run.
I guess the earlier Jdk had few bugs when close() method was called
on the server.
Siva
----- Original Message -----
From: "Hiram Chirino" <hi...@coredevelopers.net>
To: <ge...@incubator.apache.org>
Sent: Saturday, August 30, 2003 7:08 AM
Subject: Re: Failing Test Cases[Was Re: DownloadTest Failure when
workingoffline/ behind firewall]
> could you send me the test report .. to see if has any more detail to
> track the problem down.
>
> Regards,
> Hiram
>
> On Thu, 2003-08-28 at 13:59, Siva wrote:
> > Failing test cases
> > 1) org.apache.geronimo.naming.java.BasicContextTest - 1 Error
> > 2) org.apache.geronimo.remoting.MarshalingInterceptorsTest - 8 Errors
> >
> > Hung test cases
> > 1) org.apache.geronimo.remoting.RemotingInterceptorsTest
> > 2) org.apache.geronimo.remoting.transport.AsyncTransportTest
> >
> > Siva
> >
> > ----- Original Message -----
> > From: "Bodo Wippermann" <bo...@bodow.de>
> > To: <ge...@incubator.apache.org>
> > Sent: Thursday, August 28, 2003 10:58 PM
> > Subject: Re: DownloadTest Failure when working offline/ behind firewall
> >
> >
> > > Hi
> > >
> > > i didn't find out what the problem is or if it is the same problem,
but
> > > org.apache.geronimo.remoting.RemotingInterceptorsTest "hangs"
> > > and
> > > Running org.apache.geronimo.naming.java.BasicContextTest fails.
> > >
> > > Bodo
> --
> /**************************
> * Hiram Chirino
> * Partner
> * Core Developers Network
> **************************/
>
Re: Failing Test Cases[Was Re: DownloadTest Failure when working
offline/ behind firewall]
Posted by Hiram Chirino <hi...@coredevelopers.net>.
could you send me the test report .. to see if has any more detail to
track the problem down.
Regards,
Hiram
On Thu, 2003-08-28 at 13:59, Siva wrote:
> Failing test cases
> 1) org.apache.geronimo.naming.java.BasicContextTest - 1 Error
> 2) org.apache.geronimo.remoting.MarshalingInterceptorsTest - 8 Errors
>
> Hung test cases
> 1) org.apache.geronimo.remoting.RemotingInterceptorsTest
> 2) org.apache.geronimo.remoting.transport.AsyncTransportTest
>
> Siva
>
> ----- Original Message -----
> From: "Bodo Wippermann" <bo...@bodow.de>
> To: <ge...@incubator.apache.org>
> Sent: Thursday, August 28, 2003 10:58 PM
> Subject: Re: DownloadTest Failure when working offline/ behind firewall
>
>
> > Hi
> >
> > i didn't find out what the problem is or if it is the same problem, but
> > org.apache.geronimo.remoting.RemotingInterceptorsTest "hangs"
> > and
> > Running org.apache.geronimo.naming.java.BasicContextTest fails.
> >
> > Bodo
--
/**************************
* Hiram Chirino
* Partner
* Core Developers Network
**************************/
Failing Test Cases[Was Re: DownloadTest Failure when working offline/ behind firewall]
Posted by Siva <si...@sivasundaram.com>.
Failing test cases
1) org.apache.geronimo.naming.java.BasicContextTest - 1 Error
2) org.apache.geronimo.remoting.MarshalingInterceptorsTest - 8 Errors
Hung test cases
1) org.apache.geronimo.remoting.RemotingInterceptorsTest
2) org.apache.geronimo.remoting.transport.AsyncTransportTest
Siva
----- Original Message -----
From: "Bodo Wippermann" <bo...@bodow.de>
To: <ge...@incubator.apache.org>
Sent: Thursday, August 28, 2003 10:58 PM
Subject: Re: DownloadTest Failure when working offline/ behind firewall
> Hi
>
> i didn't find out what the problem is or if it is the same problem, but
> org.apache.geronimo.remoting.RemotingInterceptorsTest "hangs"
> and
> Running org.apache.geronimo.naming.java.BasicContextTest fails.
>
> Bodo
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Bodo Wippermann <bo...@bodow.de>.
Hi
i didn't find out what the problem is or if it is the same problem, but
org.apache.geronimo.remoting.RemotingInterceptorsTest "hangs"
and
Running org.apache.geronimo.naming.java.BasicContextTest fails.
Bodo
Kristian Koehler schrieb:
> Hi
>
> we have a problem when running the tests for the core module.
> The org.apache.geronimo.deployment.repository.DownloadTest fails when
> being executed offline or from behind a firewall. Since the VM can't
> establish a connection to the remote URL (http://www.ibiblio.org/maven/)
> the test fails causing the complete build to fail as well. Which means
> that currently only compilation and testing is run. Building a
> distribution requires local hacking (which is a bit annoying).
>
> Or are we missing some local configuration, especially for working offline?
>
> If not, we could image the following solutions and would provide them if
> wanted.
>
> 1. Check if a Connection to the remote host can be establihed. If not
> skip the testRemoteCopy() Test.
>
> 2. Start a tiny web server (like JWebUnit IIRC) on the local machine and
> download the file from there.
>
> 3. Is the remote HTTP test actually necessary?
>
>
> FFPX
>
> Steffen and Kristian
>
>
>
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Kristian Koehler <Kr...@gmx.de>.
Hi James
actually we had a look at the maven website before posting.
What we made of it was that using maven in offline mode only affects the
synchronization of the local jar repository with the remote one (the
test still fails in offline mode for that matter).
As far as the proxy is concerned our main issue still is building offline.
So why not fix the test to make it work independent of
online/offline/proxy settings? We think it's possible as mentioned in
our original posting. Besides we think it's a good think to reduce
dependencies to external ressources for a regular
compile-test-package-build.
IMHO the way it works right now might even scare people off.
Steffen and Kristian
James Strachan wrote:
>
> On Thursday, August 28, 2003, at 04:12 pm, Kristian Koehler wrote:
>
>> Hi
>>
>> we have a problem when running the tests for the core module.
>> The org.apache.geronimo.deployment.repository.DownloadTest fails when
>> being executed offline or from behind a firewall. Since the VM can't
>> establish a connection to the remote URL
>> (http://www.ibiblio.org/maven/) the test fails causing the complete
>> build to fail as well. Which means that currently only compilation
>> and testing is run. Building a distribution requires local hacking
>> (which is a bit annoying).
>
>
> This sounds like standard Maven stuff.
>
> Firstly you can use maven in offline mode (via the -o option or
> putting maven.mode.online=false in your build.properties (home dir or
> project dir).
>
> Also you can use Maven behind firewalls by setting the HTTP proxy
> settings (again in your build.properties file). All this is documented
> on the maven site...
>
> http://maven.apache.org/reference/user-guide.html#Using%20Proxies
>
> I'd highly recommend a surf around the Maven website - its packaged
> with useful information.
>
> James
> -------
> http://radio.weblogs.com/0112098/
>
>
Re: DownloadTest Failure when working offline/ behind firewall
Posted by James Strachan <ja...@yahoo.co.uk>.
On Friday, August 29, 2003, at 08:26 am, Alex Blewitt wrote:
> On Thursday, Aug 28, 2003, at 18:52 Europe/London, James Strachan
> wrote:
>
>> Also you can use Maven behind firewalls by setting the HTTP proxy
>> settings (again in your build.properties file). All this is
>> documented on the maven site...
>>
>> http://maven.apache.org/reference/user-guide.html#Using%20Proxies
>
> Note that in Maven terms, 'proxy' means 'http proxy'. It doesn't work
> if you are behind a (say) SOCKS firewall. It's not explicitly covered
> in the Maven documentation, so it may be worth putting in as a
> 'gotcha' in the FAQ. Thus, running tests behind a SOCKS firewall will
> always fail, since the test client checks the existence of a remote
> website to which it may have no access.
>
> I really think having a test which depends on you being online in
> order to pass is a no-no -- there's no reason why we couldn't set up a
> simple ServerSocket on a random port and the test ran against that.
Fancy submitting a patch to Maven's JIRA?
http://jira.codehaus.org/secure/BrowseProject.jspa?id=10030
James
-------
http://radio.weblogs.com/0112098/
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Alex Blewitt <Al...@ioshq.com>.
On Thursday, Aug 28, 2003, at 18:52 Europe/London, James Strachan wrote:
> Also you can use Maven behind firewalls by setting the HTTP proxy
> settings (again in your build.properties file). All this is documented
> on the maven site...
>
> http://maven.apache.org/reference/user-guide.html#Using%20Proxies
Note that in Maven terms, 'proxy' means 'http proxy'. It doesn't work
if you are behind a (say) SOCKS firewall. It's not explicitly covered
in the Maven documentation, so it may be worth putting in as a 'gotcha'
in the FAQ. Thus, running tests behind a SOCKS firewall will always
fail, since the test client checks the existence of a remote website to
which it may have no access.
I really think having a test which depends on you being online in order
to pass is a no-no -- there's no reason why we couldn't set up a simple
ServerSocket on a random port and the test ran against that.
Alex.
Re: DownloadTest Failure when working offline/ behind firewall
Posted by James Strachan <ja...@yahoo.co.uk>.
On Thursday, August 28, 2003, at 04:12 pm, Kristian Koehler wrote:
> Hi
>
> we have a problem when running the tests for the core module.
> The org.apache.geronimo.deployment.repository.DownloadTest fails when
> being executed offline or from behind a firewall. Since the VM can't
> establish a connection to the remote URL
> (http://www.ibiblio.org/maven/) the test fails causing the complete
> build to fail as well. Which means that currently only compilation and
> testing is run. Building a distribution requires local hacking (which
> is a bit annoying).
This sounds like standard Maven stuff.
Firstly you can use maven in offline mode (via the -o option or putting
maven.mode.online=false in your build.properties (home dir or project
dir).
Also you can use Maven behind firewalls by setting the HTTP proxy
settings (again in your build.properties file). All this is documented
on the maven site...
http://maven.apache.org/reference/user-guide.html#Using%20Proxies
I'd highly recommend a surf around the Maven website - its packaged
with useful information.
James
-------
http://radio.weblogs.com/0112098/
Re: DownloadTest Failure when working offline/ behind firewall
Posted by James Strachan <ja...@yahoo.co.uk>.
Another hack is to explicitly exclude certain tests by modifying your
local project.xml file to add an excludes filter to the build...
<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>
<excludes>
<exclude>**/Foo*Test.java</exclude>
</excludes>
...
On Friday, August 29, 2003, at 07:11 am, Kristian Koehler wrote:
> Hi Siva, Hi Alex
>
> of course this is a possible workaround (this is what we are doing
> right now), but on the other hand why skip all working tests just
> because one single test fails while attempting to connect via HTTP?
>
> It just doesn't seem like the right thing to do IMHO.
>
> So why not change the test to run everywhere out of the box?
>
> Steffen and Kristian
>
>
> Siva wrote:
>
>> A more easier approach which i follow is setting
>> one of the following maven properties via -D flag
>>
>> maven.test.skip=true
>> or
>> maven.test.failure.ignore
>> Siva
>>
>>
>> ----- Original Message ----- From: "Alex Blewitt"
>> <Al...@ioshq.com>
>> To: <ge...@incubator.apache.org>
>> Sent: Thursday, August 28, 2003 9:47 PM
>> Subject: Re: DownloadTest Failure when working offline/ behind
>> firewall
>>
>>
>>
>>> I really think that there should be a split between 'build' and
>>> 'test'.
>>>
>>> Whilst it may be desirable for both to occur by default, it would be
>>> incredibly useful to be able to build w/o testing. I've found that
>>> the easiest way to disable all tests is to comment the
>>> etc/project.xml file and commenting (using <!-- -->) out the
>>> unitTestDir element ...
>>>
>>> That way, you should be able to build w/o testing.
>>>
>>> Alex.
>>>
>>
>>
>>
>
>
James
-------
http://radio.weblogs.com/0112098/
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Kristian Koehler <Kr...@gmx.de>.
Hi
>>
>> I also think that it shouldn't be the default to run tests during
>> compilation/build. Tests should be something that a developer does
>> after a successful build (of the entire system), as opposed to a core
>> part of the build process.
>
>
> No - unit tests are part of the build process and they should stay there.
We defenitly agree with this but this contradicts the idea of removing
tests by applying local hacks, doesn't it?
> You could argue stuff that depends on external HTTP stuff could be
> integration tests (which could be in another module).
IMHO the respective test is not an integration test. It's just a unit
test which depends on a remote HTTP ressource.
We still think that starting a local lightweight server would solve the
offline/online problem.
Steffen and Kristian
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Jason Dillon <ja...@coredevelopers.net>.
> It looks to me that in including a remote http download in the unit
> test, we're effectively just testing the HttpURLConnection class
> (which we can probably assume is working).
>
> Does the test really lose anything by not connecting to a real or mock
> http server?
I must admit I do not really know what these tests do... :-|
> A better way to test might be to add our own URL protocol
> "geronimo-test://", for example. I guess ideally we'd like to pass in
> a mockURL class, but java.net.URL is designated final.
Sounds reasonable.
--jason
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Ben Griffiths <be...@mac.com>.
> Should probably setup a test HTTPD-ish process for the test to work
> from. Is there a lightweight component we could start up by the test
> so that we have more control over how this works?
>
> --jason
>
First post - though I've followed this strangely heated debate from the
start. Apologies if I miss the mark...
It looks to me that in including a remote http download in the unit
test, we're effectively just testing the HttpURLConnection class (which
we can probably assume is working).
Does the test really lose anything by not connecting to a real or mock
http server?
A better way to test might be to add our own URL protocol
"geronimo-test://", for example. I guess ideally we'd like to pass in a
mockURL class, but java.net.URL is designated final.
Ben
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Jason Dillon <ja...@coredevelopers.net>.
Should probably setup a test HTTPD-ish process for the test to work
from. Is there a lightweight component we could start up by the test
so that we have more control over how this works?
--jason
On Friday, August 29, 2003, at 02:59 PM, James Strachan wrote:
>
> On Friday, August 29, 2003, at 08:38 am, Alex Blewitt wrote:
>
>> On Friday, Aug 29, 2003, at 07:11 Europe/London, Kristian Koehler
>> wrote:
>>
>>> Hi Siva, Hi Alex
>>>
>>> of course this is a possible workaround (this is what we are doing
>>> right now), but on the other hand why skip all working tests just
>>> because one single test fails while attempting to connect via HTTP?
>>>
>>> It just doesn't seem like the right thing to do IMHO.
>>>
>>> So why not change the test to run everywhere out of the box?
>>
>> I also think that it shouldn't be the default to run tests during
>> compilation/build. Tests should be something that a developer does
>> after a successful build (of the entire system), as opposed to a core
>> part of the build process.
>
> No - unit tests are part of the build process and they should stay
> there.
>
> You could argue stuff that depends on external HTTP stuff could be
> integration tests (which could be in another module).
>
>
>> Either that, or a not-build-but-everything-but-tests target should be
>> created; I've not managed to find one in Maven so far (at least, one
>> that does everything bar test).
>
> I don't follow.
>
> // to compile just the code & tests
>
> maven java:compile test:compile
>
> You can disable the running of the unit tests if you wish via the
> maven.test.skip=true property which can be specified in your
> build.properties or on the command line. What more do you need?
>
> James
> -------
> http://radio.weblogs.com/0112098/
>
Re: DownloadTest Failure when working offline/ behind firewall
Posted by James Strachan <ja...@yahoo.co.uk>.
On Friday, August 29, 2003, at 11:35 am, Ben Griffiths wrote:
>> 1. Start a lightweight server locally
>> 2. Modify the test not to use HTTP Connection (as Ben also suggested)
>
> I'm quite happy to submit a patch for number 2, later on today. To my
> mind it feels the better solution as it's intrinsically making the
> code less tightly coupled.
>
> I might need some help creating a patch (not done it before) - rather
> than foul up the list, can anyone get in touch with me directly with
> some pointers?
There are some links on the website...
http://www.apache.org/~jstrachan/geronimo/
e.g. here's some info on creating patches...
http://jakarta.apache.org/site/source.html
If you use Eclipse then its a simple right click -> Team -> create
patch to make a new patch.
James
-------
http://radio.weblogs.com/0112098/
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Ben Griffiths <be...@mac.com>.
> 1. Start a lightweight server locally
> 2. Modify the test not to use HTTP Connection (as Ben also suggested)
I'm quite happy to submit a patch for number 2, later on today. To my
mind it feels the better solution as it's intrinsically making the code
less tightly coupled.
I might need some help creating a patch (not done it before) - rather
than foul up the list, can anyone get in touch with me directly with
some pointers?
Cheers,
Ben
Re: DownloadTest Failure when working offline/ behind firewall
Posted by James Strachan <ja...@yahoo.co.uk>.
On Friday, August 29, 2003, at 11:14 am, Kristian Koehler wrote:
> Hi all
>
> to clear things up a little it wasn't our intenion when starting this
> thread to turn the current build process upside down. We just felt
> that it wasn't very nice that the complete build fails when working
> offline.
>
> You wrote that you don't see a need to change the build process. We
> wholeheartedly agree it's a single test that is "misbehaving" not the
> build process. But locally changing the build process as suggested
> repeatedly isn't the right way neither AFAIC.
>
> Back to the test in question:
> We strongly feel that there are two possible solutions:
>
> 1. Start a lightweight server locally
> 2. Modify the test not to use HTTP Connection (as Ben also suggested)
>
> Both of these solutions leave the build process alone and enable
> people to work offline to leave their build process alone as well.
>
> We submit a patch for either of the solutions if desired ;-)
> (we just would like to know if it's worthwhile coding it)
Absolutely - go for it. Either of the above sounds like a good solution
to the probelm.
James
-------
http://radio.weblogs.com/0112098/
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Ben Griffiths <be...@mac.com>.
> 1. Start a lightweight server locally
> 2. Modify the test not to use HTTP Connection (as Ben also suggested)
I'm quite happy to submit a patch for number 2, later on today. To my
mind it feels the better solution as it's intrinsically making the code
less tightly coupled.
I might need some help creating a patch (not done it before) - rather
than foul up the list, can anyone get in touch with me directly with
some pointers?
Cheers,
Ben
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Kristian Koehler <Kr...@gmx.de>.
Hi all
to clear things up a little it wasn't our intenion when starting this
thread to turn the current build process upside down. We just felt that
it wasn't very nice that the complete build fails when working offline.
You wrote that you don't see a need to change the build process. We
wholeheartedly agree it's a single test that is "misbehaving" not the
build process. But locally changing the build process as suggested
repeatedly isn't the right way neither AFAIC.
Back to the test in question:
We strongly feel that there are two possible solutions:
1. Start a lightweight server locally
2. Modify the test not to use HTTP Connection (as Ben also suggested)
Both of these solutions leave the build process alone and enable people
to work offline to leave their build process alone as well.
We submit a patch for either of the solutions if desired ;-)
(we just would like to know if it's worthwhile coding it)
Steffen and Kristian
James Strachan wrote:
> There's a standard maven way to disable the running of the unit tests.
> There are many goals which depend on this (site, jar, jar:deploy, dist
> and so forth). Creating aliases for every goal in Maven to exclude
> running of the unit tests doesn't really scale & makes things messier.
>
> You're most welcome to hack your local copy of maven.xml to add
> whatever aliases you wish for things though. Or write a shell script for
>
> maven jar -Dmaven.test.skip=true
>
> and call it build-no-test or whatever you wish.
>
> I don't see a need to change Maven or our Maven build process for this.
>
>
> On Friday, August 29, 2003, at 09:24 am, Alex Blewitt wrote:
>
>> On Friday, Aug 29, 2003, at 08:59 Europe/London, James Strachan wrote:
>>
>>> No - unit tests are part of the build process and they should stay
>>> there.
>>>
>>>> Either that, or a not-build-but-everything-but-tests target should
>>>> be created; I've not managed to find one in Maven so far (at least,
>>>> one that does everything bar test).
>>>
>>>
>>> I don't follow.
>>>
>>> // to compile just the code & tests
>>> maven java:compile test:compile
>>>
>>> You can disable the running of the unit tests if you wish via the
>>> maven.test.skip=true property which can be specified in your
>>> build.properties or on the command line. What more do you need?
>>
>>
>> In my experience in using Java projects (using ant, rather than
>> maven; the latter is a bit new to me) there were separate 'build' and
>> 'test' targets. I think there is benefit in a build-and-test target,
>> but the problem is that a build is not just java:compile; dependent
>> Jars need to be created, resources copied to appropriate locations
>> and so forth.
>>
>> IMNSO the targets would be beneficial if ordered:
>>
>> build-and-test
>> +-- build-without-test
>> +-- java:compile, jar:jar etc. as is at the moment
>> +-- test
>> +-- test:compile
>> +-- test:test (or whatever the appropriate target is)
>>
>> That way, a developer could run build-and-test or build-without-test
>> as desired.
>>
>>> No - unit tests are part of the build process and they should stay
>>> there.
>>
>>
>> Certainly I believe very strongly that there should be tests, and the
>> ability to run them out-of-the-box. You could use whatever names you
>> wanted for the above targets, so 'build-and-test == build' and
>> 'build-without-tests' could have a different name.
>>
>> But having this as a separate target, as opposed to having to run
>> with setting maven properties (on command line, or in properties
>> file) would be a nicer way of doing it. You could even set up the
>> target 'build-without-test' to set the maven.test.skip and then call
>> the original build process ...
>>
>> Alex.
>>
>>
>
> James
> -------
> http://radio.weblogs.com/0112098/
>
>
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Alex Blewitt <Al...@ioshq.com>.
On Friday, Aug 29, 2003, at 13:13 Europe/London, James Strachan wrote:
> Its standard Maven procedure on all Maven projects to work like this.
> You're the first person I've heard who doesn't like it.
There's always a first :-) Sounds like the last, too ...
> Like I said - its easy to disable the running of unit tests if you
> wish - either on the command line, via build.properties or by hacking
> your own maven.xml.
Yup, done so.
>> Sure, if I am the only person who thinks that running tests every
>> time during development is annoying.
>
> I guess you've not got gotten test-infected & caught the TDD bug then.
>
> Remember you can use your IDE to edit code (e.g. eclipse) and run only
> those unit tests you wish. You don't have to use Maven every time you
> code something.
I absolutely am test-infected :-) I've got about 1/3 of the JavaMail
APIs with unit tests, and in implementing the rest I'm creating more
tests.
What I do is build the system in Eclipse, run the tests in Eclipse, and
repeatedly go back/forwards in that cycle. I don't drop down into Maven
because it's a painfully slow build/test cycle. In fact, the only time
I need it is when I want to run the system as a whole, and then it bugs
me if all the tests are run then since I know the stuff I want to test
works :-) I just don't think IMHO that the tests are a necessary part
of an ordinary developer build, though they will definitely be required
for (say) public releases.
What I have done in the past is a cycle of:
Write/Test -> in Eclipse
Run -> compile and get code working (inc. jars)
Integrate -> run unit tests
Release ->
Anyway, I wholeheartedly support testing, just not integration testing
for every compile phase.
Alex.
Re: DownloadTest Failure when working offline/ behind firewall
Posted by James Strachan <ja...@yahoo.co.uk>.
On Friday, August 29, 2003, at 12:35 pm, Alex Blewitt wrote:
> On Friday, Aug 29, 2003, at 10:51 Europe/London, James Strachan wrote:
>
>> There's a standard maven way to disable the running of the unit
>> tests. There are many goals which depend on this (site, jar,
>> jar:deploy, dist and so forth). Creating aliases for every goal in
>> Maven to exclude running of the unit tests doesn't really scale &
>> makes things messier.
>
> I question why those goals depend on tests. Surely it should be
> possible to build a Jar file that contains some code with failed
> tests; for example, if I am testing module X, and module Y has test
> errors (that I neither care about nor need) then there seems no reason
> for those to have to depend on tests.
>
> I also would like to be able to build the project, then run tests on
> the parts I am writing separately. I would therefore have to swap
> between build commands/properties for the 'main build' and 'test my
> components'.
Its standard Maven procedure on all Maven projects to work like this.
You're the first person I've heard who doesn't like it.
Like I said - its easy to disable the running of unit tests if you wish
- either on the command line, via build.properties or by hacking your
own maven.xml.
What more do you need?
>
>> You're most welcome to hack your local copy of maven.xml to add
>> whatever aliases you wish for things though. Or write a shell script
>> for
>>
>> maven jar -Dmaven.test.skip=true
>>
>> and call it build-no-test or whatever you wish.
>
> Already have done :-)
>
>> I don't see a need to change Maven or our Maven build process for
>> this.
>
> Sure, if I am the only person who thinks that running tests every time
> during development is annoying.
I guess you've not got gotten test-infected & caught the TDD bug then.
Remember you can use your IDE to edit code (e.g. eclipse) and run only
those unit tests you wish. You don't have to use Maven every time you
code something.
James
-------
http://radio.weblogs.com/0112098/
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Alex Blewitt <Al...@ioshq.com>.
On Friday, Aug 29, 2003, at 10:51 Europe/London, James Strachan wrote:
> There's a standard maven way to disable the running of the unit tests.
> There are many goals which depend on this (site, jar, jar:deploy, dist
> and so forth). Creating aliases for every goal in Maven to exclude
> running of the unit tests doesn't really scale & makes things messier.
I question why those goals depend on tests. Surely it should be
possible to build a Jar file that contains some code with failed tests;
for example, if I am testing module X, and module Y has test errors
(that I neither care about nor need) then there seems no reason for
those to have to depend on tests.
I also would like to be able to build the project, then run tests on
the parts I am writing separately. I would therefore have to swap
between build commands/properties for the 'main build' and 'test my
components'.
> You're most welcome to hack your local copy of maven.xml to add
> whatever aliases you wish for things though. Or write a shell script
> for
>
> maven jar -Dmaven.test.skip=true
>
> and call it build-no-test or whatever you wish.
Already have done :-)
> I don't see a need to change Maven or our Maven build process for this.
Sure, if I am the only person who thinks that running tests every time
during development is annoying. I usually run tests after I've finished
coding something and need to check that it works (for the particular
module(s) I'm working on); but I don't need to test a whole bunch of
code that others have written (or in some cases, are still writing).
If anyone else has got any strong opinions about test running happening
too often and would like to comment, then please do -- otherwise I'll
shut up. I've got a hack/workaround which isn't elegant, but it works
for me.
Alex.
Re: DownloadTest Failure when working offline/ behind firewall
Posted by James Strachan <ja...@yahoo.co.uk>.
There's a standard maven way to disable the running of the unit tests.
There are many goals which depend on this (site, jar, jar:deploy, dist
and so forth). Creating aliases for every goal in Maven to exclude
running of the unit tests doesn't really scale & makes things messier.
You're most welcome to hack your local copy of maven.xml to add
whatever aliases you wish for things though. Or write a shell script for
maven jar -Dmaven.test.skip=true
and call it build-no-test or whatever you wish.
I don't see a need to change Maven or our Maven build process for this.
On Friday, August 29, 2003, at 09:24 am, Alex Blewitt wrote:
> On Friday, Aug 29, 2003, at 08:59 Europe/London, James Strachan wrote:
>
>> No - unit tests are part of the build process and they should stay
>> there.
>>
>>> Either that, or a not-build-but-everything-but-tests target should
>>> be created; I've not managed to find one in Maven so far (at least,
>>> one that does everything bar test).
>>
>> I don't follow.
>>
>> // to compile just the code & tests
>> maven java:compile test:compile
>>
>> You can disable the running of the unit tests if you wish via the
>> maven.test.skip=true property which can be specified in your
>> build.properties or on the command line. What more do you need?
>
> In my experience in using Java projects (using ant, rather than maven;
> the latter is a bit new to me) there were separate 'build' and 'test'
> targets. I think there is benefit in a build-and-test target, but the
> problem is that a build is not just java:compile; dependent Jars need
> to be created, resources copied to appropriate locations and so forth.
>
> IMNSO the targets would be beneficial if ordered:
>
> build-and-test
> +-- build-without-test
> +-- java:compile, jar:jar etc. as is at the moment
> +-- test
> +-- test:compile
> +-- test:test (or whatever the appropriate target is)
>
> That way, a developer could run build-and-test or build-without-test
> as desired.
>
>> No - unit tests are part of the build process and they should stay
>> there.
>
> Certainly I believe very strongly that there should be tests, and the
> ability to run them out-of-the-box. You could use whatever names you
> wanted for the above targets, so 'build-and-test == build' and
> 'build-without-tests' could have a different name.
>
> But having this as a separate target, as opposed to having to run with
> setting maven properties (on command line, or in properties file)
> would be a nicer way of doing it. You could even set up the target
> 'build-without-test' to set the maven.test.skip and then call the
> original build process ...
>
> Alex.
>
>
James
-------
http://radio.weblogs.com/0112098/
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Alex Blewitt <Al...@ioshq.com>.
On Friday, Aug 29, 2003, at 08:59 Europe/London, James Strachan wrote:
> No - unit tests are part of the build process and they should stay
> there.
>
>> Either that, or a not-build-but-everything-but-tests target should be
>> created; I've not managed to find one in Maven so far (at least, one
>> that does everything bar test).
>
> I don't follow.
>
> // to compile just the code & tests
> maven java:compile test:compile
>
> You can disable the running of the unit tests if you wish via the
> maven.test.skip=true property which can be specified in your
> build.properties or on the command line. What more do you need?
In my experience in using Java projects (using ant, rather than maven;
the latter is a bit new to me) there were separate 'build' and 'test'
targets. I think there is benefit in a build-and-test target, but the
problem is that a build is not just java:compile; dependent Jars need
to be created, resources copied to appropriate locations and so forth.
IMNSO the targets would be beneficial if ordered:
build-and-test
+-- build-without-test
+-- java:compile, jar:jar etc. as is at the moment
+-- test
+-- test:compile
+-- test:test (or whatever the appropriate target is)
That way, a developer could run build-and-test or build-without-test as
desired.
> No - unit tests are part of the build process and they should stay
> there.
Certainly I believe very strongly that there should be tests, and the
ability to run them out-of-the-box. You could use whatever names you
wanted for the above targets, so 'build-and-test == build' and
'build-without-tests' could have a different name.
But having this as a separate target, as opposed to having to run with
setting maven properties (on command line, or in properties file) would
be a nicer way of doing it. You could even set up the target
'build-without-test' to set the maven.test.skip and then call the
original build process ...
Alex.
Re: DownloadTest Failure when working offline/ behind firewall
Posted by James Strachan <ja...@yahoo.co.uk>.
On Friday, August 29, 2003, at 08:38 am, Alex Blewitt wrote:
> On Friday, Aug 29, 2003, at 07:11 Europe/London, Kristian Koehler
> wrote:
>
>> Hi Siva, Hi Alex
>>
>> of course this is a possible workaround (this is what we are doing
>> right now), but on the other hand why skip all working tests just
>> because one single test fails while attempting to connect via HTTP?
>>
>> It just doesn't seem like the right thing to do IMHO.
>>
>> So why not change the test to run everywhere out of the box?
>
> I also think that it shouldn't be the default to run tests during
> compilation/build. Tests should be something that a developer does
> after a successful build (of the entire system), as opposed to a core
> part of the build process.
No - unit tests are part of the build process and they should stay
there.
You could argue stuff that depends on external HTTP stuff could be
integration tests (which could be in another module).
> Either that, or a not-build-but-everything-but-tests target should be
> created; I've not managed to find one in Maven so far (at least, one
> that does everything bar test).
I don't follow.
// to compile just the code & tests
maven java:compile test:compile
You can disable the running of the unit tests if you wish via the
maven.test.skip=true property which can be specified in your
build.properties or on the command line. What more do you need?
James
-------
http://radio.weblogs.com/0112098/
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Alex Blewitt <Al...@ioshq.com>.
On Friday, Aug 29, 2003, at 07:11 Europe/London, Kristian Koehler wrote:
> Hi Siva, Hi Alex
>
> of course this is a possible workaround (this is what we are doing
> right now), but on the other hand why skip all working tests just
> because one single test fails while attempting to connect via HTTP?
>
> It just doesn't seem like the right thing to do IMHO.
>
> So why not change the test to run everywhere out of the box?
I also think that it shouldn't be the default to run tests during
compilation/build. Tests should be something that a developer does
after a successful build (of the entire system), as opposed to a core
part of the build process.
Either that, or a not-build-but-everything-but-tests target should be
created; I've not managed to find one in Maven so far (at least, one
that does everything bar test).
Alex.
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Kristian Koehler <Kr...@gmx.de>.
Hi Siva, Hi Alex
of course this is a possible workaround (this is what we are doing right
now), but on the other hand why skip all working tests just because one
single test fails while attempting to connect via HTTP?
It just doesn't seem like the right thing to do IMHO.
So why not change the test to run everywhere out of the box?
Steffen and Kristian
Siva wrote:
>A more easier approach which i follow is setting
>one of the following maven properties via -D flag
>
>maven.test.skip=true
>or
>maven.test.failure.ignore
>
>Siva
>
>
>----- Original Message -----
>From: "Alex Blewitt" <Al...@ioshq.com>
>To: <ge...@incubator.apache.org>
>Sent: Thursday, August 28, 2003 9:47 PM
>Subject: Re: DownloadTest Failure when working offline/ behind firewall
>
>
>
>
>>I really think that there should be a split between 'build' and 'test'.
>>
>>Whilst it may be desirable for both to occur by default, it would be
>>incredibly useful to be able to build w/o testing. I've found that the
>>easiest way to disable all tests is to comment the etc/project.xml file
>>and commenting (using <!-- -->) out the unitTestDir element ...
>>
>>That way, you should be able to build w/o testing.
>>
>>Alex.
>>
>>
>
>
>
>
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Siva <si...@sivasundaram.com>.
A more easier approach which i follow is setting
one of the following maven properties via -D flag
maven.test.skip=true
or
maven.test.failure.ignore
Siva
----- Original Message -----
From: "Alex Blewitt" <Al...@ioshq.com>
To: <ge...@incubator.apache.org>
Sent: Thursday, August 28, 2003 9:47 PM
Subject: Re: DownloadTest Failure when working offline/ behind firewall
> I really think that there should be a split between 'build' and 'test'.
>
> Whilst it may be desirable for both to occur by default, it would be
> incredibly useful to be able to build w/o testing. I've found that the
> easiest way to disable all tests is to comment the etc/project.xml file
> and commenting (using <!-- -->) out the unitTestDir element ...
>
> That way, you should be able to build w/o testing.
>
> Alex.
Re: DownloadTest Failure when working offline/ behind firewall
Posted by Alex Blewitt <Al...@ioshq.com>.
I really think that there should be a split between 'build' and 'test'.
Whilst it may be desirable for both to occur by default, it would be
incredibly useful to be able to build w/o testing. I've found that the
easiest way to disable all tests is to comment the etc/project.xml file
and commenting (using <!-- -->) out the unitTestDir element ...
That way, you should be able to build w/o testing.
Alex.
On Thursday, Aug 28, 2003, at 16:12 Europe/London, Kristian Koehler
wrote:
> Hi
>
> we have a problem when running the tests for the core module.
> The org.apache.geronimo.deployment.repository.DownloadTest fails when
> being executed offline or from behind a firewall. Since the VM can't
> establish a connection to the remote URL
> (http://www.ibiblio.org/maven/) the test fails causing the complete
> build to fail as well. Which means that currently only compilation and
> testing is run. Building a distribution requires local hacking (which
> is a bit annoying).
>
> Or are we missing some local configuration, especially for working
> offline?
>
> If not, we could image the following solutions and would provide them
> if wanted.
>
> 1. Check if a Connection to the remote host can be establihed. If
> not skip the testRemoteCopy() Test.
>
> 2. Start a tiny web server (like JWebUnit IIRC) on the local machine
> and download the file from there.
>
> 3. Is the remote HTTP test actually necessary?
>
>
> FFPX
>
> Steffen and Kristian
>
>