From: Gerald E. <gn...@f2...> - 2003-10-05 10:15:55
|
Just to let you all know I've made and committed the changes required to support the new ICommandConnection interface. This impacts both the 'commands' and 'client' directories. The new interface still exposes the whole of the WorkingDirectory class. I'm sure we can do something to clean this up at some point. Gerald. At 16:04 04/10/2003 +0100, Gerald Evans wrote: >To enable unit testing of the commands in isolation from >CVSServerConnection I would like to introduce a new interface called say, >ICommandConnection which will define the minimum subset of >CVSServerConnection that is needed by the commands. This way the unit >test can have its own implementation of ICommandConnection which would >allow each command to be tested in isolation from a real cvs repository etc.. > >The impact of this is that the member >Execute(CVSServerConnection connection) >in each command will change to: >Execute(ICommandConenction connection) > >Also CVSServerConnection would need to implement the new interface. > >Looking at the existing commands, the only things that need to be in >ICommandConnection are: >1) void SubmitRequest(IRequest request) >2) Access to the WorkingDirectory class which we confusingly (or at least >to me!) call Repository. >3) The ability to send a text or binary file. >On this third item, commands that need to send a file currently have code >like the following: > >if (entry.IsBinaryFile) { > >connection.UncompressedFileHandler.SendBinaryFile(connection.OutputStream,entry.Filename); >} else { > >connection.UncompressedFileHandler.SendTextFile(connection.OutputStream,entry.Filename); >} > >I would like to clean this up and have a new member in >ICommandConnection/CVSServerConnection with the following prototype: >void SendFile(string filename, bool isBinary); >so the above code can be changed to: >connection.SendFile(entry.Filename, entry.IsBinaryFile); > >So my questions are: >1) Does all this sound reasonable? I've not tried any of this out so I may >have overlooked a major problem! >2) Are you aware of anything else that needs to go into ICommandConnection >in the near future? > >Gerald. > > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Sharpcvslib-developers mailing list >Sha...@li... >https://lists.sourceforge.net/lists/listinfo/sharpcvslib-developers |