@@ -0,0 +1,2338 @@
+package hudson.plugins.git.browser;%0A%0Aimport hudson.plugins.git.GitChangeSet;%0Aimport java.net.URL;%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0Aimport org.junit.Test;%0Aimport static org.junit.Assert.*;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0A%0A@RunWith(Parameterized.class)%0Apublic class GitilesTest %7B%0A%0A    private final String repoUrl = %22https://gwt.googlesource.com/gwt/%22;%0A%0A    private final boolean useAuthorName;%0A    private final GitChangeSetSample sample;%0A%0A    public GitilesTest(String useAuthorName) %7B%0A        this.useAuthorName = Boolean.valueOf(useAuthorName);%0A        sample = new GitChangeSetSample(this.useAuthorName);%0A    %7D%0A%0A    @Parameterized.Parameters(name = %22%7B0%7D%22)%0A    public static Collection permuteAuthorName() %7B%0A        List%3CObject%5B%5D%3E values = new ArrayList%3CObject%5B%5D%3E();%0A        String%5B%5D allowed = %7B%22true%22, %22false%22%7D;%0A        for (String authorName : allowed) %7B%0A            Object%5B%5D combination = %7BauthorName%7D;%0A            values.add(combination);%0A        %7D%0A        return values;%0A    %7D%0A%0A    @Test%0A    public void testGetChangeSetLink() throws Exception %7B%0A        URL result = (new Gitiles(repoUrl)).getChangeSetLink(sample.changeSet);%0A        assertEquals(new URL(repoUrl + %22+/%22 + sample.id + %22%255E%2521%22), result);%0A    %7D%0A%0A    @Test%0A    public void testGetDiffLink() throws Exception %7B%0A        Gitiles gitiles = new Gitiles(repoUrl);%0A        for (GitChangeSet.Path path : sample.changeSet.getPaths()) %7B%0A            URL diffLink = gitiles.getDiffLink(path);%0A            URL expectedDiffLink = new URL(repoUrl + %22+/%22 + sample.id + %22%255E%2521%22);%0A            String msg = %22Wrong link for path: %22 + path.getPath() + %22, edit type: %22 + path.getEditType().getName();%0A            assertEquals(msg, expectedDiffLink, diffLink);%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testGetFileLink() throws Exception %7B%0A        Gitiles stash = new Gitiles(repoUrl);%0A        for (GitChangeSet.Path path : sample.changeSet.getPaths()) %7B%0A            URL fileLink = stash.getFileLink(path);%0A            URL expectedFileLink = new URL(repoUrl + %22+blame/%22 + sample.id + %22/%22 + path.getPath());%0A            String msg = %22Wrong link for path: %22 + path.getPath() + %22, edit type: %22 + path.getEditType().getName();%0A            assertEquals(msg, expectedFileLink, fileLink);%0A        %7D%0A    %7D%0A%7D%0A

Add test for Gitiles repo browser