/** * Mocks FSNamesystem instance, adds an empty file and invokes lease recovery * method. * @throws IOException in case of an error */ @Test public void testInternalReleaseLease_allCOMPLETE () throws IOException { if(LOG.isDebugEnabled()) { LOG.debug("Running " + GenericTestUtils.getMethodName()); } LeaseManager.Lease lm = mock(LeaseManager.Lease.class); Path file = spy(new Path("/test.dat")); DatanodeDescriptor dnd = mock(DatanodeDescriptor.class); PermissionStatus ps = new PermissionStatus("test", "test", new FsPermission((short)0777)); fsn.dir.addFile(file.toString(), ps, (short)3, 1l, "test", "test-machine", dnd, 1001l); assertTrue("True has to be returned in this case", fsn.internalReleaseLease(lm, file.toString(), null)); }
when(iNFmock.isUnderConstruction()).thenReturn(true); when(iNFmock.convertToInodeFile()).thenReturn(iNFmock); fsDir.addFile(file.toString(), ps, (short)3, 1l, "test", "test-machine", dnd, 1001l);
INodeFileUnderConstruction newNode = dir.addFile( src, names, components, inodes, permissions, replication, blockSize, holder, clientMachine, clientNode, genstamp);
INodeFileUnderConstruction newNode = dir.addFile(src, permissions, replication, blockSize, holder, clientMachine, clientNode, genstamp); if (newNode == null) {
.createAncestorDirectories(dir, iip, permissions); if (parent != null) { iip = dir.addFile(parent.getKey(), parent.getValue(), permissions, replication, blockSize, holder, clientMachine); newNode = iip != null ? iip.getLastINode().asFile() : null;
.createAncestorDirectories(dir, iip, permissions); if (parent != null) { iip = dir.addFile(parent.getKey(), parent.getValue(), permissions, replication, blockSize, holder, clientMachine); newNode = iip != null ? iip.getLastINode().asFile() : null;