tschatzl@5204: /* tschatzl@5204: * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. tschatzl@5204: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. tschatzl@5204: * tschatzl@5204: * This code is free software; you can redistribute it and/or modify it tschatzl@5204: * under the terms of the GNU General Public License version 2 only, as tschatzl@5204: * published by the Free Software Foundation. tschatzl@5204: * tschatzl@5204: * This code is distributed in the hope that it will be useful, but WITHOUT tschatzl@5204: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or tschatzl@5204: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License tschatzl@5204: * version 2 for more details (a copy is included in the LICENSE file that tschatzl@5204: * accompanied this code). tschatzl@5204: * tschatzl@5204: * You should have received a copy of the GNU General Public License version tschatzl@5204: * 2 along with this work; if not, write to the Free Software Foundation, tschatzl@5204: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. tschatzl@5204: * tschatzl@5204: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA tschatzl@5204: * or visit www.oracle.com if you need additional information or have any tschatzl@5204: * questions. tschatzl@5204: */ tschatzl@5204: tschatzl@5204: /* tschatzl@5204: * @test TestSummarizeRSetStats.java tschatzl@5204: * @bug 8013895 tschatzl@5204: * @library /testlibrary tschatzl@5807: * @build TestSummarizeRSetStatsTools TestSummarizeRSetStats tschatzl@5204: * @summary Verify output of -XX:+G1SummarizeRSetStats tschatzl@5204: * @run main TestSummarizeRSetStats tschatzl@5204: * tschatzl@5204: * Test the output of G1SummarizeRSetStats in conjunction with G1SummarizeRSetStatsPeriod. tschatzl@5204: */ tschatzl@5204: tschatzl@5204: public class TestSummarizeRSetStats { tschatzl@5204: tschatzl@5204: public static void main(String[] args) throws Exception { tschatzl@5204: String result; tschatzl@5204: tschatzl@5807: if (!TestSummarizeRSetStatsTools.testingG1GC()) { tschatzl@5807: return; tschatzl@5807: } tschatzl@5204: tschatzl@5807: // no remembered set summary output tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(null, 0); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); tschatzl@5204: tschatzl@5807: // no remembered set summary output tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(null, 2); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); tschatzl@5204: tschatzl@5807: // no remembered set summary output tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); tschatzl@5204: tschatzl@5807: // single remembered set summary output at the end tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); tschatzl@5204: tschatzl@5807: // single remembered set summary output at the end tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 2); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); tschatzl@5204: tschatzl@5807: // single remembered set summary output tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 0); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); tschatzl@5204: tschatzl@5807: // two times remembered set summary output tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); tschatzl@5204: tschatzl@5807: // four times remembered set summary output tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 6); tschatzl@5204: tschatzl@5807: // three times remembered set summary output tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=2" }, 3); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 4); tschatzl@5807: tschatzl@5807: // single remembered set summary output tschatzl@5807: result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=100" }, 3); tschatzl@5807: TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); tschatzl@5204: } tschatzl@5204: } tschatzl@5204: