# HG changeset patch # User mseledtsov # Date 1526514191 25200 # Node ID d2d6bc39ea88bcc08ce198c0e692ff17cc0ab66b # Parent b5023063346d162175b6e1b371b61081b3586717 8199252: [TESTBUG] Open source VM testbase system dictionary tests Summary: Opensourced the tests Reviewed-by: iignatyev, gziemski diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/TEST.groups --- a/test/hotspot/jtreg/TEST.groups Tue May 15 14:49:10 2018 -0700 +++ b/test/hotspot/jtreg/TEST.groups Wed May 16 16:43:11 2018 -0700 @@ -592,6 +592,13 @@ vmTestbase_nsk_jdi = \ vmTestbase/nsk/jdi + +# Stress tests for classes loading/unloading +# NSK tests for functionality of the HS system dictionary +vmTestbase_nsk_sysdict = \ + vmTestbase/nsk/sysdict/vm/stress + + vmTestbase_nsk_jdi_quick = \ vmTestbase/nsk/jdi/Argument/description/description001/TestDescription.java \ vmTestbase/nsk/jdi/Argument/isValid/isvalid001/TestDescription.java \ diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeGen.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeGen.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2002, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.sysdict.share; + +import java.io.*; + +/** + * This tools generates a binary tree of classes. + * For more details, use: + *
+ *     java BTreeGen -help
+ * 
+ */ +public class BTreeGen { + private static final int HEIGHT = 12; // default tree height + private static final int WEIGHT = 200; // as many longs in each node + + private static void explain(Object x) { + System.err.println("# " + x); + } + + public static void main(String args[]) { + if (args.length < 1 || args[0].toLowerCase().startsWith("-h")) { + explain("This tools generates a binary tree of classes:"); + explain(""); + explain(" BTree0"); + explain(" / \\"); + explain(" BTree0L BTree0R"); + explain(" / \\ / \\"); + explain(" ... ... ... ..."); + explain(""); + explain("Use:"); + explain(" java BTreeGen { $HEIGHT [ $WEIGHT ] | \"default\" }"); + explain(""); + explain("Generates:"); + explain(" BTree.java class having HEIGHT constant."); + explain(" BTree0.java defining a classes tree."); + explain(""); + explain("Here:"); + explain(" HEIGHT and WEIGHT must be positive integers."); + explain(" Default HEIGHT is " + HEIGHT + " (" + + ((1< 1) + weight = Integer.parseInt(args[1]); + }; + try { + doit(height, weight); + } catch (IOException exception) { + exception.printStackTrace(System.err); + System.exit(1); + } + } + + private static void doit(int height, int weight) + throws FileNotFoundException + { + // Constant definition: + PrintStream info; + info = new PrintStream(new FileOutputStream(new File("BTreeInfo.java"))); + info.println("// This file is generated by: BTreeGen.java"); + info.println("package nsk.sysdict.share;"); + info.println("import nsk.share.*;"); + info.println("public class BTreeInfo {"); + info.println(" public static final int HEIGHT = " + height + ";"); + info.println(" private static final int WEIGHT = " + weight + ";"); + info.println(" public static final String rootName = \"BTree0\";"); + info.println(" public static final Denotation nodesDenotation"); + info.println(" = new TreeNodesDenotation(\"LR\");"); + info.println("}"); + info.close(); + // Generate ta classes tree: + PrintStream btree; + btree = new PrintStream(new FileOutputStream(new File("BTree.java"))); + btree.println("// This file is generated by: BTreeGen.java"); + btree.println("package nsk.sysdict.share;"); + new BTreeGen(btree).generate(height,weight); + btree.close(); + } + + private PrintStream stream; + private BTreeGen(PrintStream stream) { + this.stream = stream; + } + private void println(String s) { + stream.println(s); + } + + private void generate(int height, int weight) { + if (height < 1) + throw new IllegalArgumentException("bad height: " + height); + if (weight < 1) + throw new IllegalArgumentException("bad weight: " + weight); + String basename = "BTree0"; + genClass(null,basename,weight); + gen(basename,height,weight); + } + + private void gen(String name, int height, int weight) { + if (height == 1) + return; + String nameL = name + "L"; + String nameR = name + "R"; + genClass(name, nameL, weight); + genClass(name, nameR, weight); + gen(nameL, height-1, weight); + gen(nameR, height-1, weight); + } + + private void genClass(String baseName, String className, int weight) { + println("class " + className + + (baseName!=null? " extends " + baseName: "") + " {"); + for (int w=1; w<=weight; w++) + println(" static long fill_" + className + "_" + w + ";"); + println("}"); + } +} diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeTest.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2010, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.sysdict.share; + +import nsk.share.Denotation; +import nsk.share.Failure; +import nsk.share.TestFailure; +import nsk.share.sysdict.ClassLoadersBTree; +import nsk.share.test.Tests; + +/** + * This class is used by btree tests. + */ +public class BTreeTest extends SysDictTest { + + public BTreeTest(String[] args) { + parseArgs(args); + } + + public static void main(String args[]) { + Tests.runTest(new BTreeTest(args), args); + } + private int height; + protected int level; + String[] nodeNames; + String[] classNames; + + @Override + protected void parseArgs(String args[]) { + super.parseArgs(args); + for (int i = 0; i < args.length; i++) { + if (args[i].equals("-level")) { + level = Integer.parseInt(args[i + 1]); + } + if (args[i].equals("-height")) { + height = Integer.parseInt(args[i + 1]); + } + } + try { + // Load FatsInfo with URLClassLoader btree.jar & fats.jar should not + // present in classpath + Class info; + if (useFats) { + info = createJarLoader().loadClass(PACKAGE_PREFIX + "FatsInfo"); + } else { + info = createJarLoader().loadClass(PACKAGE_PREFIX + "BTreeInfo"); + } + + if (height == 0) { + height = info.getField("HEIGHT").getInt(null) - 1; + } + + if (level == 0) { + level = height - 1; + } + + if (level >= height) { + throw new Failure("Icorrect level : " + level + " .Should be less then " + height); + } + + // generate names for all nodes at the given level: + Denotation denotation = null; + if (!useFats) { + denotation = (Denotation) info.getField("nodesDenotation").get(null); + } + + // Set all classnames + String prefix = PACKAGE_PREFIX + info.getField("rootName").get(null); + nodeNames = new String[1 << level]; + classNames = new String[1 << level]; + for (int i = 0; i < nodeNames.length; i++) { + if (useFats) { + classNames[i] = prefix + ((String[]) info.getField("nodeNames").get(null))[height - 1]; + } else { + nodeNames[i] = denotation.nameFor(level, i); + classNames[i] = prefix + nodeNames[i]; + } + } + System.out.println("The level = " + level + " the height = " + height); + } catch (Exception e) { + throw new TestFailure("Can't initialize test correctly", e); + } + } + + @Override + protected final String[] getClassNames() { + return classNames; + } + + @Override + protected final ClassLoader[] createLoaders() { + ClassLoader jarLoader = createJarLoader(); + ClassLoader loaders[] = new ClassLoader[nodeNames.length]; + ClassLoadersBTree loadersTree = new ClassLoadersBTree(jarLoader, height); + for (int i = 0; i < loaders.length; i++) { + loaders[i] = loadersTree.getLoader(nodeNames[i]); + } + return loaders; + } +} diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/ChainGen.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/ChainGen.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2002, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.sysdict.share; + +import java.io.*; + +/** + * This tools generates a chain of classes. + * For more details, use: + *
+ *     java ChainGen -help
+ * 
+ */ +public class ChainGen { + private static final int FATS_HEIGHT = 5; + private static final int FATS_WEIGHT = 10000; + private static final int LEANS_HEIGHT = 50; + private static final int LEANS_WEIGHT = 1; + + private static void explain(Object x) { + System.err.println("# " + x); + } + + public static void main(String args[]) { + if (args.length < 1 || args[0].toLowerCase().startsWith("-h")) { + explain("Generates a chain classes extending each other."); + explain(""); + explain("Use:"); + explain(" java ChainGen $NAME $HEIGHT $WEIGHT"); + explain("Or:"); + explain(" java ChainGen \"fats\""); + explain("Or:"); + explain(" java ChainGen \"leans\""); + explain(""); + explain("This creates:"); + explain(" ${NAME}Info.java class displaying HEIGHT and WEIGHT."); + explain(" ${NAME}XXXXXX.java defining classes chain."); + explain(""); + explain("Here:"); + explain(" HEIGHT and WEIGHT must be positive integers."); + explain(" Defaults for \"fats\": HEIGHT is " + FATS_HEIGHT + + ", WEIGHT is " + FATS_WEIGHT +"."); + explain(" Defaults for \"leans\": HEIGHT is " + LEANS_HEIGHT + + ", WEIGHT is " + LEANS_WEIGHT +"."); + System.exit(1); + }; + String name; + int height, weight; + if (args[0].toLowerCase().equals("fats")) { + name = "Fats"; + height = FATS_HEIGHT; + weight = FATS_WEIGHT; + } else if (args[0].toLowerCase().equals("leans")) { + name = "Leans"; + height = LEANS_HEIGHT; + weight = LEANS_WEIGHT; + } else { + name = args[0]; + height = Integer.parseInt(args[1]); + weight = Integer.parseInt(args[2]); + }; + try { + doit(name, height, weight); + } catch (IOException exception) { + exception.printStackTrace(System.err); + System.exit(1); + } + } + + private static void doit(String name, int height, int weight) + throws FileNotFoundException + { + // Constants definition: + PrintStream info = new PrintStream( + new FileOutputStream(new File(name + "Info.java")) + ); + info.println("// This file is generated by: ChainGen.java"); + info.println("package nsk.sysdict.share;"); + info.println("public class " + name + "Info {"); + info.println(" public static final int HEIGHT = " + height + ";"); + info.println(" private static final int WEIGHT = " + weight + ";"); + info.println(" public static final String rootName = \"" + name + "\";"); + info.println(" public static final String[] nodeNames = new String[] {"); + // Generate a series of fat classes: + for (int index=0; index0? " extends " + name + digits(index-1,6): "") + + " {"); + for (int w=0; wx to n-digits string. + */ + private static String digits(int x, int n) { + String s = "" + x; + while (s.length() < n) + s = "0" + s; + return s; + } +} diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/ChainTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/ChainTest.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2010, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.sysdict.share; + +import java.lang.reflect.Field; +import nsk.share.Failure; +import nsk.share.TestFailure; +import nsk.share.sysdict.ClassLoadersChain; +import nsk.share.test.Tests; + +/** + * This is a main class for all chain tests. + */ +public class ChainTest extends SysDictTest { + + public ChainTest(String[] args) { + parseArgs(args); + } + + public static void main(String args[]) { + Tests.runTest(new ChainTest(args), args); + } + private static final int NxM_FACTOR = 450; + private int classesHeight; + private int loadersHeight; + String[] classNames; + + @Override + protected void parseArgs(String args[]) { + super.parseArgs(args); + boolean isLoaderHeightDefault = true; + boolean isHeightDefault = true; + for (int i = 0; i < args.length; i++) { + if (args[i].equals("-classloaderHeight")) { + loadersHeight = Integer.parseInt(args[i + 1]); + if (loadersHeight > 0) { + isLoaderHeightDefault = false; + } + } + if (args[i].equals("-height")) { + classesHeight = Integer.parseInt(args[i + 1]); + if (classesHeight > 0) { + isHeightDefault = false; + } + } + } + + Class info; + try { + if (useFats) { + info = createJarLoader().loadClass(PACKAGE_PREFIX + "FatsInfo"); + } else { + info = createJarLoader().loadClass(PACKAGE_PREFIX + "LeansInfo"); + } + System.out.println("name=" + info.getName()); + for (Field field : info.getDeclaredFields()) { + System.err.println("field = " + field.getName()); + } + if (isHeightDefault) { + classesHeight = info.getField("HEIGHT").getInt(null); + } + + + if (isLoaderHeightDefault) { + loadersHeight = NxM_FACTOR / classesHeight; + } + + if (loadersHeight * classesHeight != NxM_FACTOR) { + throw new Failure("classes height must divide " + NxM_FACTOR); + } + + if (loadersHeight == 0) { + throw new Failure("loaders height should be positive"); + } + if (classesHeight == 0) { + throw new Failure("classes height should be positive"); + } + classNames = new String[classesHeight]; + for (int i = 0; i < classesHeight; i++) { + classNames[i] = PACKAGE_PREFIX + info.getField("rootName").get(null) + + ((String[]) info.getField("nodeNames").get(null))[i]; + } + if (classNames == null || classNames.length == 0) { + throw new TestFailure("No classes names for loading"); + } + System.out.println("The classHeight = " + classesHeight + " the loadersHeight = " + loadersHeight); + } catch (Exception e) { + throw new TestFailure("Can't initialize test correctly", e); + } + + } + + @Override + String[] getClassNames() { + return classNames; + } + + @Override + ClassLoader[] createLoaders() { + ClassLoader loaders[] = new ClassLoader[loadersHeight]; + ClassLoader jarLoader = createJarLoader(); + ClassLoadersChain loadersChain = + new ClassLoadersChain(jarLoader, loadersHeight); + // direct ordering: root loader first + for (int i = 0; i < loadersHeight; i++) { + loaders[i] = loadersChain.getLoader(loadersHeight - 1 - i); + } + return loaders; + } +} diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/GenClassesBuilder.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/GenClassesBuilder.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.sysdict.share; + +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.Utils; +import jdk.test.lib.process.ProcessTools; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.stream.Stream; + +public class GenClassesBuilder { + public static void main(String[] args) { + if (args == null || args.length == 0) { + throw new Error("args can't be empty"); + } + for (String arg : args) { + switch (arg) { + case "btree": + build("btree", "BTree", + () -> BTreeGen.main(new String[] {"default"})); + break; + case "leans": + build("leans", "Leans", + () -> ChainGen.main(new String[] {"leans"})); + break; + case "fats": + build("fats", "Fats", + () -> ChainGen.main(new String[] {"fats"})); + break; + default: + throw new Error("unkown target " + arg); + } + } + } + + private static void build(String name, String prefix, Runnable generator) { + generator.run(); + Path genSrcDir = Paths.get(name, "genSrc", "nsk", "sysdict", "share"); + Path classesDir = Paths.get(name,"classes").toAbsolutePath(); + try { + Files.createDirectories(genSrcDir); + } catch (IOException e) { + throw new Error("can't create dir " + genSrcDir, e); + } + moveJavaFiles(genSrcDir, prefix); + + JDKToolLauncher javac = JDKToolLauncher.create("javac") + .addToolArg("-d") + .addToolArg(classesDir.toString()) + .addToolArg("-cp") + .addToolArg(Utils.TEST_CLASS_PATH); + + try (Stream stream = Files.walk(genSrcDir)) { + stream.map(Path::toAbsolutePath) + .map(Path::toString) + .filter(s -> s.endsWith(".java")) + .forEach(javac::addToolArg); + } catch (IOException e) { + throw new Error("traverse dir " + genSrcDir, e); + } + + executeTool(javac); + buildJar(name + ".jar", classesDir); + } + + private static void executeTool(JDKToolLauncher tool) { + String[] command = tool.getCommand(); + try { + ProcessTools.executeCommand(command) + .shouldHaveExitValue(0); + } catch (Error | RuntimeException e) { + throw e; + } catch (Throwable e) { + throw new Error("execution of " + Arrays.toString(command) + " failed", e); + } + } + + private static void buildJar(String name, Path dir) { + JDKToolLauncher jar = JDKToolLauncher.create("jar") + .addToolArg("cf") + .addToolArg(name) + .addToolArg("-C") + .addToolArg(dir.toString()) + .addToolArg("."); + executeTool(jar); + } + + private static void moveJavaFiles(Path dir, String prefix) { + try (Stream stream = Files.list(Paths.get("."))) { + stream.filter(Files::isRegularFile) + .filter(p -> { + String s = p.getFileName().toString(); + return s.startsWith(prefix) && s.endsWith(".java");}) + .forEach(p -> move(p, dir)); + } catch (IOException e) { + throw new Error("can't traverse current dir", e); + } + } + + private static void move(Path src, Path dstDir) { + if (Files.notExists(src)) { + throw new Error("file " + src + " doesn't exit"); + } + try { + Files.move(src, dstDir.resolve(src.getFileName())); + } catch (IOException e) { + throw new Error("can't move " + src + " to " + dstDir, e); + } + } +} diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2010, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.sysdict.share; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Random; +import nsk.share.ClassUnloader; +import nsk.share.TestFailure; +import nsk.share.gc.ThreadedGCTest; +import nsk.share.gc.gp.GarbageUtils; +import nsk.share.test.ExecutionController; + +/** + * This is the base class for btree & chain tests. It is a standard GCThreaded Test. + */ +public abstract class SysDictTest extends ThreadedGCTest { + + static String PACKAGE_PREFIX = "nsk.sysdict.share."; + // Should we additionally use ClassUnloader.unload to stress GC + private boolean isHeapStressed = false; + // Should we use one JarLoader or a lot of them + private boolean useSingleLoader = true; + // Should we use fats.jar with little amount large classes or not + boolean useFats = false; + URL[] jars; + + protected void parseArgs(String args[]) { + for (int i = 0; i < args.length; i++) { + if (args[i].equals("-stressHeap")) { + isHeapStressed = true; + } + if (args[i].equals("-useFatClass")) { + useFats = true; + } + if (args[i].equals("-useSingleLoader")) { + this.useSingleLoader = false; + } + // jar path is in useal classpath format + if (args[i].equals("-jarpath")) { + String[] files = args[i + 1].split(File.pathSeparator); + jars = new URL[files.length]; + for (int j = 0; j < files.length; j++) { + try { + jars[j] = new File(files[j]).toURI().toURL(); + } catch (MalformedURLException e) { + throw new TestFailure(e); + } + } + } + } + } + + // each time we create a new classloader + protected ClassLoader createJarLoader() { + return new URLClassLoader(jars); + } + + // The btree and chain tests differs by loaders and classes + // let define them in subclasses + abstract ClassLoader[] createLoaders(); + + abstract String[] getClassNames(); + + ClassLoader[] createClassLoadersInternal() { + if (!useSingleLoader) { + return createLoaders(); + } else { + ClassLoader[] single = new ClassLoader[1]; + single[0] = createJarLoader(); + return single; + } + } + volatile ClassLoader[] currentClassLoaders; + + class Worker implements Runnable { + + private ClassLoader loader; + private String[] names; + private ExecutionController stresser; + int index; + public String tmp; + + public Worker(int number, String[] classnames) { + + this.index = number; + this.names = new String[classnames.length]; + List listNames = new ArrayList(classnames.length); + listNames.addAll(Arrays.asList(classnames)); + for (int i = 0; i < classnames.length; i++) { + int idx1 = new Random().nextInt(listNames.size()); + this.names[i] = listNames.remove(idx1); + } + } + + @Override + public void run() { + if (stresser == null) { + stresser = getExecutionController(); + } + + // only first thread update all classloaders + // do not care about synchronization + if (index == 0) { + try { + currentClassLoaders = createClassLoadersInternal(); + } catch (OutOfMemoryError oome) { + // skip iterations until all loaders will be unloaded + Thread.yield(); + return; + } + } + for (int i = 0; i < names.length; i++) { + try { + String name = names[i]; + if (!stresser.continueExecution()) { + return; + } + // just check if loader was updated + loader = currentClassLoaders[index]; + Class clz = Class.forName(name, true, loader); + // set name into public variable just to be sure + // that class is loaded + tmp = clz.getName(); + } catch (ClassNotFoundException cnfe) { + throw new TestFailure(cnfe); + } catch (OutOfMemoryError oome) { + // just ignore + // we do not check memory leaks in PermGen in this tests + } catch (StackOverflowError soe) { + // just ignore, chains could be too large + // StackOverflowError could be in some sparcs + } + } + if (isHeapStressed) { + GarbageUtils.eatMemory(stresser, 50, 1024, 0); + } + } + } + + @Override + protected Runnable createRunnable(int i) { + currentClassLoaders = createClassLoadersInternal(); + return new Worker(i % currentClassLoaders.length, getClassNames()); + } +} diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree001/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree001/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree001/btree001.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree001/btree001.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree001. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread load a tree of classes with isomorphic + * tree of loaders (root loader loads root class, etc). + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -t 1 + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/btree002.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/btree002.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree002. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread loads a tree of classes with signle loader. + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -useSingleLoader + * -t 1 + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree003/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree003/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree003/btree003.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree003/btree003.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree003. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread loads single class with a tree of loaders. + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -t 1 + * -useFatClass + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree004/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree004/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree004/btree004.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree004/btree004.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree004. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load a tree of classes with isomorphic + * tree of loaders (root loader loads root class, etc). + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/btree005.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/btree005.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree005. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load a tree of classes with signle loader. + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -useSingleLoader + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree006/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree006/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree006/btree006.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree006/btree006.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree006. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load single class with a tree of loaders. + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -useFatClass + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree007/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree007/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree007/btree007.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree007/btree007.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree007. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread load a tree of classes with isomorphic + * tree of loaders (root loader loads root class, etc). + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -t 1 + * -stressHeap + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/btree008.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/btree008.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree008. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread loads a tree of classes with signle loader. + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -useSingleLoader + * -stressHeap + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree009/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree009/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree009/btree009.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree009/btree009.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree009. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread loads single class with a tree of loaders. + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -t 1 + * -stressHeap + * -useFatClass + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree010/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree010/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree010/btree010.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree010/btree010.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree010. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load a tree of classes with isomorphic + * tree of loaders (root loader loads root class, etc). + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -stressHeap + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree011. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load a tree of classes with signle loader. + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -useSingleLoader + * -stressHeap + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree012/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree012/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree012/btree012.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree012/btree012.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/btree/btree012. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load single class with a tree of loaders. + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment btree classes import nsk.sysdict.share.* + * @build nsk.sysdict.share.* + * @comment build btree.jar + * @run driver nsk.sysdict.share.GenClassesBuilder btree + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.BTreeTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.BTreeTest + * -jarpath btree.jar${path.separator}fats.jar + * -stressHeap + * -useFatClass + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain001/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain001/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain001/chain001.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain001/chain001.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/chain/chain001. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread loads a long chain of lean classes + * with a short chain of loaders (NxM load attempts). + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @comment build leans.jar + * @run driver nsk.sysdict.share.GenClassesBuilder leans + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.ChainTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.ChainTest + * -t 1 + * -jarpath leans.jar${path.separator}fats.jar + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain002/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain002/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain002/chain002.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain002/chain002.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/chain/chain002. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread loads a short chain of fat classes + * with a long chain of loaders (NxM load attempts). + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @comment build leans.jar + * @run driver nsk.sysdict.share.GenClassesBuilder leans + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.ChainTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.ChainTest + * -useFatClass + * -t 1 + * -jarpath leans.jar${path.separator}fats.jar + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain003/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain003/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain003/chain003.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain003/chain003.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/chain/chain003. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load a long chain of lean classes + * with a short chain of loaders (NxM threads totally). + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @comment build leans.jar + * @run driver nsk.sysdict.share.GenClassesBuilder leans + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.ChainTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * -Xss2048k + * PropertyResolvingWrapper + * nsk.sysdict.share.ChainTest + * -jarpath leans.jar${path.separator}fats.jar + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain004/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain004/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain004/chain004.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain004/chain004.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/chain/chain004. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load a short chain of fat classes + * with a long chain of loaders. + * The test is deemed failed if loading attempt fails. + * The test repeats until the given number of iterations, + * or until EndOfMemoryError. + * + * @library /vmTestbase /test/lib + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @comment build leans.jar + * @run driver nsk.sysdict.share.GenClassesBuilder leans + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.ChainTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.ChainTest + * -useFatClass + * -jarpath leans.jar${path.separator}fats.jar + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain005/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain005/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain005/chain005.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain005/chain005.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/chain/chain005. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread loads a long chain of lean classes + * with a short chain of loaders (NxM load attempts). + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @comment build leans.jar + * @run driver nsk.sysdict.share.GenClassesBuilder leans + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.ChainTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.ChainTest + * -stressHeap + * -t 1 + * -jarpath leans.jar${path.separator}fats.jar + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain006/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain006/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain006/chain006.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain006/chain006.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/chain/chain006. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Single thread loads a short chain of fat classes + * with a long chain of loaders (NxM load attempts). + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @comment build leans.jar + * @run driver nsk.sysdict.share.GenClassesBuilder leans + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.ChainTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.ChainTest + * -stressHeap + * -useFatClass + * -t 1 + * -jarpath leans.jar${path.separator}fats.jar + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain007/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain007/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain007/chain007.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain007/chain007.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/chain/chain007. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load a long chain of lean classes + * with a short chain of loaders (NxM threads totally). + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @comment build leans.jar + * @run driver nsk.sysdict.share.GenClassesBuilder leans + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.ChainTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.ChainTest + * -stressHeap + * -jarpath leans.jar${path.separator}fats.jar + */ + diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain008/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain008/TEST.properties Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,1 @@ +exclusiveAccess.dirs=. diff -r b5023063346d -r d2d6bc39ea88 test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain008/chain008.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/chain/chain008/chain008.java Wed May 16 16:43:11 2018 -0700 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @key stress + * + * @summary converted from VM Testbase nsk/sysdict/vm/stress/chain/chain008. + * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] + * VM Testbase readme: + * DESCRIPTION + * Multiple threads load a short chain of fat classes + * with a long chain of loaders (NxM threads totally). + * Then, memory stress is induced to unload the classes. + * The test is deemed failed if loading attempt fails; + * or if the tested VM crashes. + * The test repeats until the given number of iterations, + * or until a timeout. + * + * @library /vmTestbase /test/lib + * @comment build fats.jar + * @run driver nsk.sysdict.share.GenClassesBuilder fats + * @comment build leans.jar + * @run driver nsk.sysdict.share.GenClassesBuilder leans + * @run driver jdk.test.lib.FileInstaller . . + * @build nsk.sysdict.share.ChainTest + * @run main/othervm + * -XX:-UseGCOverheadLimit + * PropertyResolvingWrapper + * nsk.sysdict.share.ChainTest + * -stressHeap + * -useFatClass + * -jarpath leans.jar${path.separator}fats.jar + */ +