예제 #1
0
  protected void connectWagon(Wagon wagon) throws ConnectionException, AuthenticationException {
    wagon.addTransferListener(checksumObserver);

    wagon.addTransferListener(mockTransferListener);

    wagon.connect(testRepository, getAuthInfo());
  }
예제 #2
0
  public void testFailedGetIfNewer() throws Exception {
    if (supportsGetIfNewer()) {
      setupRepositories();
      setupWagonTestingFixtures();
      message("Getting test artifact from test repository " + testRepository);
      Wagon wagon = getWagon();
      wagon.addTransferListener(checksumObserver);
      wagon.connect(testRepository, getAuthInfo());
      destFile = FileTestUtils.createUniqueFile(getName(), getName());
      destFile.deleteOnExit();
      try {
        wagon.getIfNewer("fubar.txt", destFile, 0);
        fail("File was found when it shouldn't have been");
      } catch (ResourceDoesNotExistException e) {
        // expected
        assertTrue(true);
      } finally {
        wagon.removeTransferListener(checksumObserver);

        wagon.disconnect();

        tearDownWagonTestingFixtures();
      }
    }
  }
예제 #3
0
  protected Wagon getWagon() throws Exception {
    Wagon wagon = (Wagon) lookup(Wagon.ROLE, getProtocol());

    Debug debug = new Debug();

    wagon.addSessionListener(debug);

    wagon.addTransferListener(debug);

    return wagon;
  }