< prev index next >

test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java

Print this page




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @build ModuleSetAccessibleTest
  27  * @modules java.base/java.lang:open
  28  *          java.base/jdk.internal.misc:+open
  29  * @run testng ModuleSetAccessibleTest
  30  * @summary Test java.lang.reflect.AccessibleObject with modules
  31  */
  32 
  33 import java.lang.module.ModuleDescriptor;
  34 import java.lang.reflect.AccessibleObject;
  35 import java.lang.reflect.Constructor;
  36 import java.lang.reflect.Field;
  37 import java.lang.reflect.InaccessibleObjectException;
  38 import java.lang.reflect.InvocationTargetException;
  39 import java.lang.reflect.Method;
  40 import java.lang.reflect.Module;
  41 
  42 import jdk.internal.misc.Unsafe;
  43 
  44 import org.testng.annotations.Test;
  45 import static org.testng.Assert.*;
  46 
  47 @Test
  48 public class ModuleSetAccessibleTest {
  49 
  50     /**
  51      * Invoke a private constructor on a public class in an exported package
  52      */
  53     public void testPrivateConstructorInExportedPackage() throws Exception {




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @build ModuleSetAccessibleTest
  27  * @modules java.base/java.lang:open
  28  *          java.base/jdk.internal.misc:+open
  29  * @run testng ModuleSetAccessibleTest
  30  * @summary Test java.lang.reflect.AccessibleObject with modules
  31  */
  32 

  33 import java.lang.reflect.AccessibleObject;
  34 import java.lang.reflect.Constructor;
  35 import java.lang.reflect.Field;
  36 import java.lang.reflect.InaccessibleObjectException;
  37 import java.lang.reflect.InvocationTargetException;
  38 import java.lang.reflect.Method;
  39 import java.lang.reflect.Module;
  40 
  41 import jdk.internal.misc.Unsafe;
  42 
  43 import org.testng.annotations.Test;
  44 import static org.testng.Assert.*;
  45 
  46 @Test
  47 public class ModuleSetAccessibleTest {
  48 
  49     /**
  50      * Invoke a private constructor on a public class in an exported package
  51      */
  52     public void testPrivateConstructorInExportedPackage() throws Exception {


< prev index next >