"Doron Cohen" <[EMAIL PROTECTED]> wrote:
> 
> While testing LUCENE-866 I realized that Java assertions
> are disabled when *I* run 'ant test'.

I noticed this too; in my patch on LUCENE-843 I've turned
on assertions for all unit tests (I'm using alot of asserts
in that patch) as well.

> Others did have the assertion executed and causing that
> NPE. So I am not sure if this is general problem or only
> a Windows one.
> 
> Compile wise we are ok, having "-source 1.4".
> At runtime, assertions can be enabled by running "java -ea".
> Using ant, setting "ANT_ARGS=-ea" is supposed to have the
> same effect, but it doesn't, at least not for me.
> 
> Adding:
>      <assertions>
>          <enable/>
>      </assertions>
> to the <junit> task would enable assertions during tests
> regardless of ANT_OPTS variable (and hopefully on all OSs).

I had added <jvmarg value="-ea"/> under the <junit> tast and
it also seems to work, but I like your solution better (it's
clearer).

> Anyone sees a problem with adding this?
> 
> Btw, I think we can/should use Java asserts more (there are
> currently only 4 active asserts under trunk/java).

I agree!  The asserts have been very helpful in my debugging
in LUCENE-843.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to