< prev index next >

test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java

Print this page

@@ -25,17 +25,13 @@
 /*
  * @test
  * @summary Check most common errors in file format
  * @requires vm.cds.archived.java.heap
  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @build HelloString
  * @run driver InvalidFileFormat
- * @run main/othervm -XX:+UseStringDeduplication InvalidFileFormat
- * @run main/othervm -XX:-CompactStrings InvalidFileFormat
  */
 
 import java.io.File;
 import jdk.test.lib.cds.CDSTestUtils;
 import jdk.test.lib.process.OutputAnalyzer;

@@ -44,10 +40,14 @@
 // This file is not an exhastive test of various shared data file corruption
 // Note on usability intent: the shared data file is created and handled by
 // the previledge person in the server environment.
 public class InvalidFileFormat {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, InvalidFileFormat::test);
+    }
+
+    public static void test(String[] args) throws Exception {
         SharedStringsUtils.buildJar("HelloString");
 
         test("NonExistentFile.txt", "Unable to get hashtable dump file size");
         test("InvalidHeader.txt", "wrong version of hashtable dump file");
         test("InvalidVersion.txt", "wrong version of hashtable dump file");
< prev index next >