RFR: 6875: Add agent MXBean operation to return instrumented xml configuration [v2]

Jessye Coleman-Shapiro jescolem at openjdk.java.net
Tue Aug 18 18:51:07 UTC 2020


On Tue, 18 Aug 2020 17:19:37 GMT, Marcus Hirt <hirt at openjdk.org> wrote:

> I think it would be nice with a few tests showing the failure modes, and some javadocs around what to expect from the
> API (especially in terms of failure modes / exceptions), for example setting invalid XML, setting invalid XML and then
> attempting reading it back and so on.

Currently, an XML configuration is only stored if it can be successfully instrumented.  If a new configuration cannot
be instrumented, the current configuration that has already been successfully applied is not overwritten.

I have added a test `TestDefaultTransformRegistry.testModifyInvalidXml` that makes sure that an invalid configuration
is not instrumented or stored. I have added the test within this file as `DefaultTransformRegistry.modify` is where a
new XML configuration is stored if it has no errors.

In my initial commit I added a general test for `AgentControllerMXBean.retrieveCurrentTransforms` that covers the case
when a XML configuration is successfully applied.

Let me know if these tests cover the failure modes properly!

I have also added a javadoc for the `AgentControllerMXBean.retrieveCurrentTransforms` operation - hopefully its
functionality is more clear now.

-------------

PR: https://git.openjdk.java.net/jmc/pull/99


More information about the jmc-dev mailing list