test/java/fr/jayasoft/ivy/repository/vfs/VfsResourceTest.java
/**
	 * Validate VFSResource creation when given a poorly formed VFS identifier
	 *
	 */
Validate VFSResource creation when given a poorly formed VFS identifier
Validate VFSResource creation when given a poorly formed VFS identifier
public void testBadURI() throws Exception {
		String vfsURI = "smb1:/goobeldygook";
		VfsResource res = new VfsResource(vfsURI, helper.fsManager);
		if (res == null) {
			fail("Unexpected null value on VFS URI: " + vfsURI);
		}
		if (res.exists()) {
			fail("Resource is marked as existing and it should not: " + vfsURI);
		}
		if (! res.getName().equals("smb1:/goobeldygook")) {
			fail("Failed on getName. Expected: " + vfsURI + ". Actual: " + res.getName());
		}
		if (res.getLastModified() != 0 ) {
			fail("Expected null file modification date for URI: " + vfsURI + ": " + res.getLastModified());
		}
		if (res.getContentLength() != 0 ) {
			fail("Expected zero file length for URI: " + vfsURI);				
		}
		if (res.physicallyExists()) {
			fail("Physical existence check returned false for existing resource: " + vfsURI);								
		}
	}
public void testBadURI ( ) throws Exception { String vfsURI = "smb1:/goobeldygook" ; VfsResource res = new VfsResource ( vfsURI , helper . fsManager ) ; if ( res == null ) { fail ( "Unexpected null value on VFS URI: " + vfsURI ) ; } if ( res . exists ( ) ) { fail ( "Resource is marked as existing and it should not: " + vfsURI ) ; } if ( ! res . getName ( ) . equals ( "smb1:/goobeldygook" ) ) { fail ( "Failed on getName. Expected: " + vfsURI + ". Actual: " + res . getName ( ) ) ; } if ( res . getLastModified ( ) != 0 ) { fail ( "Expected null file modification date for URI: " + vfsURI + ": " + res . getLastModified ( ) ) ; } if ( res . getContentLength ( ) != 0 ) { fail ( "Expected zero file length for URI: " + vfsURI ) ; } if ( res . physicallyExists ( ) ) { fail ( "Physical existence check returned false for existing resource: " + vfsURI ) ; } }
Validate VFSResource creation when given a poorly formed VFS identifier
Validate VFSResource creation when given a poorly formed VFS identifier