| ThreadInfo objects can only be obtained from the ThreadMXBean or else by
calling the static from() method with an existing CompositeData object that
maps to a ThreadInfo. Trying to unit test using the former approach only gets
us so far as we have no idea what the expected values should be. We only know
their types, ranges etc etc. This testcase goes the long way round by
creating a CompositeData representing a ThreadInfo with well understood
values that we can test for once we have passed the CompositeData into the
from() method to get a ThreadInfo.
The "problem" with this approach is that the hand-rolled CompositeData
created in this testcase is not liked by the RI which has its own internal
way of validating CompositeData and CompositeType instances. So, while this
test case is creating CompositeData and CompositeType objects which adhere to
the spec, the below tests will all fail when run against the RI. For that
reason, this testcase cannot be considered as implementation independent.
|