RFR: JDK-8295756 Improve NonLocalRegistry Manual Test Process [v3]

Mahendra Chhipa mchhipa at openjdk.org
Fri Nov 4 15:21:10 UTC 2022


On Thu, 27 Oct 2022 19:08:06 GMT, Bill Huang <bhuang at openjdk.org> wrote:

>> The current non local registry tests require a manual process that runs rmiregitrty on a different machine and changes the -Dregistry.host property in the source before running the tests on the local machine. This task is created to improve this manual process and provide a clearer instruction to the test engineer about the test requirement. 
>> 
>> Tests include: 
>> java/rmi/registry/nonLocalRegistry/NonLocalSkeletonTest.java 
>> java/rmi/registry/nonLocalRegistry/NonLocalRegistryTest.java 
>> javax/management/remote/nonLocalAccess/NonLocalJMXRemoteTest.java
>
> Bill Huang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reverted exclusion of nonlocal registry tests.

test/jdk/java/rmi/registry/nonLocalRegistry/NonLocalRegistryBase.java line 31:

> 29:     static final String instructions =
> 30:             "This is a manual test that requires rmiregistry run on a different host"
> 31:                     + ". Login or ssh to a different host, install the latest JDK "

replace "latest JDK" with "JDK under test"

test/jdk/java/rmi/registry/nonLocalRegistry/NonLocalRegistryTest.java line 55:

> 53:  * property -Dregistry.host set to the hostname or IP address of the different host.
> 54:  */
> 55: public class NonLocalRegistryTest extends NonLocalRegistryBase {

Move  private static void assertIsAccessException(Throwable ex) method to NonLocalRegistryBase class.

test/jdk/java/rmi/registry/nonLocalRegistry/NonLocalSkeletonTest.java line 81:

> 79:  * with the hostname or IP address of the different host and run the test with jtreg.
> 80:  */
> 81: public class NonLocalSkeletonTest extends NonLocalRegistryBase {

Move  private static void assertIsAccessException(Throwable ex)  method to NonLocalRegistryBase class.

test/jdk/javax/management/remote/nonLocalAccess/NonLocalJMXRemoteTest.java line 222:

> 220:             System.out.printf("Found expected AccessException: %s%n%n", t);
> 221:         } else {
> 222:             throw new RuntimeException("AccessException did not occur when expected", ex);

private static void assertIsAccessException(Throwable ex) is define in all these three test classes, move this method in lib/jdk/test/lib

test/jdk/javax/management/remote/nonLocalAccess/NonLocalJMXRemoteTest.java line 226:

> 224:     }
> 225: 
> 226:     private String readHostInput(int index) {

Duplicate code, this code is also in NonLocalRegistryBase.java, Please move this code in a common class under lib/jdk/test/lib. Or move this NonLocalRegistryBase.java under lib/jdk/test/lib and provide some generic name.

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

PR: https://git.openjdk.org/jdk/pull/10825


More information about the core-libs-dev mailing list