Re: [freenet-dev] Adding Mockito to testing environment
On Saturday 27 Jul 2013 23:48:19 David ‘Bombe’ Roden wrote: > On 07/27/2013 08:59 PM, Matthew Toseland wrote: > > > I don't have a big problem with this, as mockito appears to be > > packaged in debian. Best not to use a more recent version as > > installing java software can be problematic and insecure. > > The exact version is surely debatable… I only used 1.9.5 because I had > it lying around on my disk. If you tell me which version Debian > currently packages I can try that one and if it works for my current > tests (so far it’s only one, anyway), that’s great. 1.9.0. > > > Having said that, much of fred doesn't need mockups. How many of > > our tests actually need a Node? > > Looking at the serious mess that most of Fred’s code is I’m surprised > that so far you have been able to write tests at all without mocking > anything. The bookmark manager e.g. needs a NodeClientCore, a > USKManager, a UserAlertManager, and a Ticker, if I really wanted to > test it all. Sure, this is true in a few places. However generally it means we are violating layers and/or the interfaces are inadequate; we need to extract an interface, for reasons of code clarity and encapsulation as well as to make testing easier. (I mean, NodeClientCore !?!?!) It's also true that most of the higher level code simply isn't unit tested. > > >> Any opinions? (And: how exactly would we treat that? Simply add > >> it in build.properties and if somebody wants to run the test they > >> have to get it themselves?) > > Possibly, or make it optional? > > Is JUnit optional for testing? I don’t think so, and it shouldn’t be. > Neither should Mockito be should we decide to use it. Running only > half of the tests because you’re missing a lib is stupid at best, > dangerous at worst. Ok. signature.asc Description: This is a digitally signed message part. ___ Devl mailing list Devl@freenetproject.org https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
Re: [freenet-dev] Adding Mockito to testing environment
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/27/2013 08:59 PM, Matthew Toseland wrote: > I don't have a big problem with this, as mockito appears to be > packaged in debian. Best not to use a more recent version as > installing java software can be problematic and insecure. The exact version is surely debatable… I only used 1.9.5 because I had it lying around on my disk. If you tell me which version Debian currently packages I can try that one and if it works for my current tests (so far it’s only one, anyway), that’s great. > Having said that, much of fred doesn't need mockups. How many of > our tests actually need a Node? Looking at the serious mess that most of Fred’s code is I’m surprised that so far you have been able to write tests at all without mocking anything. The bookmark manager e.g. needs a NodeClientCore, a USKManager, a UserAlertManager, and a Ticker, if I really wanted to test it all. >> Any opinions? (And: how exactly would we treat that? Simply add >> it in build.properties and if somebody wants to run the test they >> have to get it themselves?) > Possibly, or make it optional? Is JUnit optional for testing? I don’t think so, and it shouldn’t be. Neither should Mockito be should we decide to use it. Running only half of the tests because you’re missing a lib is stupid at best, dangerous at worst. Greetings, David -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlH0TjAACgkQsh8Hgp5TwkOwyQCgpCJiP0qOiE8GRQllec4NeIPX 1acAn2la7f41S1dtavL3wOVAGaok/EBk =gZq/ -END PGP SIGNATURE- ___ Devl mailing list Devl@freenetproject.org https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
Re: [freenet-dev] Adding Mockito to testing environment
On Saturday 27 Jul 2013 17:24:56 David ‘Bombe’ Roden wrote: > Hey, everybody. > > I would like to add Mockito [1] to the testing environment. This would > allow us to test parts of Freenet a lot better because we wouldn’t > have to spawn up a complete node for every test. I don't have a big problem with this, as mockito appears to be packaged in debian. Best not to use a more recent version as installing java software can be problematic and insecure. Having said that, much of fred doesn't need mockups. How many of our tests actually need a Node? > > Any opinions? (And: how exactly would we treat that? Simply add it in > build.properties and if somebody wants to run the test they have to > get it themselves?) Possibly, or make it optional? > > > Greetings, > > David > > [1]: https://code.google.com/p/mockito/ signature.asc Description: This is a digitally signed message part. ___ Devl mailing list Devl@freenetproject.org https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl