On 18/03/2009, Christian Grobmeier <grobme...@gmail.com> wrote:
> > Sorry, I still don't understand why refactoring would be needed in
>  > order for the code to be tested using CI?
>  >
>  > I must be missing something - can you explain?
>  > I'm curious to know what the problem is that requires refactoring for CI.
>
>
> Sorry for beeing unclear. Refactoring is big term for "extracting a method".
>  Currently code is:
>
>  if( System.Property.OS == Windows)
>    // do windows related path stuff
>  else
>   // do *nix related path stuff
>  end if
>
>  The windows related stuff has roundabout 10 lines of code and can
>  never be reached in CI, since those are  running on unix. Means, that
>  aprt is never beeing tested.
>
>  If we would extract a method with the windows stuff, the method could
>  be tested (by reflection, cause it is private).
>
>  Hope this makes it more clear now :-)

Yes, understood now, thanks.

In which case maybe it is worth refactoring into two package-protected
methods so Unit tests can exercise them easily. It would be useful for
a Windows developer to be able to test the Unix code too.

Also consider doing this for any other bits of code that depend on the
run-time environment.

> Cheers
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>  For additional commands, e-mail: dev-h...@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to