From 0a45ed3b0fd3abe0cfa956e6556268aef150e5af Mon Sep 17 00:00:00 2001 From: Sergei Kovalev Date: Mon, 21 Nov 2016 19:18:22 +0300 Subject: [PATCH] 8169721: [TESTBUG] com/sun/jndi tests have undeclared dependency on java.naming module Reviewed-by: rriggs, dfuchs --- jdk/test/com/sun/jndi/dns/CheckAccess.java | 6 ++++-- jdk/test/com/sun/jndi/dns/Test6991580.java | 7 ++++--- jdk/test/com/sun/jndi/ldap/TEST.properties | 1 + .../rmi/registry/RegistryContext/UnbindIdempotent.java | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 jdk/test/com/sun/jndi/ldap/TEST.properties diff --git a/jdk/test/com/sun/jndi/dns/CheckAccess.java b/jdk/test/com/sun/jndi/dns/CheckAccess.java index 265d99e8ea5..723ee28a983 100644 --- a/jdk/test/com/sun/jndi/dns/CheckAccess.java +++ b/jdk/test/com/sun/jndi/dns/CheckAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,11 +24,13 @@ /* * @test * @bug 6657619 + * @modules jdk.naming.dns * @summary DnsContext.debug is public static mutable (findbugs) * @author Vincent Ryan */ -import java.lang.reflect.*; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; /* * Check that the 'debug' class member is no longer publicly accessible. diff --git a/jdk/test/com/sun/jndi/dns/Test6991580.java b/jdk/test/com/sun/jndi/dns/Test6991580.java index b06f78a23de..b8763bbbd0b 100644 --- a/jdk/test/com/sun/jndi/dns/Test6991580.java +++ b/jdk/test/com/sun/jndi/dns/Test6991580.java @@ -30,13 +30,14 @@ import java.awt.TextArea; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -/** +/* * @test * @bug 6991580 8080108 8133035 * @requires os.family != "windows" * @summary IPv6 Nameservers in resolv.conf throws NumberFormatException - * @modules jdk.naming.dns/com.sun.jndi.dns - * @build IPv6NameserverPlatformParsingTest + * @modules java.desktop + * jdk.naming.dns/com.sun.jndi.dns + * @compile --add-modules jdk.naming.dns IPv6NameserverPlatformParsingTest.java * @run main/manual Test6991580 */ diff --git a/jdk/test/com/sun/jndi/ldap/TEST.properties b/jdk/test/com/sun/jndi/ldap/TEST.properties new file mode 100644 index 00000000000..88ac1ce7ea8 --- /dev/null +++ b/jdk/test/com/sun/jndi/ldap/TEST.properties @@ -0,0 +1 @@ +modules = java.naming diff --git a/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java b/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java index 5709c2b5ca8..74f57678ac8 100644 --- a/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java +++ b/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ * successfully. * @modules java.rmi/sun.rmi.registry java.rmi/sun.rmi.server * java.rmi/sun.rmi.transport java.rmi/sun.rmi.transport.tcp + * jdk.naming.rmi * @library ../../../../../../java/rmi/testlibrary * @build TestLibrary * @run main UnbindIdempotent @@ -49,8 +50,10 @@ public class UnbindIdempotent { try { rctx = (Context)ictx.lookup("rmi://localhost:" + Integer.toString(registryPort)); + System.out.println("Got context: " + rctx.getClass()); } catch (NamingException e) { // Unable to set up for test. + System.err.println("WARNING: The test skipped due to NamingException: " + e); return; }