RFR: 8244133: Refactor nsk/jdi tests to reduce code duplication in settingBreakpoint communication

Leonid Mesnik leonid.mesnik at oracle.com
Wed Apr 29 23:45:58 UTC 2020


Hi

Could you please review following fix which remove code duplication by moving methods BreakpointRequest settingBreakpoint, getEventSet, breakpointForCommunication and log1,2,3 in base class.

The fix is huge but pretty straight forward, I tried to keep changes as small as possible so most tests just changed to extends JDIBase and corresponding methods and fields were deleted. 

Some tests used slightly different 'breakpointForCommunication()' implementation so they override it now. 

Some tests contain change like this:
-                     eventRequest1 = eventRManager.createBreakpointRequest(location);
+                     eventRequest1 = eventRManager.createBreakpointRequest(breakpLocation);
it is because they had 'location' and not 'breakpLocation' which is set by settingBreakpoint(...). So just merged location and breakpLocation.

All tests passed, so the main goal is to ensure that changes don't introduce false positive results ignoring exit codes and statuses.

I quickly verified that updated files don't contain declarations of variable like PASSED, testExitCode and other.

The JDIBase and all tests could be improved, also there are still a lot of tests which could use it as a base as well as other base classes for idi debuggers. However I  want to keep this fix as simple as possible.

werbev: http://cr.openjdk.java.net/~lmesnik/8244133/webrev.00/ <http://cr.openjdk.java.net/~lmesnik/8244133/webrev.00/>
bug: https://bugs.openjdk.java.net/browse/JDK-8244133 <https://bugs.openjdk.java.net/browse/JDK-8244133>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20200429/58c22a7a/attachment.htm>


More information about the serviceability-dev mailing list