@Override public void close() throws IOException { if (isClosed) { throw new IOException(); } isClosed = true; }
@Override public void close() throws IOException { if (isClosed) { throw new IOException("This stream is closed."); } isClosed = true; }
@Override public SeekableByteChannel truncate(final long size) throws IOException { try { channel.truncate(size); return this; } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public void close() throws java.io.IOException { try { channel.close(); } catch (java.io.IOException e) { throw new IOException(e); } } }
@Override public long position() throws IOException { try { return channel.position(); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public long size() throws IOException { try { return channel.size(); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public int read(final ByteBuffer dst) throws java.io.IOException { try { return channel.read(dst); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public SeekableByteChannel position(final long newPosition) throws IOException { try { channel.position(newPosition); return this; } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public int write(final ByteBuffer src) throws java.io.IOException { try { return channel.write(src); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public long position() throws IOException { try { return channel.position(); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public SeekableByteChannel position(final long newPosition) throws IOException { try { channel.position(newPosition); return this; } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public SeekableByteChannel truncate(final long size) throws IOException { try { channel.truncate(size); return this; } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public OutputStream newOutputStream(final Path path, final OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); try { return new FileOutputStream(path.toFile()); } catch (Exception e) { throw new IOException(); } }
@Test public void callFailsAndCommandIsCalled() throws Exception { doThrow(new IOException()).when(modelerService).validate(anyString(), any(Path.class), any(DataObject.class)); final Command afterValidation = mock(Command.class); presenter.onValidate(afterValidation); verify(afterValidation).execute(); } }
@Test public void callFailsAndCommandIsCalled() throws Exception { doThrow(new IOException()).when(service).validate(any(Path.class), any(RuleModel.class)); final Command afterValidation = mock(Command.class); presenter.onValidate(afterValidation); verify(afterValidation).execute(); } }
@Test public void callFailsAndCommandIsCalled() throws Exception { doThrow(new IOException()).when(decisionTableXLSService).validate(any(Path.class), any(Path.class)); final Command afterValidation = mock(Command.class); presenter.onValidate(afterValidation); verify(afterValidation).execute(); } }
@Test public void callFailsAndCommandIsCalled() throws Exception { doThrow(new IOException()).when(service).validate(any(Path.class), any(GlobalsModel.class)); final Command afterValidation = mock(Command.class); presenter.onValidate(afterValidation); verify(afterValidation).execute(); } }
public void execute() { try { git._branchDelete().setBranchNames(branch.getName()).setForce(true).call(); } catch (final GitAPIException e) { throw new IOException(e); } } }
public static Git newRepository(final File repoFolder) throws IOException { checkNotNull("repoFolder", repoFolder); try { return Git.init().setBare(true).setDirectory(repoFolder).call(); } catch (GitAPIException e) { throw new IOException(e); } }
public static void deleteBranch(final Git git, final Ref branch) { try { git.branchDelete().setBranchNames(branch.getName()).setForce(true).call(); } catch (final GitAPIException e) { throw new IOException(e); } }