Add integration test for JMX#2066
Conversation
There was a problem hiding this comment.
Had to regenerate keystore.jks to add CN=localhost
|
FYI, some time ago I had a similar task, basically programatic JMX access via SSL. Here are my observations: https://github.com/mtrail/jmx-over-ssl/ |
| public class JmxTest { | ||
|
|
||
| public static TestSuite suite() { | ||
| if (JavaVersion.current().isBefore("19") |
There was a problem hiding this comment.
The logic is inverse to SecurityManagerTest where is if block is the actual test. I have no preference here except consistency.
There was a problem hiding this comment.
Condition here is IMO already hard to read, explanatory comment for condition after body of if statement will look even more unreadable and weird, so I'd rather invert if in SecurityManagerTest which IMO will also improve its readability - #2075, and speaking of consistency this will be more consistent with other places where we skip tests - see for example
jacoco/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java
Lines 319 to 325 in 0bb0906
Actually, I should have suggested this back in #1780 😅
There was a problem hiding this comment.
Showing the test as skipped using a AssumptionViolatedException would definitely my preference. Looks like this is not possible within the suite() method.
There was a problem hiding this comment.
Showing the test as skipped using a AssumptionViolatedException would definitely my preference. Looks like this is not possible within the suite() method.
Unfortunately yes, and this was already noted in past - #1780 (comment)
In #2075 (comment) you proposed AntUnitSuiteFactory.skip shorthand for the empty AntUnitSuite for such cases, and imo #2075 ready to be merged 😉
| public class JmxTarget { | ||
|
|
||
| public static void main(String[] args) throws Exception { | ||
| final JMXServiceURL url = new JMXServiceURL( |
There was a problem hiding this comment.
Maybe a short note that we connect to our own process here?
Co-authored-by: Marc R. Hoffmann <hoffmann@mountainminds.com>
While working on #2052 (comment) I realized that we don't have integration test that will demonstrate behavior of agent when user is affected by https://bugs.openjdk.org/browse/JDK-8287073 And so decided to create one.
During creation of this test also learned how to configure secure JMX connection with SSL and password. So it also can be used to help answer questions such as https://groups.google.com/g/jacoco/c/ilZmw3LcT4E/m/Qojf4m4dBgAJ