6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8284199
27 * @summary Test thread dumps with StructuredTaskScope
28 * @modules jdk.incubator.concurrent
29 * @library /test/lib
30 * @run junit/othervm StructuredThreadDumpTest
31 */
32
33 import jdk.incubator.concurrent.StructuredTaskScope;
34 import java.io.IOException;
35 import java.lang.management.ManagementFactory;
36 import java.nio.file.Files;
37 import java.nio.file.Path;
38 import java.util.concurrent.ThreadFactory;
39 import java.util.concurrent.atomic.AtomicReference;
40 import java.util.concurrent.locks.LockSupport;
41 import java.util.stream.Stream;
42 import com.sun.management.HotSpotDiagnosticMXBean;
43 import com.sun.management.HotSpotDiagnosticMXBean.ThreadDumpFormat;
44 import jdk.test.lib.threaddump.ThreadDump;
45 import org.junit.jupiter.api.Test;
46 import static org.junit.jupiter.api.Assertions.*;
47
48 class StructuredThreadDumpTest {
49
50 /**
51 * Test that a thread dump with a tree of task scopes contains a thread grouping for
52 * each task scope.
53 */
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8284199 8296779 8306647
27 * @summary Test thread dumps with StructuredTaskScope
28 * @enablePreview
29 * @library /test/lib
30 * @run junit/othervm StructuredThreadDumpTest
31 */
32
33 import java.util.concurrent.StructuredTaskScope;
34 import java.io.IOException;
35 import java.lang.management.ManagementFactory;
36 import java.nio.file.Files;
37 import java.nio.file.Path;
38 import java.util.concurrent.ThreadFactory;
39 import java.util.concurrent.atomic.AtomicReference;
40 import java.util.concurrent.locks.LockSupport;
41 import java.util.stream.Stream;
42 import com.sun.management.HotSpotDiagnosticMXBean;
43 import com.sun.management.HotSpotDiagnosticMXBean.ThreadDumpFormat;
44 import jdk.test.lib.threaddump.ThreadDump;
45 import org.junit.jupiter.api.Test;
46 import static org.junit.jupiter.api.Assertions.*;
47
48 class StructuredThreadDumpTest {
49
50 /**
51 * Test that a thread dump with a tree of task scopes contains a thread grouping for
52 * each task scope.
53 */
|