31 import java.nio.file.attribute.BasicFileAttributes;
32 import java.util.ArrayList;
33 import java.util.Arrays;
34 import java.util.Deque;
35 import java.util.List;
36 import java.util.Set;
37 import java.util.concurrent.ConcurrentLinkedDeque;
38 import java.util.concurrent.ExecutorService;
39 import java.util.concurrent.Executors;
40 import java.util.concurrent.TimeUnit;
41 import java.util.concurrent.atomic.AtomicInteger;
42 import java.util.stream.Collectors;
43 import java.util.stream.Stream;
44
45 import jdk.internal.jimage.BasicImageReader;
46 import jdk.internal.jimage.ImageLocation;
47
48 /*
49 * @test
50 * @summary Verify jimage
51 * @run main/othervm VerifyJimage
52 */
53
54 /**
55 * This test runs in two modes:
56 * (1) No argument: it verifies the jimage by loading all classes in the runtime
57 * (2) path of exploded modules: it compares bytes of each file in the exploded
58 * module with the entry in jimage
59 *
60 * FIXME: exception thrown when findLocation from jimage by multiple threads
61 * -Djdk.test.threads=<n> to specify the number of threads.
62 */
63 public class VerifyJimage {
64 private static final Deque<String> failed = new ConcurrentLinkedDeque<>();
65
66 public static void main(String... args) throws Exception {
67 long start = System.nanoTime();
68 int numThreads = Integer.getInteger("jdk.test.threads", 1);
69 List<JImageReader> readers = newJImageReaders();
70 VerifyJimage verify = new VerifyJimage(readers, numThreads);
|
31 import java.nio.file.attribute.BasicFileAttributes;
32 import java.util.ArrayList;
33 import java.util.Arrays;
34 import java.util.Deque;
35 import java.util.List;
36 import java.util.Set;
37 import java.util.concurrent.ConcurrentLinkedDeque;
38 import java.util.concurrent.ExecutorService;
39 import java.util.concurrent.Executors;
40 import java.util.concurrent.TimeUnit;
41 import java.util.concurrent.atomic.AtomicInteger;
42 import java.util.stream.Collectors;
43 import java.util.stream.Stream;
44
45 import jdk.internal.jimage.BasicImageReader;
46 import jdk.internal.jimage.ImageLocation;
47
48 /*
49 * @test
50 * @summary Verify jimage
51 * @modules java.base/jdk.internal.jimage
52 * @run main/othervm VerifyJimage
53 */
54
55 /**
56 * This test runs in two modes:
57 * (1) No argument: it verifies the jimage by loading all classes in the runtime
58 * (2) path of exploded modules: it compares bytes of each file in the exploded
59 * module with the entry in jimage
60 *
61 * FIXME: exception thrown when findLocation from jimage by multiple threads
62 * -Djdk.test.threads=<n> to specify the number of threads.
63 */
64 public class VerifyJimage {
65 private static final Deque<String> failed = new ConcurrentLinkedDeque<>();
66
67 public static void main(String... args) throws Exception {
68 long start = System.nanoTime();
69 int numThreads = Integer.getInteger("jdk.test.threads", 1);
70 List<JImageReader> readers = newJImageReaders();
71 VerifyJimage verify = new VerifyJimage(readers, numThreads);
|