test/java/fr/jayasoft/ivy/repository/vfs/VfsRepositoryTest.java
/**
	 * Test the retrieval of an artifact from the repository creating a new artifact
	 * 
	 * @throws Exception
	 */
Test the retrieval of an artifact from the repository creating a new artifact

@throws Exception
Test the retrieval of an artifact from the repository creating a new artifact @throws Exception
public void testGetNoExisting() throws Exception {
		String testResource = VfsTestHelper.TEST_IVY_XML;
		String testFile = FileUtil.concat(scratchDir.getAbsolutePath(), 
				                                 testResource);
		Iterator vfsURIs = helper.createVFSUriSet(testResource).iterator();
		while (vfsURIs.hasNext()) {
			VfsURI vfsURI = (VfsURI) vfsURIs.next();
			if (scratchDir.exists()) {
				FileUtil.forceDelete(scratchDir);
			}
			try {
				repo.get(vfsURI.toString(), new File(testFile));
				if (! new File(testFile).exists()) {
					fail("Expected file: " + testFile + "not found. Failed vfsURI: " + vfsURI.toString());
				}
			} catch (IOException e) {
				fail("Caught unexpected IOException on Vfs URI: " + vfsURI.toString() + "\n" + e.getLocalizedMessage());
			}
		}
	}
public void testGetNoExisting ( ) throws Exception { String testResource = VfsTestHelper . TEST_IVY_XML ; String testFile = FileUtil . concat ( scratchDir . getAbsolutePath ( ) , testResource ) ; Iterator vfsURIs = helper . createVFSUriSet ( testResource ) . iterator ( ) ; while ( vfsURIs . hasNext ( ) ) { VfsURI vfsURI = ( VfsURI ) vfsURIs . next ( ) ; if ( scratchDir . exists ( ) ) { FileUtil . forceDelete ( scratchDir ) ; } try { repo . get ( vfsURI . toString ( ) , new File ( testFile ) ) ; if ( ! new File ( testFile ) . exists ( ) ) { fail ( "Expected file: " + testFile + "not found. Failed vfsURI: " + vfsURI . toString ( ) ) ; } } catch ( IOException e ) { fail ( "Caught unexpected IOException on Vfs URI: " + vfsURI . toString ( ) + "\n" + e . getLocalizedMessage ( ) ) ; } } }
Test the retrieval of an artifact from the repository creating a new artifact
Test the retrieval of an artifact from the repository creating a new artifact