CopyFile extends MetadataAPIBase { @Override public FileInfo execute(String[] params) { try { CommandLine commandLine = getCommandLine(params, PARAMS_STRUCTURE); int dsid = Integer.parseInt(commandLine.getOptionValue("destination-server-id")); LOGGER.debug("destination-server-id is " + dsid); Long sbid = Long.parseLong(commandLine.getOptionValue("source-batch-id")); LOGGER.debug("source-batch-id is " + sbid); Long dbid = Long.parseLong(commandLine.getOptionValue("destination-batch-id")); LOGGER.debug("destination-batch-id is " + dbid); String prefix = commandLine.getOptionValue("destination-path-prefix"); LOGGER.debug("destination-batch-id is " + prefix); CopyFileInfo copyFileInfo = new CopyFileInfo(); copyFileInfo.setDestBatchId(dbid); copyFileInfo.setDestPrefix(prefix); copyFileInfo.setDestServerId(dsid); copyFileInfo.setSourceBatchId(sbid); return copyFileDAO.copyFile(copyFileInfo); } catch (Exception e) { LOGGER.error("Error occurred", e); throw new MetadataException(e); } } CopyFile(); @Override FileInfo execute(String[] params);  }
@Ignore @Test public void testExecute() throws Exception { CopyFile copyFile = new CopyFile(); String[] param = new String[]{"-dsid", "123461", "-sbid", "1", "-dbid", "2", "-prefix", "Test123"}; FileInfo fileInfo = copyFile.execute(param); LOGGER.info(fileInfo); }