test/runtime/NMT/SummaryAfterShutdown.java

changeset 7075
ac12996df59b
parent 0
f90c822e73f8
child 7110
6640f982c1be
equal deleted inserted replaced
7074:833b0f92429a 7075:ac12996df59b
1 /* 1 /*
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
24 /* 24 /*
25 * @test 25 * @test
26 * @key nmt jcmd 26 * @key nmt jcmd
27 * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown 27 * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown
28 * @library /testlibrary 28 * @library /testlibrary
29 * @ignore
29 * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown 30 * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown
30 */ 31 */
31 32
32 import com.oracle.java.testlibrary.*; 33 import com.oracle.java.testlibrary.*;
33 34
42 // Run 'jcmd <pid> VM.native_memory shutdown' 43 // Run 'jcmd <pid> VM.native_memory shutdown'
43 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "shutdown"}); 44 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "shutdown"});
44 output = new OutputAnalyzer(pb.start()); 45 output = new OutputAnalyzer(pb.start());
45 46
46 // Verify that jcmd reports that NMT is shutting down 47 // Verify that jcmd reports that NMT is shutting down
47 output.shouldContain("Shutdown is in progress, it will take a few moments to completely shutdown"); 48 output.shouldContain("Native memory tracking has been turned off");
48 49
49 // Run 'jcmd <pid> VM.native_memory summary' 50 // Run 'jcmd <pid> VM.native_memory summary'
50 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); 51 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"});
51 output = new OutputAnalyzer(pb.start()); 52 output = new OutputAnalyzer(pb.start());
52 53
53 // Verify that jcmd reports that NMT has been shutdown 54 // Verify that jcmd reports that NMT has been shutdown
54 output.shouldContain("Native memory tracking has been shutdown by user"); 55 output.shouldContain("Native memory tracking has been shutdown");
55 } 56 }
56 } 57 }

mercurial