Closed symwell closed 1 year ago
The commit tagged refactor
should really have been a fixup!
commit. Please be sure to combine it with the previous one before merging.
I know it wasn't part of your changes, but can you update this test, too, please:
@Test
public void testUnwriteableOutputFile() throws IOException {
Recorder recorder = recordEvents();
final Recording recording = recorder.stop();
Exception exception = null;
try {
recording.moveTo("/no-such-directory");
} catch (RuntimeException e) {
exception = e;
}
assertNotNull(exception);
assertTrue(exception.toString().indexOf("java.lang.RuntimeException: ") == 0);
}
recording.moveTo("/no-such-directory")
succeeds if the user has permission to write /
. This can happen if you're running the tests in a docker container, e.g. on macOS to make sure they all pass.
Changing it to recording.moveTo("/no-such-directory/.")
will cause it to fail as expected.
Changing it to
recording.moveTo("/no-such-directory/.")
will cause it to fail as expected.
Good catch! Changed.
:tada: This PR is included in version 1.15.6 :tada:
The release is available on:
v1.15.6
Your semantic-release bot :package::rocket:
Before this change, when
moveTo
copied a file across filesystems it triggered and caught anAtomicMoveNotSupportedException
exception, printed it out, and then tried to copy the file in other ways which eventually succeeded. This had the side effect of printing the exception even thoughmoveTo
succeeded.After this change,
moveTo
doesn't print any exceptions if it succeeds.testWriteFileAcrossFilesystems
andtestCantOverwriteTargetFile
. Didn't add a third test for the third FileMover for Files.copy because it seems to be covered bytestUnwriteableOutputFile
.Added an integration testagent/test/filemover
that verifies theInvalid cross-device link
error message from theAtomicMoveNotSupportedException
isn't printed.Before the change inRecording.java
, the new integration test failed.After the change inRecording.java
, the new integration test passes.Fixes https://github.com/getappmap/appmap-java/issues/162