protected void initData() {
		SAXReader xmlReader = new SAXReader();
	    Document doc = null;
		try {
			logger.info("reading file " + dataFilename);
			doc = xmlReader.read(new File(dataFilename));
		} catch (DocumentException e) {
			e.printStackTrace();
			logger.error(e.getStackTrace());
			logger.error("data file `" + dataFilename + " not found.");
			System.exit(1);
		}
		Element root = doc.getRootElement();
		
		@SuppressWarnings("unchecked")
		List<Element> eachData = root.elements("data");
		
		data = new Object[eachData.size()][2];

		for (int j=0; j<eachData.size(); j++) {
			// 读取每个data节点
			Element dataEle = eachData.get(j);
			
			// 读取data的match属性
			String dataMatch = dataEle.attributeValue("match");

			// 使用哪种方式搜索，直接使用URL，或者使用输入关键词
			String sw = dataEle.attributeValue("searchway");
			String elementName = null;
			if (null != sw && sw.equals("url")) {
				elementName = "url";
			} else {
				elementName = "keyword";
			}

            Element primaryEle = dataEle.element(elementName);
			String keyword = primaryEle.getText().trim();
			if ("" == keyword) {
				continue;
			}

            Map<String, String> attributes = new HashMap<>();
            for (Iterator iterator = primaryEle.attributeIterator(); iterator.hasNext(); ) {
                Attribute attribute = (Attribute) iterator.next();
                QName qName = attribute.getQName();
                String value = attribute.getValue();

                attributes.put(qName.getName(), value);
            }

            data[j] = new Object[] {keyword, attributes};
			match.put(keyword, dataMatch);
			if (null != sw) {
				searchWay.put(keyword, sw.trim());
			}

			// 读取每个keyword的期望值
			@SuppressWarnings("unchecked")
			List<Element> allExpects = dataEle.elements("expect");
			if (allExpects.size() > 0) {
				String[] expect = new String[allExpects.size()];
				for (int i=0; i<allExpects.size(); i++) {
					expect[i] = allExpects.get(i).getText().trim();
				}
				definedResults.put(keyword, expect);
			}
		}
	}