Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix report truncation #247

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/nl/nn/testtool/Checkpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public <T> T setMessage(T message) {
// message to a value that shows that Ladybug is waiting for the stream to be read, captured and closed or any
// other message
ToStringResult toStringResult = report.getMessageEncoder().toString(message, null);
log.info("Executing setMessage(), message's toStringResult is [{}]", toStringResult.getString());
setMessage(toStringResult.getString());
setEncoding(toStringResult.getEncoding());
setMessageClassName(toStringResult.getMessageClassName());
Expand Down Expand Up @@ -218,8 +219,10 @@ public void write(char[] cbuf) {

@Override
public void write(char[] cbuf, int off, int len) {
log.info("String write, len=[{}]", len);
if (length + len > testTool.getMaxMessageLength()) {
if (!truncated) {
log.info("Max length is being exceeded, still writing [{}] characters", testTool.getMaxMessageLength() - length);
super.write(cbuf, off, testTool.getMaxMessageLength() - length);
truncated = true;
}
Expand Down Expand Up @@ -266,8 +269,10 @@ public void write(byte[] b) {

@Override
public void write(byte[] b, int off, int len) {
log.info("Binary write, len=[{}]", len);
if (length + len > testTool.getMaxMessageLength()) {
if (!truncated) {
log.info("Max length is being exceeded, still writing [{}] characters", testTool.getMaxMessageLength() - length);
super.write(b, off, testTool.getMaxMessageLength() - length);
truncated = true;
}
Expand Down
Loading