@Override protected String expandCommand(final String cmd) { String expCmd = cmd; expCmd = expCmd.replaceAll("NAMENODE", namenode); expCmd = super.expandCommand(cmd); return expCmd; }
/** * Expand commands from the test config file. * This method is used in displayResults() and compareTestOutput() only, * so it doesn't have any effect on the test execution itself. * * @param cmd * @return String expanded command */ @Override protected String expandCommand(final String cmd) { String expCmd = super.expandCommand(cmd); // note: super.expandCommand() expands CLITEST_DATA and USERNAME expCmd = expCmd.replaceAll("NAMENODETEST_DIR_ABSOLUTE", NAMENODE_TESTDIR_HACK); expCmd = expCmd.replaceAll("TEST_DIR_ABSOLUTE", TEST_DIR_ABSOLUTE); expCmd = expCmd.replaceAll("supergroup", supergroup); expCmd = expCmd.replaceAll("NAMENODE", namenode); expCmd = expCmd.replaceAll("USER_NAME", username); expCmd = expCmd.replaceAll("HCFS_SCHEME", HCFS_SCHEME); expCmd = expCmd.replaceAll("HCFS_DIRSIZE", HCFS_DIRSIZE); expCmd = expCmd.replaceAll("HCFS_NNMATCH", HCFS_NNMATCH); return expCmd; }
/** * Expand commands from the test config file. * This method is used in displayResults() and compareTestOutput() only, * so it doesn't have any effect on the test execution itself. * * @param cmd * @return String expanded command */ @Override protected String expandCommand(final String cmd) { String expCmd = super.expandCommand(cmd); // note: super.expandCommand() expands CLITEST_DATA and USERNAME expCmd = expCmd.replaceAll("NAMENODETEST_DIR_ABSOLUTE", NAMENODE_TESTDIR_HACK); expCmd = expCmd.replaceAll("TEST_DIR_ABSOLUTE", TEST_DIR_ABSOLUTE); expCmd = expCmd.replaceAll("supergroup", supergroup); expCmd = expCmd.replaceAll("NAMENODE", namenode); expCmd = expCmd.replaceAll("USER_NAME", username); expCmd = expCmd.replaceAll("HCFS_SCHEME", HCFS_SCHEME); expCmd = expCmd.replaceAll("HCFS_DIRSIZE", HCFS_DIRSIZE); expCmd = expCmd.replaceAll("HCFS_NNMATCH", HCFS_NNMATCH); return expCmd; }
/** * Expand commands from the test config file. * This method is used in displayResults() and compareTestOutput() only, * so it doesn't have any effect on the test execution itself. * * @param cmd * @return String expanded command */ @Override protected String expandCommand(final String cmd) { String expCmd = super.expandCommand(cmd); // note: super.expandCommand() expands CLITEST_DATA and USERNAME expCmd = expCmd.replaceAll("NAMENODETEST_DIR_ABSOLUTE", NAMENODE_TESTDIR_HACK); expCmd = expCmd.replaceAll("TEST_DIR_ABSOLUTE", TEST_DIR_ABSOLUTE); expCmd = expCmd.replaceAll("supergroup", supergroup); expCmd = expCmd.replaceAll("NAMENODE", namenode); expCmd = expCmd.replaceAll("USER_NAME", username); expCmd = expCmd.replaceAll("HCFS_SCHEME", HCFS_SCHEME); expCmd = expCmd.replaceAll("HCFS_DIRSIZE", HCFS_DIRSIZE); expCmd = expCmd.replaceAll("HCFS_NNMATCH", HCFS_NNMATCH); return expCmd; }
for (TestCmd cmd : testCommands) { LOG.info(" Test Commands: [" + expandCommand(cmd.getCmd()) + "]"); for (TestCmd cmd : cleanupCommands) { LOG.info(" Cleanup Commands: [" + expandCommand(cmd.getCmd()) + "]");
ComparatorBase comp = (ComparatorBase) comparatorClass.newInstance(); compareOutput = comp.compare(cmdResult.getCommandOutput(), expandCommand(compdata.getExpectedOutput())); } catch (Exception e) { LOG.info("Error in instantiating the comparator" + e);
ComparatorBase comp = (ComparatorBase) comparatorClass.newInstance(); compareOutput = comp.compare(cmdResult.getCommandOutput(), expandCommand(compdata.getExpectedOutput())); } catch (Exception e) { LOG.info("Error in instantiating the comparator" + e);
for (CLICommand cmd : testCommands) { LOG.info(" Test Commands: [" + expandCommand(cmd.getCmd()) + "]"); for (CLICommand cmd : cleanupCommands) { LOG.info(" Cleanup Commands: [" + expandCommand(cmd.getCmd()) + "]"); (resultBoolean ? "pass" : "fail") + "]"); LOG.info(" Expected output: [" + expandCommand(cd.getExpectedOutput()) + "]"); LOG.info(" Actual output: [" + cd.getActualOutput() + "]");
for (CLICommand cmd : testCommands) { LOG.info(" Test Commands: [" + expandCommand(cmd.getCmd()) + "]"); for (CLICommand cmd : cleanupCommands) { LOG.info(" Cleanup Commands: [" + expandCommand(cmd.getCmd()) + "]"); (resultBoolean ? "pass" : "fail") + "]"); LOG.info(" Expected output: [" + expandCommand(cd.getExpectedOutput()) + "]"); LOG.info(" Actual output: [" + cd.getActualOutput() + "]");