@Test public void testExecute_success() throws Exception { File tf = this.folder.newFile(); Assert.assertEquals( 0, tf.length()); WriteCommandExecution exec = buildExecutor( "write this into " + tf.getAbsolutePath()); exec.execute(); Assert.assertNotSame( 0, tf.length()); }
@Override public void execute() throws CommandException { try { File f = new File( this.instr.getFilePath()); Utils.writeStringInto( this.instr.getContent(), f ); } catch( IOException e ) { throw new CommandException( e ); } }
WriteCommandExecution extends AbstractCommandExecution { @Override public void execute() throws CommandException { try { File f = new File( this.instr.getFilePath()); Utils.writeStringInto( this.instr.getContent(), f ); } catch( IOException e ) { throw new CommandException( e ); } } }
WriteCommandExecution extends AbstractCommandExecution { @Override public void execute() throws CommandException { try { File f = new File( this.instr.getFilePath()); Utils.writeStringInto( this.instr.getContent(), f ); } catch( IOException e ) { throw new CommandException( e ); } } WriteCommandExecution( WriteCommandInstruction instr ); }
WriteCommandExecution extends AbstractCommandExecution { @Override public void execute() throws CommandException { try { File f = new File( this.instr.getFilePath()); Utils.writeStringInto( this.instr.getContent(), f ); } catch( IOException e ) { throw new CommandException( e ); } } WriteCommandExecution( WriteCommandInstruction instr ); @Override void execute(); }
WriteCommandExecution extends AbstractCommandExecution { @Override public void execute() throws CommandException { try { File f = new File( this.instr.getFilePath()); Utils.writeStringInto( this.instr.getContent(), f ); } catch( IOException e ) { throw new CommandException( e ); } } WriteCommandExecution( WriteCommandInstruction instr ); @Override void execute();  }