harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Shimansky <gshiman...@gmail.com>
Subject Re: [classlib][instrument]Using Support_Exec framework(was Re: [classlib][Instrument] Documents for non-unit-tests)
Date Wed, 16 Aug 2006 18:47:52 GMT
On Wednesday 16 August 2006 16:13 Anton Luht wrote:
> > For example, how you will test that VM is aborted during start-up with
> > NoClassDefFoundError (not with IllegalArgumentException or any other
> > exception) if it is impossible to load requested class?
> I think it should be done using some VM tests - maybe using JVMTI.
> Parsing output sounds too weak for me - anything that prints
> "NoClassDefFoundError args[0]" will do.
> This is too complicated though and I agree that parsing error output
> will work in most cases.

I've lost the beginning of the discussion so I've considered a limited number 
of the emails sent today only. If I understood correctly you want to test a 
correct exception for a child VM process and consider using JVMTI as the 
testing solution for such exception.

I want to point out that JVMTI spec is quite vague in the description of VM 
startup events sequence, the only guaranteed sequence statement can be found 
in [1]. The LIVE phase should begin after the main thread has been started. 
It says nothing about ClassLoad event for main application class, it may be 
loaded before the main thread is created, therefore before LIVE phase.

The Exception event can and should occur only in LIVE phase, that is after 
VMInit event has been sent. VM can fail and never send the VMInit event if it 
can't find main application class or some class like the one supplied 
via -javaagent option before LIVE phase has begun.

So I think this testing approach may fail if it relies on unspecified VM 

[1] http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#VMInit

Gregory Shimansky, Intel Middleware Products Division

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

View raw message