< prev index next >

test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java

Print this page
rev 51881 : [mq]: 8211171


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  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  * @bug 8151486
  27  * @summary Call Class.forName() on the system classloader from a class loaded
  28  *          from a custom classloader, using the current class's protection domain.
  29  * @library /test/jdk/lib/testlibrary
  30  * @library /test/lib
  31  * @build jdk.test.lib.Utils JarUtils
  32  * @build ClassForName ProtectionDomainCacheTest
  33  * @run main/othervm/policy=test.policy -XX:+UnlockDiagnosticVMOptions -XX:VerifySubSet=dictionary -XX:+VerifyAfterGC -Xlog:gc+verify=debug,protectiondomain=trace,class+unload:gc.log -Djava.security.manager ProtectionDomainCacheTest
  34  */
  35 
  36 import java.net.URL;
  37 import java.net.URLClassLoader;
  38 import java.nio.file.FileSystems;
  39 import java.nio.file.Files;
  40 import java.nio.file.Path;
  41 import java.nio.file.Paths;
  42 import java.util.List;
  43 import jdk.test.lib.Utils;
  44 
  45 /*
  46  * Create .jar, load ClassForName from .jar using a URLClassLoader
  47  */
  48 public class ProtectionDomainCacheTest {
  49     private static final long TIMEOUT = (long)(5000.0 * Utils.TIMEOUT_FACTOR);




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  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  * @bug 8151486
  27  * @summary Call Class.forName() on the system classloader from a class loaded
  28  *          from a custom classloader, using the current class's protection domain.

  29  * @library /test/lib
  30  * @build jdk.test.lib.Utils JarUtils
  31  * @build ClassForName ProtectionDomainCacheTest
  32  * @run main/othervm/policy=test.policy -XX:+UnlockDiagnosticVMOptions -XX:VerifySubSet=dictionary -XX:+VerifyAfterGC -Xlog:gc+verify=debug,protectiondomain=trace,class+unload:gc.log -Djava.security.manager ProtectionDomainCacheTest
  33  */
  34 
  35 import java.net.URL;
  36 import java.net.URLClassLoader;
  37 import java.nio.file.FileSystems;
  38 import java.nio.file.Files;
  39 import java.nio.file.Path;
  40 import java.nio.file.Paths;
  41 import java.util.List;
  42 import jdk.test.lib.Utils;
  43 
  44 /*
  45  * Create .jar, load ClassForName from .jar using a URLClassLoader
  46  */
  47 public class ProtectionDomainCacheTest {
  48     private static final long TIMEOUT = (long)(5000.0 * Utils.TIMEOUT_FACTOR);


< prev index next >