protected void disconnectWagon(Wagon wagon) throws ConnectionException { wagon.removeTransferListener(mockTransferListener); wagon.removeTransferListener(checksumObserver); wagon.disconnect(); }
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(); } } }