equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
41 |
41 |
42 LoggingMXBean mBean; |
42 LoggingMXBean mBean; |
43 ObjectName objectName = null; |
43 ObjectName objectName = null; |
44 static String LOGGER_NAME_1 = "com.sun.management.Logger1"; |
44 static String LOGGER_NAME_1 = "com.sun.management.Logger1"; |
45 static String LOGGER_NAME_2 = "com.sun.management.Logger2"; |
45 static String LOGGER_NAME_2 = "com.sun.management.Logger2"; |
|
46 static Logger logger1; |
|
47 static Logger logger2; |
46 |
48 |
47 public LoggingMXBeanTest() throws Exception { |
49 public LoggingMXBeanTest() throws Exception { |
48 |
50 |
49 /* |
51 /* |
50 * Create the MBeanServeri, register the LoggingMXBean |
52 * Create the MBeanServeri, register the LoggingMXBean |
129 System.out.println(""); |
131 System.out.println(""); |
130 System.out.println( "*******************************" ); |
132 System.out.println( "*******************************" ); |
131 System.out.println( "*********** Phase 3 ***********" ); |
133 System.out.println( "*********** Phase 3 ***********" ); |
132 System.out.println( "*******************************" ); |
134 System.out.println( "*******************************" ); |
133 System.out.println( " Create and test new Loggers" ); |
135 System.out.println( " Create and test new Loggers" ); |
134 Logger logger1 = Logger.getLogger( LOGGER_NAME_1 ); |
136 logger1 = Logger.getLogger( LOGGER_NAME_1 ); |
135 Logger logger2 = Logger.getLogger( LOGGER_NAME_2 ); |
137 logger2 = Logger.getLogger( LOGGER_NAME_2 ); |
136 |
138 |
137 // check that Level object are returned properly |
139 // check that Level object are returned properly |
138 try { |
140 try { |
139 list = (String[]) mbs.getAttribute( objectName, "LoggerNames" ); |
141 list = (String[]) mbs.getAttribute( objectName, "LoggerNames" ); |
140 } |
142 } |