@Test public void moveFileToExistingDestinationWithoutOverwrite() throws Exception { createFile("/src"); createFile("/dst"); // Test with source being a file. try { assignMovesFail("/src", "/dst"); } catch (FileAlreadyExistsException e) { Assert.assertEquals(ExceptionMessage.MOVE_NEED_OVERWRITE.getMessage("/dst"), e.getMessage()); } }
@Test public void moveDirectoryToExistingDestinationWithoutOverwrite() throws Exception { // Test with the source being a folder. createDirectory("/src"); createDirectory("/dst"); try { assignMovesFail("/src", "/dst"); } catch (FileAlreadyExistsException e) { Assert.assertEquals(ExceptionMessage.MOVE_NEED_OVERWRITE.getMessage("/dst"), e.getMessage()); } }
assertEquals( ExceptionMessage.FILE_ALREADY_EXISTS.getMessage(new AlluxioURI("alluxio:/a")), e.getMessage()); assertEquals( ExceptionMessage.FILE_ALREADY_EXISTS.getMessage(new AlluxioURI("alluxio:/a/f2")), e.getMessage());
assertTrue("createPath should throw FileAlreadyExistsException", false); } catch (FileAlreadyExistsException e) { assertEquals(e.getMessage(), ExceptionMessage.FILE_ALREADY_EXISTS.getMessage(NESTED_URI));
} catch (FileAlreadyExistsException e) { assertEquals(ExceptionMessage.FILE_ALREADY_EXISTS.getMessage(NESTED_URI.getPath()), e.getMessage());