-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
INT-4243: Upgrade to sshd 1.4 #2090
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,13 @@ | |
import static org.junit.Assert.assertThat; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.File; | ||
import java.io.InputStream; | ||
import java.util.List; | ||
import java.util.regex.Matcher; | ||
|
||
import org.apache.log4j.lf5.util.StreamUtils; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ??? Let me guess you were going to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hehe |
||
import org.hamcrest.Matchers; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
@@ -117,12 +119,14 @@ public void testSftpInboundStreamFlow() throws Exception { | |
assertNotNull(message); | ||
assertThat(message.getPayload(), instanceOf(InputStream.class)); | ||
assertThat(message.getHeaders().get(FileHeaders.REMOTE_FILE), isOneOf(" sftpSource1.txt", "sftpSource2.txt")); | ||
StreamUtils.copy((InputStream) message.getPayload(), new ByteArrayOutputStream()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, my solution is actually like this:
Because the problem with the file on Windows that we have an open stream to it. And, yeah..., exactly payload is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok; feel free to fix that way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interestingly, windows did not say that the file deletion failed, just silently left the file in place, preventing the deletion of the directory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, actually it does, if we check the result of the OK, merging having your agreement... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right that's what I am saying; on my Windows VM, the file.delete() was successful (I didn't get the "couldn't delete" message) - that's why I added the additional "Contents" log when the directory delete fails. |
||
new IntegrationMessageHeaderAccessor(message).getCloseableResource().close(); | ||
|
||
message = out.receive(10_000); | ||
assertNotNull(message); | ||
assertThat(message.getPayload(), instanceOf(InputStream.class)); | ||
assertThat(message.getHeaders().get(FileHeaders.REMOTE_FILE), isOneOf("sftpSource1.txt", "sftpSource2.txt")); | ||
StreamUtils.copy((InputStream) message.getPayload(), new ByteArrayOutputStream()); | ||
new IntegrationMessageHeaderAccessor(message).getCloseableResource().close(); | ||
|
||
registration.destroy(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have figure out the problem with files and we don't need these diagnostics any more.
Let me know and I'll polish on merge respectively.
Thank you for the fix any way!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured it won't hurt leaving these at INFO level - in case we have problems in future.