@@ -0,0 +1,1663 @@
+package im.nll.data.extractor.rule;%0A%0Aimport com.google.common.base.Charsets;%0Aimport com.google.common.io.Resources;%0Aimport im.nll.data.extractor.Extractors;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.util.LinkedHashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * @author %3Ca href=%22mailto:fivesmallq@gmail.com%22%3Efivesmallq%3C/a%3E%0A * @version Revision: 1.0%0A * @date 16/4/7 %E4%B8%8B%E5%8D%886:42%0A */%0Apublic class ExtractRulesTest %7B%0A    private String listHtml2;%0A%0A    @Before%0A    public void before() %7B%0A        try %7B%0A            listHtml2 = Resources.toString(Resources.getResource(%22list2.html%22), Charsets.UTF_8);%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void test() %7B%0A        Map%3CString, String%3E fields = new LinkedHashMap%3C%3E();%0A        fields.put(%22url%22, %22selector:a.attr(href)%22);%0A        fields.put(%22title%22, %22selector:a%22);%0A        fields.put(%22date%22, %22selector:span.fr%22);%0A        ExtractRules rules = ExtractRules%0A                .newRules(%22selector:dd.x_ct1.html%22)%0A                .fields(fields);%0A%0A        List%3CMap%3CString, String%3E%3E datas = Extractors%0A                .on(listHtml2)%0A                .split(rules.getSplit().getExtractor())%0A                .extract(rules.getExtractRules())%0A                .asMapList();%0A        Assert.assertEquals(10, datas.size());%0A        Map%3CString, String%3E data = datas.get(2);%0A        Assert.assertEquals(%22http://infect.dxy.cn/article/486885%22, data.get(%22url%22));%0A        Assert.assertEquals(%225 %E4%B8%AA%E5%B0%8F%E6%B5%8B%E9%AA%8C%EF%BC%9A%E6%95%99%E4%BD%A0%E8%BD%BB%E6%9D%BE%E5%BA%94%E5%AF%B9%E8%89%B0%E9%9A%BE%E6%A2%AD%E8%8F%8C%E6%84%9F%E6%9F%93%22, data.get(%22title%22));%0A        Assert.assertEquals(%222016.03.10%22, data.get(%22date%22));%0A%0A    %7D%0A%7D%0A

add extractRules test