/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6882376 6985460 8010309
* @summary Test if java.util.logging.Logger is created before and after
* logging is enabled. Also validate some basic PlatformLogger
* operations. othervm mode to make sure java.util.logging
* is not initialized.
*
* @compile -XDignore.symbol.file PlatformLoggerTest.java
*/
public class PlatformLoggerTest {
// test the PlatformLogger methods
// Create a platform logger using the default
// create a java.util.logging.Logger
// now java.util.logging.Logger should be created for each platform logger
// test the PlatformLogger methods
}
// don't use java.util.logging here to prevent it from initialized
throw new RuntimeException("Invalid logger's name " +
}
throw new RuntimeException("Invalid default level for logger " +
}
}
private static void checkLoggable(PlatformLogger logger, PlatformLogger.Level level, boolean expected) {
}
}
" not loggable");
}
}
throw new RuntimeException("Invalid level for logger " +
}
throw new RuntimeException("Invalid level for logger " +
}
}
" does not exist");
}
throw new RuntimeException("Invalid level for logger " +
}
}
// test Object[]
}
};
" standard java.util.logging levels - the numbers should be equal.");
}
// check mappings
}
}
}
}
throw new RuntimeException("Retrieved PlatformLogger level "
+ " is not the same as set level " + plevel);
}
// check the level set in java.util.logging.Logger
throw new RuntimeException("Retrieved backing java.util.logging.Logger level "
}
}
// map the given level to PlatformLogger.Level of the same name and value
+ " PlatformLogger.Level" + platformLevel);
}
try {
// validate if there is a public static final field in PlatformLogger
if (l != platformLevel.intValue()) {
}
} catch (Exception e) {
" field", e);
}
}
return res;
}
static class Point {
final int x;
final int y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
return "{x="+x + ", y=" + y + "}";
}
}
}