test_class.file: smart-hadoop-support/smart-hadoop/src/test/java/org/smartdata/hdfs/action/TestCheckSumAction.java
test_class.identifier: TestCheckSumAction
test_class.superclass: extends MiniClusterHarness
test_case.body: @Test
    public void testCheckSumAction() throws IOException {
      CheckSumAction checkSumAction = new CheckSumAction();
      checkSumAction.setDfsClient(dfsClient);
      checkSumAction.setContext(smartContext);
      final String file = "/testPath/file1";
      dfsClient.mkdirs("/testPath");
  
      // write to HDFS
      final OutputStream out = dfsClient.create(file, true);
      byte[] content = ("This is a file containing two blocks" +
          "......................").getBytes();
      out.write(content);
      out.close();
  
      Map<String, String> args = new HashMap();
      args.put(CheckSumAction.FILE_PATH, file);
      checkSumAction.init(args);
      checkSumAction.run();
      Assert.assertTrue(checkSumAction.getExpectedAfterRun());
    }
test_case.class_method_signature: TestCheckSumAction.testCheckSumAction()
test_case.full_signature: @Test public void testCheckSumAction()
test_case.identifier: testCheckSumAction
test_case.invocations: setDfsClient setContext mkdirs create getBytes write close put init run assertTrue getExpectedAfterRun
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCheckSumAction()
focal_class.declarator: LOG = LoggerFactory.getLogger(CheckSumAction.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(CheckSumAction.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: fileName
focal_class.modifier: private
focal_class.original_string: private String fileName;
focal_class.type: String
focal_class.var_name: fileName
focal_class.declarator: conf
focal_class.modifier: private
focal_class.original_string: private SmartConf conf;
focal_class.type: SmartConf
focal_class.var_name: conf
focal_class.file: smart-hadoop-support/smart-hadoop/src/main/java/org/smartdata/hdfs/action/CheckSumAction.java
focal_class.identifier: CheckSumAction
focal_class.class_method_signature: CheckSumAction.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: CheckSumAction.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: CheckSumAction.byteArray2HexString(byte[] bytes)
focal_class.full_signature: public static String byteArray2HexString(byte[] bytes)
focal_class.identifier: byteArray2HexString
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes)
focal_class.return: String
focal_class.signature: String byteArray2HexString(byte[] bytes)
focal_class.superclass: extends HdfsAction
focal_method.body: @Override
    public void init(Map<String, String> args) {
      super.init(args);
      fileName = args.get(FILE_PATH);
      this.conf = getContext().getConf();
    }
focal_method.class_method_signature: CheckSumAction.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 getConf getContext
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)