In response to a much nicer blog entry, that can be found here.
There are actually several distinct "tests" that make up usual unit tests, among them two that really do stand out: one kind of testing to test method flows, one to test some sort of computation. Mock objects are for the purpose of testing method flows. A method flow is a series of message transmissions to dependent objects.
The control flow logic inside the method(the ifs and whiles) will alter the flow in repsonse to the parameters of the method call parameters passed by calling the method under test, depending on the state of the object that contains the method under test and the return values of the external method calls(aka responses to the messages sent).There should be one test method for every branch of an if statement, and usuale some sort of mock control objects in the mock framework will handle loop checking.
BTW: I partly use message transmission instead of method invocation to include other kinds of &q…
I just realized some nice Articles in the English and German wikipedia about anti patterns. I was well aware of the existence of software engineering related anti patterns, but I read about two other categories of anti patterns, well explained in the afore mentioned articles: organizational&project management anti-patternsand Meta-(anti)-Patterns I found it both enlightening and shocking to learn about these patterns. Nevertheless the most funniest were IMHO: Programmer Experience ClumpingFear of successManagement by numbersSingle head of knowledge Sources: Programmer Experience Clumping sourceGerman Wiki Article: AntiPatternEnglish Article: AntiPattern
I needed to add source code formatting and some code metrics to my maven based project. These are the places on the web where I found help.
I wanted to get the Jalopy plugin to format my source code, and promptly failed to get the snaptshots from the mojo projects without the help of this resource, this resources helped me to get the codehaus mojo snapshot plugins: What to put in settings.xml
after that I could simply run:
mvn -Pcodehaus jalopy:format
As I was bothered by the command line cluttering by -Pcodehaus, I actived the profile by adding <activeByDefault/> into the activation tag in the profile definiton for the "codehaus" profile. Now ....
I had to do migrate a legacy webstart swing application to the maven build process. The app was build into several(signed) jars from a single source directory(containing a mix of java files, property files and html help files). The app was deployed with webstart.
Maven: Installing 3rd Party JARs This page states that one should install a file into the local repository; But another option I found more useful in a team development environment is to deploy 3rd party jars to a maven repository in the companies network via ssh/scp.
If multiple developers work on the project it is advisable to have a linux box somewhere with an ssh server installed and apache running. Just configure this server in your settings.xml and define the deployment to use that server.
All 3rd party jars, the project website/reports and the project itself can then be deployd to that server with this: