1 /* 2 * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 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 package nsk.jdi.BScenarios.multithrd; 25 26 import nsk.share.*; 27 import nsk.share.jpda.*; 28 import nsk.share.jdi.*; 29 30 // THIS TEST IS LINE NUMBER SENSITIVE 31 32 /** 33 * <code>tc02x004a</code> is deugee's part of the tc02x004. 34 */ 35 public class tc02x004a { 36 37 public final static int threadCount = 3; 38 static Log log; 39 40 public final static int checkClassBrkpLine = 79; 41 Thready [] thrds = new Thready [threadCount]; 42 main(String argv[])43 public static void main (String argv[]) { 44 ArgumentHandler argHandler = new ArgumentHandler(argv); 45 log = new Log(System.err, argHandler); 46 47 tc02x004a obj = new tc02x004a(); 48 49 try { 50 for (int i = 0; i < obj.thrds.length; i++ ) { 51 obj.thrds[i].join(); 52 } 53 } catch (InterruptedException e) { 54 } 55 log.display("completed succesfully."); 56 System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE); 57 } 58 tc02x004a()59 tc02x004a() { 60 for (int i = 0; i < thrds.length; i++ ) { 61 thrds[i] = new Thready("Thread-" + (i+1)); 62 thrds[i].start(); 63 } 64 } 65 66 static class Thready extends Thread { Thready(String name)67 Thready(String name) { 68 super(name); 69 } 70 run()71 public void run() { 72 log.display(getName() + ":: creating tc02x004aClass1"); 73 new tc02x004aClass1(getName()); 74 } 75 } 76 } 77 78 class tc02x004aClass1 { tc02x004aClass1(String thrdName)79 public tc02x004aClass1(String thrdName) { // checkClassBrkpLine 80 tc02x004a.log.display("tc02x004aClass1::constructor is called from" 81 + thrdName); 82 } 83 } 84