Skip to content
Permalink
Browse files
8272168: some hotspot runtime/logging tests don't check exit code
Backport-of: 3b899ef7ffd87477ac1b10f4334b127597e9fe32
  • Loading branch information
GoeLin committed Mar 15, 2022
1 parent 16f7508 commit 88216d84a7f8b2045b8b7a87cb92158f61688025
Showing 5 changed files with 16 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, 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
@@ -45,6 +45,7 @@ public static void main(String... args) throws Exception {
"-Xmx128m",
"BadMap50");
OutputAnalyzer out = new OutputAnalyzer(pb.start());
out.shouldNotHaveExitValue(0);
out.shouldContain("Start class verification for:");
out.shouldContain("End class verification for:");
out.shouldContain("Initializing");
@@ -69,6 +70,7 @@ public static void main(String... args) throws Exception {
"-Xmx128m",
"BadMap50");
out = new OutputAnalyzer(pb.start());
out.shouldNotHaveExitValue(0);
out.shouldNotContain("[class,init]");
out.shouldNotContain("Fail over class verification to old verifier for: BadMap50");

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, 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
@@ -62,6 +62,7 @@ public static void main(String... args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug",
ClassResolutionTestMain.class.getName());
OutputAnalyzer o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldContain("[class,resolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
o.shouldContain("[class,resolve] resolve JVM_CONSTANT_MethodHandle");

@@ -70,6 +71,7 @@ public static void main(String... args) throws Exception {
"-Xlog:class+resolve=off",
ClassResolutionTestMain.class.getName());
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldNotContain("[class,resolve]");
};

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, 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
@@ -42,6 +42,7 @@ public static void main(String... args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles",
"CondyIndy");
OutputAnalyzer o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldContain("[info][methodhandles");
o.shouldNotContain("[debug][methodhandles,indy");
o.shouldNotContain("[debug][methodhandles,condy");
@@ -50,6 +51,7 @@ public static void main(String... args) throws Exception {
pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles+condy=debug",
"CondyIndy");
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldNotContain("[info ][methodhandles");
o.shouldNotContain("[debug][methodhandles,indy");
o.shouldContain("[debug][methodhandles,condy");
@@ -58,6 +60,7 @@ public static void main(String... args) throws Exception {
pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles+indy=debug",
"CondyIndy");
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldNotContain("[info ][methodhandles");
o.shouldContain("[debug][methodhandles,indy");
o.shouldNotContain("[debug][methodhandles,condy");
@@ -68,6 +71,7 @@ public static void main(String... args) throws Exception {
"-Xlog:methodhandles+indy=debug",
"CondyIndy");
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldContain("[info ][methodhandles");
o.shouldContain("[debug][methodhandles,indy");
o.shouldContain("[debug][methodhandles,condy");
@@ -69,11 +69,13 @@ public static void main(String... args) throws Exception {
// -Xlog:class+loader+constraints=info
pb = exec("-Xlog:class+loader+constraints=info");
out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
out.shouldContain("[class,loader,constraints] adding new constraint for name: java/lang/Class, loader[0]: 'app', loader[1]: 'bootstrap'");

// -Xlog:class+loader+constraints=off
pb = exec("-Xlog:class+loader+constraints=off");
out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
out.shouldNotContain("[class,loader,constraints]");

}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, 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
@@ -44,6 +44,7 @@ public static void main(String... args) throws Exception {
"-Xlog:monitormismatch=info",
"MonitorMismatchHelper");
OutputAnalyzer o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldContain("[monitormismatch] Monitor mismatch in method");

// monitormismatch should turn off.
@@ -52,6 +53,7 @@ public static void main(String... args) throws Exception {
"-Xlog:monitormismatch=off",
"MonitorMismatchHelper");
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldNotContain("[monitormismatch]");
};

1 comment on commit 88216d8

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 88216d8 Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.