8079200: Fix heapdump tests to validate heapdump after jhat is removed

Reviewed-by: sla
This commit is contained in:
Katja Kantserova 2015-05-07 16:11:04 +02:00
parent 0f95d11041
commit 7c3182fb56
2 changed files with 33 additions and 9 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2015, 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
@ -41,25 +41,38 @@ OUTPUT_DIR = $(BUILD_DIR)/classes
JAVAC = $(JDK_HOME)/bin/javac
JAR = $(JDK_HOME)/bin/jar
SRC_FILES = $(shell find $(SRC_DIR) -name '*.java')
WB_SRC_FILES = $(shell find $(SRC_DIR)/sun/hotspot -name '*.java')
SHARE_SRC_FILES = $(shell find $(SRC_DIR)/share/classes -name '*.java')
.PHONY: filelist clean cleantmp
.PHONY: wb.filelist share.filelist clean cleantmp
all: wb.jar cleantmp
all: wb.jar test-lib.jar cleantmp
wb.jar: filelist
wb.jar: wb.filelist
@mkdir -p $(OUTPUT_DIR)
$(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp $(OUTPUT_DIR) @filelist
$(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp $(OUTPUT_DIR) @wb.filelist
$(JAR) cf wb.jar -C $(OUTPUT_DIR) .
@rm -rf $(OUTPUT_DIR)
filelist: $(SRC_FILES)
wb.filelist: $(WB_SRC_FILES)
@rm -f $@
@echo $(SRC_FILES) > $@
@echo $(WB_SRC_FILES) > $@
test-lib.jar: share.filelist
@mkdir -p $(OUTPUT_DIR)
$(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp $(OUTPUT_DIR) @share.filelist
$(JAR) cf test-lib.jar -C $(OUTPUT_DIR) .
@rm -rf $(OUTPUT_DIR)
share.filelist: $(SHARE_SRC_FILES)
@rm -f $@
@echo $(SHARE_SRC_FILES) > $@
clean: cleantmp
@rm -rf wb.jar
@rm -rf test-list.jar
cleantmp:
@rm -rf filelist
@rm -rf wb.filelist
@rm -rf share.filelist
@rm -rf $(BUILD_DIR)

View File

@ -36,6 +36,17 @@ import jdk.test.lib.hprof.parser.Reader;
*/
public class HprofParser {
public static void main(String[] args) throws Exception {
if (args.length < 1) {
System.out.println("No arguments supplied");
}
File dump = new File(args[0]);
if (!dump.exists() || !dump.isFile()) {
throw new RuntimeException("The dump file does not exist or not a file");
}
parse(dump);
}
/**
* @see #parse(File, boolean, boolean, boolean)
*/