test_class.file: smart-hadoop-support/smart-hadoop/src/test/java/org/smartdata/hdfs/action/TestListFileAction.java
test_class.identifier: TestListFileAction
test_class.superclass: extends MiniClusterHarness
test_case.body: @Test
    public void testLocalFileList() throws Exception {
      final String srcPath = "/testList";
      final String file1 = "file1";
      final String file2 = "file2";
      final String dir = "/childDir";
      final String dirFile1 = "childDirFile1";
      dfs.mkdirs(new Path(srcPath));
      dfs.mkdirs(new Path(srcPath + dir));
      //write to DISK
      FSDataOutputStream out1 = dfs.create(new Path(dfs.getUri() + srcPath + "/" + file1));
      out1.writeChars("test");
      out1.close();
      out1 = dfs.create(new Path(srcPath + "/" + file2));
      out1.writeChars("test");
      out1.close();
      out1 = dfs.create(new Path(srcPath + dir + "/" + dirFile1));
      out1.writeChars("test");
      out1.close();
  
      Assert.assertTrue(dfsClient.exists(srcPath + "/" + file1));
      Assert.assertTrue(dfsClient.exists(srcPath + "/" + file2));
      Assert.assertTrue(dfsClient.exists(srcPath + dir + "/" + dirFile1));
  
      ListFileAction listFileAction = new ListFileAction();
      listFileAction.setDfsClient(dfsClient);
      listFileAction.setContext(smartContext);
      Map<String , String> args = new HashMap<>();
      args.put(ListFileAction.FILE_PATH , srcPath);
      listFileAction.init(args);
      listFileAction.run();
      Assert.assertTrue(listFileAction.getExpectedAfterRun());
  
      listFileAction = new ListFileAction();
      listFileAction.setDfsClient(dfsClient);
      listFileAction.setContext(smartContext);
      args = new HashMap<>();
      args.put(ListFileAction.FILE_PATH , srcPath + "/" + file1);
      listFileAction.init(args);
      listFileAction.run();
      Assert.assertTrue(listFileAction.getExpectedAfterRun());
    }
test_case.class_method_signature: TestListFileAction.testLocalFileList()
test_case.full_signature: @Test public void testLocalFileList()
test_case.identifier: testLocalFileList
test_case.invocations: mkdirs mkdirs create getUri writeChars close create writeChars close create writeChars close assertTrue exists assertTrue exists assertTrue exists setDfsClient setContext put init run assertTrue getExpectedAfterRun setDfsClient setContext put init run assertTrue getExpectedAfterRun
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLocalFileList()
focal_class.declarator: LOG = LoggerFactory.getLogger(ListFileAction.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(ListFileAction.class);
focal_class.type: Logger
focal_class.var_name: LOG
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: recursively = false
focal_class.modifier: private
focal_class.original_string: private boolean recursively = false;
focal_class.type: boolean
focal_class.var_name: recursively
focal_class.declarator: dump = false
focal_class.modifier: private
focal_class.original_string: private boolean dump = false;
focal_class.type: boolean
focal_class.var_name: dump
focal_class.declarator: human = false
focal_class.modifier: private
focal_class.original_string: private boolean human = false;
focal_class.type: boolean
focal_class.var_name: human
focal_class.declarator: RECURSIVELY = "-R"
focal_class.modifier: public static final
focal_class.original_string: public static final String RECURSIVELY = "-R";
focal_class.type: String
focal_class.var_name: RECURSIVELY
focal_class.declarator: DUMP = "-d"
focal_class.modifier: public static final
focal_class.original_string: public static final String DUMP = "-d";
focal_class.type: String
focal_class.var_name: DUMP
focal_class.declarator: HUMAN = "-h"
focal_class.modifier: public static final
focal_class.original_string: public static final String HUMAN = "-h";
focal_class.type: String
focal_class.var_name: HUMAN
focal_class.file: smart-hadoop-support/smart-hadoop/src/main/java/org/smartdata/hdfs/action/ListFileAction.java
focal_class.identifier: ListFileAction
focal_class.class_method_signature: ListFileAction.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: ListFileAction.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: ListFileAction.readableFileSize(long size)
focal_class.full_signature: private static String readableFileSize(long size)
focal_class.identifier: readableFileSize
focal_class.modifiers: private static
focal_class.parameters: (long size)
focal_class.return: String
focal_class.signature: String readableFileSize(long size)
focal_class.class_method_signature: ListFileAction.listDirectory(String src)
focal_class.full_signature: private void listDirectory(String src)
focal_class.identifier: listDirectory
focal_class.modifiers: private
focal_class.parameters: (String src)
focal_class.return: void
focal_class.signature: void listDirectory(String src)
focal_class.superclass: extends HdfsAction
focal_method.body: @Override
    public void init(Map<String, String> args) {
      super.init(args);
      if (args.containsKey(RECURSIVELY)) {
        this.recursively = true;
        if (this.srcPath == null || this.srcPath == "")
          this.srcPath = args.get(RECURSIVELY);
      }
      if (args.containsKey(DUMP)) {
        this.dump = true;
        if (this.srcPath == null || this.srcPath == "")
          this.srcPath = args.get(DUMP);
      }
      if (args.containsKey(HUMAN)) {
        this.human = true;
        if (this.srcPath == null || this.srcPath == "")
          this.srcPath = args.get(HUMAN);
      }
      if (this.srcPath == null || this.srcPath == "")
        this.srcPath = args.get(FILE_PATH);
    }
focal_method.class_method_signature: ListFileAction.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 containsKey get containsKey get containsKey get 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)