test_class.file: smart-hadoop-support/smart-hadoop/src/test/java/org/smartdata/hdfs/action/TestRenameFileAction.java
test_class.identifier: TestRenameFileAction
test_class.superclass: extends MiniClusterHarness
test_case.body: @Test
    public void testLocalFileRename() throws IOException {
      final String srcPath = "/testRename";
      final String file1 = "file1";
      final String destPath = "/destDir";
      final String destFilename = "file2";
      Path srcDir = new Path(srcPath);
      dfs.mkdirs(srcDir);
      //the parent dir need to be exist
      dfs.mkdirs(new Path(destPath));
      //write to DISK
      final FSDataOutputStream out1 = dfs.create(new Path(srcPath + "/" + file1));
      out1.writeChars("testCopy1");
      out1.close();
      Assert.assertTrue(dfsClient.exists(srcPath + "/" + file1));
  
      RenameFileAction renameFileAction = new RenameFileAction();
      renameFileAction.setDfsClient(dfsClient);
      renameFileAction.setContext(smartContext);
      Map<String, String> args = new HashMap<>();
      args.put(RenameFileAction.FILE_PATH, srcPath + "/" + file1);
      args.put(RenameFileAction.DEST_PATH, destPath + "/" + destFilename);
      renameFileAction.init(args);
      renameFileAction.run();
      Assert.assertTrue(renameFileAction.getExpectedAfterRun());
      Assert.assertFalse(dfsClient.exists(srcPath + "/" + file1));
      Assert.assertTrue(dfsClient.exists(destPath + "/" + destFilename));
    }
test_case.class_method_signature: TestRenameFileAction.testLocalFileRename()
test_case.full_signature: @Test public void testLocalFileRename()
test_case.identifier: testLocalFileRename
test_case.invocations: mkdirs mkdirs create writeChars close assertTrue exists setDfsClient setContext put put init run assertTrue getExpectedAfterRun assertFalse exists assertTrue exists
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLocalFileRename()
focal_class.declarator: LOG =
        LoggerFactory.getLogger(RenameFileAction.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG =
        LoggerFactory.getLogger(RenameFileAction.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: DEST_PATH = "-dest"
focal_class.modifier: public static final
focal_class.original_string: public static final String DEST_PATH = "-dest";
focal_class.type: String
focal_class.var_name: DEST_PATH
focal_class.declarator: srcPath
focal_class.modifier: private
focal_class.original_string: private String srcPath;
focal_class.type: String
focal_class.var_name: srcPath
focal_class.declarator: destPath
focal_class.modifier: private
focal_class.original_string: private String destPath;
focal_class.type: String
focal_class.var_name: destPath
focal_class.file: smart-hadoop-support/smart-hadoop/src/main/java/org/smartdata/hdfs/action/RenameFileAction.java
focal_class.identifier: RenameFileAction
focal_class.class_method_signature: RenameFileAction.init(Map<String, String> args)
focal_class.full_signature: @Override public void init(Map<String, String> args)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, String> args)
focal_class.return: void
focal_class.signature: void init(Map<String, String> args)
focal_class.class_method_signature: RenameFileAction.execute()
focal_class.full_signature: @Override protected void execute()
focal_class.identifier: execute
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: RenameFileAction.renameSingleFile(String src,
        String dest)
focal_class.full_signature: private boolean renameSingleFile(String src,
        String dest)
focal_class.identifier: renameSingleFile
focal_class.modifiers: private
focal_class.parameters: (String src,
        String dest)
focal_class.return: boolean
focal_class.signature: boolean renameSingleFile(String src,
        String dest)
focal_class.superclass: extends HdfsAction
focal_method.body: @Override
    public void init(Map<String, String> args) {
      super.init(args);
      this.srcPath = args.get(FILE_PATH);
      if (args.containsKey(DEST_PATH)) {
        this.destPath = args.get(DEST_PATH);
      }
    }
focal_method.class_method_signature: RenameFileAction.init(Map<String, String> args)
focal_method.full_signature: @Override public void init(Map<String, String> args)
focal_method.identifier: init
focal_method.invocations: init get containsKey get
focal_method.modifiers: @Override public
focal_method.parameters: (Map<String, String> args)
focal_method.return: void
focal_method.signature: void init(Map<String, String> args)