logError( BaseMessages.getString( PKG, "JobCopyFiles.Error.Exception.CopyProcessFileSystemException", fse .getMessage() ) ); Throwable throwable = fse.getCause(); while ( throwable != null ) { logError( BaseMessages.getString( PKG, "JobCopyFiles.Log.CausedBy", throwable.getMessage() ) );
@Test public void testDelegatingBad() throws Throwable { final FileSystemOptions opts = new FileSystemOptions(); final DelegatingFileSystemOptionsBuilder delgate = new DelegatingFileSystemOptionsBuilder(fsm); try { delgate.setConfigString(opts, "http", "proxyPort", "wrong_port"); fail(); } catch (final FileSystemException e) { assertEquals(e.getCause().getClass(), InvocationTargetException.class); assertEquals(((InvocationTargetException) e.getCause()).getTargetException().getClass(), NumberFormatException.class); } try { delgate.setConfigClass(opts, "sftp", "userinfo", String.class); fail(); } catch (final FileSystemException e) { assertEquals(e.getCode(), "vfs.provider/config-value-invalid.error"); } }
@Test public void testDelegatingBad() throws Throwable { final FileSystemOptions opts = new FileSystemOptions(); final DelegatingFileSystemOptionsBuilder delgate = new DelegatingFileSystemOptionsBuilder(fsm); try { delgate.setConfigString(opts, "http", "proxyPort", "wrong_port"); fail(); } catch (final FileSystemException e) { assertEquals(e.getCause().getClass(), InvocationTargetException.class); assertEquals(((InvocationTargetException) e.getCause()).getTargetException().getClass(), NumberFormatException.class); } try { delgate.setConfigClass(opts, "sftp", "userinfo", String.class); fail(); } catch (final FileSystemException e) { assertEquals(e.getCode(), "vfs.provider/config-value-invalid.error"); } }
public void testWindowsFilenameUNCStartError() throws Exception { try { final String FILE = "file://///"; final FileObject fo = getManager().resolveFile(FILE); fail("Windows File Parser should not allow " + FILE + " " + fo); } catch (FileSystemException ex) { assertEquals("Exception code", "vfs.provider/invalid-absolute-uri.error", ex.getCode()); ex = (FileSystemException) ex.getCause(); assertEquals("Exception code", "vfs.provider.local/missing-share-name.error", ex.getCode()); } }
public void testWindowsFilenameParserError() throws Exception { // check VFS-338 with 2+4 slashes we want a dedicated error try { final String FILE = "file://////"; final FileObject fo = getManager().resolveFile(FILE); fail("Windows File Parser should not allow " + FILE + " " + fo); } catch (FileSystemException ex) { assertEquals("Exception code", "vfs.provider/invalid-absolute-uri.error", ex.getCode()); ex = (FileSystemException) ex.getCause(); assertEquals("Exception code", "vfs.provider.local/not-absolute-file-name.error", ex.getCode()); } } }
public void testWindowsFilenameUNCStartError() throws Exception { try { final String FILE = "file://///"; FileObject fo = getManager().resolveFile(FILE); fail("Windows File Parser should not allow " + FILE + " " + fo); } catch(FileSystemException ex) { assertEquals("Exception code", "vfs.provider/invalid-absolute-uri.error", ex.getCode()); ex = (FileSystemException)ex.getCause(); assertEquals("Exception code", "vfs.provider.local/missing-share-name.error", ex.getCode()); } }
public void testWindowsFilenameParserError() throws Exception { // check VFS-338 with 2+4 slashes we want a dedicated error try { final String FILE = "file://////"; FileObject fo = getManager().resolveFile(FILE); fail("Windows File Parser should not allow " + FILE + " " + fo); } catch(FileSystemException ex) { assertEquals("Exception code", "vfs.provider/invalid-absolute-uri.error", ex.getCode()); ex = (FileSystemException)ex.getCause(); assertEquals("Exception code", "vfs.provider.local/not-absolute-file-name.error", ex.getCode()); } } }
public void testWindowsFilenameUNCStartError() throws Exception { try { final String FILE = "file://///"; final DefaultFileSystemManager manager = getManager(); Assert.assertNotNull("Unexpected null manager for test " + this, manager); final FileObject fo = manager.resolveFile(FILE); fail("Windows File Parser should not allow " + FILE + " " + fo); } catch (FileSystemException ex) { assertEquals("Exception code", "vfs.provider/invalid-absolute-uri.error", ex.getCode()); ex = (FileSystemException) ex.getCause(); assertEquals("Exception code", "vfs.provider.local/missing-share-name.error", ex.getCode()); } }
public void testWindowsFilenameParserError() throws Exception { // check VFS-338 with 2+4 slashes we want a dedicated error try { final String FILE = "file://////"; final DefaultFileSystemManager manager = getManager(); Assert.assertNotNull("Unexpected null manager for test " + this, manager); final FileObject fo = manager.resolveFile(FILE); fail("Windows File Parser should not allow " + FILE + " " + fo); } catch (FileSystemException ex) { assertEquals("Exception code", "vfs.provider/invalid-absolute-uri.error", ex.getCode()); ex = (FileSystemException) ex.getCause(); assertEquals("Exception code", "vfs.provider.local/not-absolute-file-name.error", ex.getCode()); } } }