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 4530538
27 * @summary Basic unit test of ThreadInfo.getStackTrace() and
28 * ThreadInfo.getThreadState()
29 * @author Mandy Chung
30 *
31 * @modules java.management
32 * @run build Utils
33 * @run main ThreadStackTrace
34 */
35
36 import java.lang.management.*;
37 import java.util.concurrent.Phaser;
38
39 public class ThreadStackTrace {
40 private static final ThreadMXBean mbean
41 = ManagementFactory.getThreadMXBean();
42 private static boolean notified = false;
43 private static final Object lockA = new Object();
44 private static final Object lockB = new Object();
45 private static volatile boolean testFailed = false;
46 private static final String[] blockedStack = {"run", "test", "A", "B", "C", "D"};
47 private static final int bsDepth = 6;
48 private static final int methodB = 4;
49 private static final String[] examinerStack = {"run", "examine1", "examine2"};
50 private static final int esDepth = 3;
51 private static final int methodExamine1= 2;
|
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 4530538
27 * @summary Basic unit test of ThreadInfo.getStackTrace() and
28 * ThreadInfo.getThreadState()
29 * @author Mandy Chung
30 *
31 * @run build Utils
32 * @run main ThreadStackTrace
33 */
34
35 import java.lang.management.*;
36 import java.util.concurrent.Phaser;
37
38 public class ThreadStackTrace {
39 private static final ThreadMXBean mbean
40 = ManagementFactory.getThreadMXBean();
41 private static boolean notified = false;
42 private static final Object lockA = new Object();
43 private static final Object lockB = new Object();
44 private static volatile boolean testFailed = false;
45 private static final String[] blockedStack = {"run", "test", "A", "B", "C", "D"};
46 private static final int bsDepth = 6;
47 private static final int methodB = 4;
48 private static final String[] examinerStack = {"run", "examine1", "examine2"};
49 private static final int esDepth = 3;
50 private static final int methodExamine1= 2;
|