8169721: [TESTBUG] com/sun/jndi tests have undeclared dependency on java.naming module
authorskovalev
Mon, 21 Nov 2016 19:18:22 +0300
changeset 42176 9a0a4a8798aa
parent 42175 f188c9c9f2de
child 42177 01491f2b7124
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
jdk/test/com/sun/jndi/dns/Test6991580.java
jdk/test/com/sun/jndi/ldap/TEST.properties
jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java
--- a/jdk/test/com/sun/jndi/dns/CheckAccess.java	Mon Nov 21 07:54:42 2016 -0800
+++ b/jdk/test/com/sun/jndi/dns/CheckAccess.java	Mon Nov 21 19:18:22 2016 +0300
@@ -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.
--- a/jdk/test/com/sun/jndi/dns/Test6991580.java	Mon Nov 21 07:54:42 2016 -0800
+++ b/jdk/test/com/sun/jndi/dns/Test6991580.java	Mon Nov 21 19:18:22 2016 +0300
@@ -30,13 +30,14 @@
 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
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/jndi/ldap/TEST.properties	Mon Nov 21 19:18:22 2016 +0300
@@ -0,0 +1,1 @@
+modules = java.naming
--- a/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java	Mon Nov 21 07:54:42 2016 -0800
+++ b/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java	Mon Nov 21 19:18:22 2016 +0300
@@ -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 @@
 
         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;
         }