package cn.devit.tools.jenkins;

import org.junit.Test;

import java.net.URL;
import java.util.List;

import static org.junit.Assert.assertEquals;

/**
 * <p>
 *
 * @author lxb
 */
public class IndexFileParserTest {
    @Test
    public void parseIndexFile() throws Exception {
        final List<IndexFileParser.IndexItem> list = new IndexFileParser()
                .parseIndexFile(
                        new URL("http://updates.jenkins-ci.org/current/"));
        assertEquals(list.size(), 9);
    }

    @Test
    public void tsinghua() throws Exception {
        final List<IndexFileParser.IndexItem> list = new IndexFileParser()
                .parseIndexFile(
                        new URL("https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current"));
        assertEquals(list.size(), 7);
    }
    @Test
    public void ustc() throws Exception {
        final List<IndexFileParser.IndexItem> list = new IndexFileParser()
                .parseIndexFile(
                        new URL("https://mirrors.ustc.edu.cn/jenkins/updates/current/"));
        assertEquals(list.size(), 7);
    }

}
@@ -493,9 +493,10 @@
 (), 
-9
+11
 );%0A 
@@ -789,33 +789,33 @@
 ls(list.size(), 
-7
+8
 );%0A    %7D%0A    @Te
@@ -1095,9 +1095,9 @@
 (), 
-7
+8
 );%0A 

Update test case.