RFR: 7455: Add support for jolokia JMX service connection [v16]
Martin Skarsaune
duke at openjdk.org
Fri Jun 14 11:55:21 UTC 2024
On Fri, 14 Jun 2024 08:40:05 GMT, Martin Skarsaune <duke at openjdk.org> wrote:
>> application/tests/org.openjdk.jmc.jolokia.test/src/test/java/org/openjdk/jmc/jolokia/JolokiaTest.java line 105:
>>
>>> 103: public void testExecuteOperation() throws InstanceNotFoundException, MalformedObjectNameException, MBeanException,
>>> 104: ReflectionException, MalformedURLException, IOException {
>>> 105: jolokiaConnection.invoke(new ObjectName("java.lang:type=Memory"), "gc", new Object[0], new String[0]);
>>
>> Is there an assertion that could be made on the object returned from `invoke`? Or is the idea that in the case where an invoke isn't possible it will throw one of those exceptions and get caught to fail the test?
>
> GC is void, so it is not the greatest to assert on. Basically this ensures that _any_ invocation works. I can see if the method to return JFR recordings is a candidate, as it involves some special handling.
I have clicked my way through the operations that I find in a plain JVM, looking for something that was without side effects or innocent, combined with return something that makes sense to assert. However I did not find any good candidates. I think this part will be easiest tested the way it is. We verify that GC goes back and forth and is correctly mapped back and forth (ie. nothing blows up ....)
-------------
PR Review Comment: https://git.openjdk.org/jmc/pull/548#discussion_r1639709481
More information about the jmc-dev
mailing list