/** * Read the test config file - testConfig.xml */ protected void readTestConfigFile() { String testConfigFile = getTestFile(); if (testsFromConfigFile == null) { boolean success = false; String configFile = System.getProperty("test.cli.config"); if (configFile == null) { testConfigFile = TEST_CACHE_DATA_DIR + File.separator + testConfigFile; } else { testConfigFile = configFile; } try { SAXParser p = (SAXParserFactory.newInstance()).newSAXParser(); p.parse(testConfigFile, new TestConfigFileParser()); LOG.info("Using test config file " + testConfigFile); success = true; } catch (Exception e) { LOG.info("File: " + testConfigFile + " not found"); success = false; } assertTrue("Error reading test config file", success); } }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals("dfs-admin-command")) { if (testCommands != null) { testCommands.add(new CLITestCmdDFS(charString, new CLICommandDFSAdmin())); } else if (cleanupCommands != null) { cleanupCommands.add(new CLITestCmdDFS(charString, new CLICommandDFSAdmin())); } } else { super.endElement(uri, localName, qName); } } }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals("crypto-admin-command")) { if (testCommands != null) { testCommands.add(new CLITestCmdCryptoAdmin(charString, new CLICommandCryptoAdmin())); } else if (cleanupCommands != null) { cleanupCommands.add(new CLITestCmdCryptoAdmin(charString, new CLICommandCryptoAdmin())); } } else { super.endElement(uri, localName, qName); } } }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals("cache-admin-command")) { if (testCommands != null) { testCommands.add(new CLITestCmdCacheAdmin(charString, new CLICommandCacheAdmin())); } else if (cleanupCommands != null) { cleanupCommands.add(new CLITestCmdCacheAdmin(charString, new CLICommandCacheAdmin())); } } else { super.endElement(uri, localName, qName); } } }
/** * Method decides what is a proper configuration file parser for this type * of CLI tests. * Ancestors need to override the implementation if a parser with additional * features is needed. Also, such ancestor has to provide its own * TestConfigParser implementation * @return an instance of TestConfigFileParser class */ protected TestConfigFileParser getConfigParser () { return new TestConfigFileParser(); }
/** * Method decides what is a proper configuration file parser for this type * of CLI tests. * Ancestors need to override the implementation if a parser with additional * features is needed. Also, such ancestor has to provide its own * TestConfigParser implementation * @return an instance of TestConfigFileParser class */ protected TestConfigFileParser getConfigParser () { return new TestConfigFileParser(); }