Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit40d69f0

Browse files
committed
8254267: javax/xml/crypto/dsig/LogParameters.java failed with "RuntimeException: Unexpected log output:"
Reviewed-by: weijun, dfuchs
1 parent54b8870 commit40d69f0

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

‎test/jdk/javax/xml/crypto/dsig/LogParameters.java‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020,2021,Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,21 +28,31 @@
2828

2929
/**
3030
* @test
31-
* @bug 8247907
31+
* @bug 8247907 8254267
32+
* @summary Tests that parameterized log messages (the ones that use "{}") generated
33+
* through the use of com.sun.org.slf4j.internal.Logger work as expected and the parameter
34+
* values are properly replaced in the logged message.
3235
* @library /test/lib
3336
* @modules java.xml.crypto/com.sun.org.slf4j.internal
37+
* @run main/othervm LogParameters
3438
*/
3539
publicclassLogParameters {
40+
41+
privatestaticfinalLoggerjulLogger =Logger.getLogger(LogParameters.class.getName());
42+
3643
publicstaticvoidmain(String[]args) {
3744

3845
ByteArrayOutputStreambout =newByteArrayOutputStream();
39-
Logger.getLogger(String.class.getName()).setLevel(Level.ALL);
46+
julLogger.setLevel(Level.ALL);
4047
Handlerh =newStreamHandler(bout,newSimpleFormatter());
4148
h.setLevel(Level.ALL);
42-
Logger.getLogger(String.class.getName()).addHandler(h);
49+
julLogger.addHandler(h);
4350

51+
// now create a com.sun.org.slf4j.internal.Logger for the same class
52+
// for which we just configured the java.util.logging.Logger instance
4453
com.sun.org.slf4j.internal.Loggerlog =
45-
com.sun.org.slf4j.internal.LoggerFactory.getLogger(String.class);
54+
com.sun.org.slf4j.internal.LoggerFactory.getLogger(LogParameters.class);
55+
// issue a parameterized log message
4656
log.debug("I have {} {}s.",10,"apple");
4757

4858
h.flush();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp