View Javadoc
1   package net.trajano.wagon.git.test;
2   
3   import java.io.IOException;
4   
5   import net.trajano.wagon.git.GitWagon;
6   
7   import org.apache.maven.wagon.StreamingWagonTestCase;
8   
9   /**
10   * Tests {@link GitWagon}. Note this test is ignored as it is specific to the
11   * author. However, GitHubPagesWagon and GitWagon share most of their code
12   * except the GitUri building logic.
13   */
14  public class GitHubPagesWagonTest extends StreamingWagonTestCase {
15  
16      /**
17       * Protocol hint.
18       *
19       * @return "github"
20       */
21      @Override
22      protected String getProtocol() {
23          return "github";
24      }
25  
26      /**
27       * Unused in the tests.
28       */
29      @Override
30      protected int getTestRepositoryPort() {
31          return 0;
32      }
33  
34      /**
35       * An existing GitHub Pages repository. The test runner must have access to
36       * this URL to perform the test.
37       *
38       * @return an existing GitHub Pages repository.
39       */
40      @Override
41      protected String getTestRepositoryUrl() throws IOException {
42          return "github:http://site.trajano.net/ZaWorld/";
43      }
44  
45      /**
46       * Create a repository that has at least one commit.
47       */
48      @Override
49      protected void setupWagonTestingFixtures() throws Exception {
50      }
51  
52      /**
53       * Unable to change how the timestamps are set, so getIfNewer is not
54       * testable.
55       */
56      @Override
57      protected boolean supportsGetIfNewer() {
58          return false;
59      }
60  
61      /**
62       * Remove the "remote" directory.
63       */
64      @Override
65      protected void tearDownWagonTestingFixtures() throws Exception {
66      }
67  }