-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0, 1.4.1, 1.4.2, 5.0
-
tiger
-
generic, sparc
-
generic, solaris_7
-
Verified
Name: dkR10014 Date: 11/26/2002
------------------------------------------------------------------------------
Test : nsk/jdi/ClassLoaderReference/definedClasses/definedclasses005
Test Base : testbase_nsk
VM : Server, Client
Mode : comp, int, mixed
Platform (s) : solx86, linux, solsparc, win
OS : 5.8, RH7.2, NT/2000
JDK : 1.4.1-FCS, 1.4.2-b07
------------------------------------------------------------------------------
The test verifies that an implementation of the
com.sun.jdi.ClassLoaderReference.definedClasses method conforms
with its spec:
...
The returned list will include reference types loaded at least to the
point of preparation and types (like array) for which preparation is
not defined.
The test consists of:
debugger application - definedclasses005,
debuggee application - definedclasses005a,
custom-loaded class in the debuggee - definedclasses005b.
The 'definedclasses005b' class is loaded in debuggee by user-defined
'definedclasses005aClassLoader' loader until a preparation point.
In order avoid a preparation of loaded class the user-defined loader
exports overriden findClass method of ClassLoader class. This overrided
method calls original defineClass method to return Class instance to
a caller. The returned Class instance is saved as value of Class type
'loadedClass' field of debuggee class. There are no any actions with this
field in the debuggee which might provoke a preparation of 'definedclasses005b'
class.
The debugger performs the following actions:
- gets Field mirror of debuggee's 'loadedClass' field,
- casts to ClassObjectReference the Value mirror of the Field,
- gets ReferenceType of the ClassObjectReference using reflectedType method,
- calls isPrepared method to show whether the ReferenceType is prepared,
- gets ClassLoaderReference of user-defined class loader,
- checks whether an items of the list returned by definedClasses method
are prepared.
The test fails if reference for non-prepared 'definedclasses005b' class is found in
list returned by definedClasses() method.
Test error diagnostics:
debugee> debugee's <ready> signal received.
debugger > isPrepared() returned false for class
nsk.jdi.ClassLoaderReference.definedClasses.definedclasses005b (loaded by instance of
nsk.jdi.ClassLoaderReference.definedClasses.definedclasses005aClassLoader(id=181))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^
debugger > Getting ClassLoaderReference of ReferenceType: class
nsk.jdi.ClassLoaderReference.definedClasses.definedclasses005b (loaded by instance of
nsk.jdi.ClassLoaderReference.definedClasses.definedclasses005aClassLoader(id=181))
debugger > Getting definedClasses list.
debugger > Checking returned list...
# ERROR: debugger FAILURE > Not-prepared ReferenceType : class
nsk.jdi.ClassLoaderReference.definedClasses.definedclasses005b (loaded by instance of
nsk.jdi.ClassLoaderReference.definedClasses.definedclasses005aClassLoader(id=181))
# ERROR: is found in definedClasses() list of
nsk.jdi.ClassLoaderReference.definedClasses.fields002aClassLoader mirror.
debugee> expected Debugee's exit status - 95
The test is available in release r18 of the testbase_nsk.
Steps to reproduce
==================
1. cd /net/sqesvr.sfbay/export/vsn/GammaBase/Bugs/<BugID>
2. sh doit.sh $JAVA_HOME [DEBUGEE_VM_OPTIONS]
where JAVA_HOME path to Java SDK,
DEBUGEE_VM_OPTIONS optional parameter for debugged VM options.
If you want to run debuggee with java_g command, please edit '-debugee.vmkind' option
in the line #47 of doit.sh script.
======================================================================