Skip to content

Commit 61442bc

Browse files
committed
Edit TestArrowBuf#testEnabledHistoricalLog to have more info
Log what message was reported if the message didn't contain the correct information.
1 parent 74ac115 commit 61442bc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

java/memory/memory-core/src/test/java/org/apache/arrow/memory/TestArrowBuf.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,15 @@ public void testEnabledHistoricalLog() {
167167
fieldDebug.set(null, true);
168168
try (BufferAllocator allocator = new RootAllocator(128)) {
169169
allocator.buffer(2);
170-
Exception e = assertThrows(IllegalStateException.class, () -> allocator.close());
171-
assertTrue(e.getMessage().contains("event log for:")); // JDK8, JDK11
170+
Exception e = assertThrows(IllegalStateException.class, allocator::close);
171+
assertTrue("Exception had the following message: " + e.getMessage(),
172+
e.getMessage().contains("event log for:")); // JDK8, JDK11
172173
} finally {
173174
fieldDebug.set(null, false);
174175
}
175176
} catch (Exception e) {
176-
assertTrue(e.toString().contains("java.lang.NoSuchFieldException: modifiers")); // JDK17+
177+
assertTrue("Exception had the following toString(): " + e.toString(),
178+
e.toString().contains("java.lang.NoSuchFieldException: modifiers")); // JDK17+
177179
} finally {
178180
((Logger) LoggerFactory.getLogger("org.apache.arrow")).setLevel(null);
179181
}

0 commit comments

Comments
 (0)