< prev index next >

test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachReturnError.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020, 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.

@@ -23,23 +23,28 @@
 import jdk.test.lib.dcmd.*;
 import jdk.test.lib.process.OutputAnalyzer;
 
 /*
  * @test
- * @bug 8165736
+ * @bug 8165736 8252657
  * @library /test/lib
  * @run testng AttachReturnError
  */
 public class AttachReturnError extends AttachFailedTestBase {
     @Override
     public void run(CommandExecutor executor)  {
         try {
             String libpath = getSharedObjectPath("ReturnError");
             OutputAnalyzer output = null;
 
+            // Check return code
             output = executor.execute("JVMTI.agent_load " + libpath);
             output.shouldContain("return code: -1");
+
+            // Check return
+            output = executor.execute("VM.dynlibs");
+            output.shouldNotContain(libpath);
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
     }
 }
< prev index next >