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 /* @test
25 * @bug 7068328
26 * @summary Test if getObjectName handles properly when called by
27 * multiple threads simultaneously. Run in othervm mode to
28 * make sure the object name is not initialized to begin with.
29 * @modules java.management
30 * @run main/othervm GetObjectName
31 */
32
33 import java.lang.management.BufferPoolMXBean;
34 import java.lang.management.ManagementFactory;
35 import java.lang.management.PlatformLoggingMXBean;
36 import java.lang.management.PlatformManagedObject;
37 import java.util.ArrayList;
38 import java.util.List;
39 import java.util.concurrent.ExecutorService;
40 import java.util.concurrent.Executors;
41 import java.util.concurrent.LinkedBlockingQueue;
42 import java.util.concurrent.TimeUnit;
43
44 public class GetObjectName {
45 private static boolean failed = false;
46 public static void main(String[] args) throws Exception {
47 int tasks = 10000;
48 ExecutorService executor = Executors.newFixedThreadPool(10);
49 submitTasks(executor, tasks);
|
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 /* @test
25 * @bug 7068328
26 * @summary Test if getObjectName handles properly when called by
27 * multiple threads simultaneously. Run in othervm mode to
28 * make sure the object name is not initialized to begin with.
29 *
30 * @run main/othervm GetObjectName
31 */
32
33 import java.lang.management.BufferPoolMXBean;
34 import java.lang.management.ManagementFactory;
35 import java.lang.management.PlatformLoggingMXBean;
36 import java.lang.management.PlatformManagedObject;
37 import java.util.ArrayList;
38 import java.util.List;
39 import java.util.concurrent.ExecutorService;
40 import java.util.concurrent.Executors;
41 import java.util.concurrent.LinkedBlockingQueue;
42 import java.util.concurrent.TimeUnit;
43
44 public class GetObjectName {
45 private static boolean failed = false;
46 public static void main(String[] args) throws Exception {
47 int tasks = 10000;
48 ExecutorService executor = Executors.newFixedThreadPool(10);
49 submitTasks(executor, tasks);
|