Re: [PR] Adjusting XSLFDrawing's slide shape tree scan in constructor to prevent shape ID warnings. [poi]
pjfanning (via GitHub) <[email protected]> Mon, 20 Jul 2026 16:15:25 -0000
| Newsgroups | gmane.comp.jakarta.poi.devel |
|---|---|
| Message-ID | <PR_kwDOAAMmIM7z7yMa-646d9b20-0290-4cb8-89c5-9a37f74f2f29@gitbox.apache.org> |
pjfanning commented on code in PR #1187:
URL: https://github.com/apache/poi/pull/1187#discussion_r3615761345
##########
poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFGroupShape.java:
##########
@@ -86,6 +95,38 @@ void testCreateShapes() throws Exception {
}
}
+ @Test
+ void testCreatingShapeInGroupDoesNotWarnAboutReusedShapeIds() throws Exception {
+ List<String> capturedWarnings = new ArrayList<>();
+ LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false);
+ Configuration config = loggerContext.getConfiguration();
+ Appender captureAppender = new AbstractAppender("capture-for-test", null, null, false, null) {
+ @Override
+ public void append(LogEvent event) {
+ capturedWarnings.add(event.getMessage().getFormattedMessage());
+ }
+ };
+ captureAppender.start();
+ config.addAppender(captureAppender);
+ config.getRootLogger().addAppender(captureAppender, Level.WARN, null);
+ loggerContext.updateLoggers();
Review Comment:
I must admit to disliking tests that read log messages. Can't we pass the info via the call stack?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]