@Test public void testRecordingInfoWithoutConfig() throws ParserConfigurationException, SAXException, IOException { File configFile = new File(baseDir, "config.xml"); assertFalse(configFile.exists()); assertFalse(SetupOptions.recordingInfo("foo")); }
public static boolean recordingInfo(String testName) throws ParserConfigurationException, SAXException, IOException { TECore.rootTestName.clear(); String path = getBaseConfigDirectory() + "/config.xml"; if (new File(path).exists()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setExpandEntityReferences(false); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(path); NodeList nodeListForStandardTag = doc.getElementsByTagName("standard"); if (null!=nodeListForStandardTag && nodeListForStandardTag.getLength() > 0) { for (int i = 0; i < nodeListForStandardTag.getLength(); i++) { Element elementStandard = (Element) nodeListForStandardTag.item(i); if (testName.equals(elementStandard.getElementsByTagName("local-name").item(0).getTextContent())) { if (null!=elementStandard.getElementsByTagName("record").item(0)) { System.setProperty("Record", "True"); NodeList rootTestNameArray=elementStandard.getElementsByTagName("test-name"); if (null!=rootTestNameArray && rootTestNameArray.getLength() > 0) { for (int counter = 0; counter < rootTestNameArray.getLength(); counter++) { Element rootTestName = (Element) rootTestNameArray.item(counter); TECore.rootTestName.add(rootTestName.getTextContent()); } } return true; } } } } } System.setProperty("Record", "False"); return false; }
SetupOptions { public static boolean recordingInfo(String testName) throws ParserConfigurationException, SAXException, IOException { TECore.rootTestName.clear(); String path = getBaseConfigDirectory() + "/config.xml"; if (new File(path).exists()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setExpandEntityReferences(false); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(path); NodeList nodeListForStandardTag = doc.getElementsByTagName("standard"); if (null!=nodeListForStandardTag && nodeListForStandardTag.getLength() > 0) { for (int i = 0; i < nodeListForStandardTag.getLength(); i++) { Element elementStandard = (Element) nodeListForStandardTag.item(i); if (testName.equals(elementStandard.getElementsByTagName("local-name").item(0).getTextContent())) { if (null!=elementStandard.getElementsByTagName("record").item(0)) { System.setProperty("Record", "True"); NodeList rootTestNameArray=elementStandard.getElementsByTagName("test-name"); if (null!=rootTestNameArray && rootTestNameArray.getLength() > 0) { for (int counter = 0; counter < rootTestNameArray.getLength(); counter++) { Element rootTestName = (Element) rootTestNameArray.item(counter); TECore.rootTestName.add(rootTestName.getTextContent()); } } return true; } } } } } System.setProperty("Record", "False"); return false; } }
SetupOptions { public static boolean recordingInfo(String testName) throws ParserConfigurationException, SAXException, IOException { TECore.rootTestName.clear(); String path = getBaseConfigDirectory() + "/config.xml"; if (new File(path).exists()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setExpandEntityReferences(false); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(path); NodeList nodeListForStandardTag = doc.getElementsByTagName("standard"); if (null!=nodeListForStandardTag && nodeListForStandardTag.getLength() > 0) { for (int i = 0; i < nodeListForStandardTag.getLength(); i++) { Element elementStandard = (Element) nodeListForStandardTag.item(i); if (testName.equals(elementStandard.getElementsByTagName("local-name").item(0).getTextContent())) { if (null!=elementStandard.getElementsByTagName("record").item(0)) { System.setProperty("Record", "True"); NodeList rootTestNameArray=elementStandard.getElementsByTagName("test-name"); if (null!=rootTestNameArray && rootTestNameArray.getLength() > 0) { for (int counter = 0; counter < rootTestNameArray.getLength(); counter++) { Element rootTestName = (Element) rootTestNameArray.item(counter); TECore.rootTestName.add(rootTestName.getTextContent()); } } return true; } } } } } System.setProperty("Record", "False"); return false; } SetupOptions(); }
SetupOptions { public static boolean recordingInfo(String testName) throws ParserConfigurationException, SAXException, IOException { TECore.rootTestName.clear(); String path = getBaseConfigDirectory() + "/config.xml"; if (new File(path).exists()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setExpandEntityReferences(false); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(path); NodeList nodeListForStandardTag = doc.getElementsByTagName("standard"); if (null!=nodeListForStandardTag && nodeListForStandardTag.getLength() > 0) { for (int i = 0; i < nodeListForStandardTag.getLength(); i++) { Element elementStandard = (Element) nodeListForStandardTag.item(i); if (testName.equals(elementStandard.getElementsByTagName("local-name").item(0).getTextContent())) { if (null!=elementStandard.getElementsByTagName("record").item(0)) { System.setProperty("Record", "True"); NodeList rootTestNameArray=elementStandard.getElementsByTagName("test-name"); if (null!=rootTestNameArray && rootTestNameArray.getLength() > 0) { for (int counter = 0; counter < rootTestNameArray.getLength(); counter++) { Element rootTestName = (Element) rootTestNameArray.item(counter); TECore.rootTestName.add(rootTestName.getTextContent()); } } return true; } } } } } System.setProperty("Record", "False"); return false; } SetupOptions(); static File getBaseConfigDirectory(); static boolean recordingInfo(String testName); String getSourcesName(); void setSourcesName(String sourcesName); File getWorkDir(); List<File> getSources(); void addSource(File source); Element getParamsElement(); boolean isValidate(); void setValidate(boolean validate); boolean isPreload(); void setPreload(boolean preload); }
SetupOptions { public static boolean recordingInfo(String testName) throws ParserConfigurationException, SAXException, IOException { TECore.rootTestName.clear(); String path = getBaseConfigDirectory() + "/config.xml"; if (new File(path).exists()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setExpandEntityReferences(false); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(path); NodeList nodeListForStandardTag = doc.getElementsByTagName("standard"); if (null!=nodeListForStandardTag && nodeListForStandardTag.getLength() > 0) { for (int i = 0; i < nodeListForStandardTag.getLength(); i++) { Element elementStandard = (Element) nodeListForStandardTag.item(i); if (testName.equals(elementStandard.getElementsByTagName("local-name").item(0).getTextContent())) { if (null!=elementStandard.getElementsByTagName("record").item(0)) { System.setProperty("Record", "True"); NodeList rootTestNameArray=elementStandard.getElementsByTagName("test-name"); if (null!=rootTestNameArray && rootTestNameArray.getLength() > 0) { for (int counter = 0; counter < rootTestNameArray.getLength(); counter++) { Element rootTestName = (Element) rootTestNameArray.item(counter); TECore.rootTestName.add(rootTestName.getTextContent()); } } return true; } } } } } System.setProperty("Record", "False"); return false; } SetupOptions(); static File getBaseConfigDirectory(); static boolean recordingInfo(String testName); String getSourcesName(); void setSourcesName(String sourcesName); File getWorkDir(); List<File> getSources(); void addSource(File source); Element getParamsElement(); boolean isValidate(); void setValidate(boolean validate); boolean isPreload(); void setPreload(boolean preload); static final String TE_BASE; }