Skip to main content

Posts

Showing posts from September, 2006

The purpose of the MOCK

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 kind...

Free Programming Books

I stumbled over some not so common class of free programming books: Although these books are not the most recent spiffy Ajax/Java books, the are worth reading: A nice book about Mozilla programming Some Free Smalltalk books(yes smalltalk ain't dead yet)

Maven Changelog plugin

I tried to use the maven changelog plugin, as described here but maven complained that it could not find the plugin! That was due to the fact this plugin is not yet stable, this wasnt mentioned anywhere I looked. To enable the plugin you must first add the apache maven snapshot repository, read this site to find out how.

AntiPatterns

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-patterns and Meta-(anti)-Patterns I found it both enlightening and shocking to learn about these patterns. Nevertheless the most funniest were IMHO: Programmer Experience Clumping Fear of success Management by numbers Single head of knowledge Sources: Programmer Experience Clumping source German Wiki Article: AntiPattern English Article: AntiPattern

Maven Source-Formatting/-Metrics

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 .... mvn jalopy:format ... and voila! Jalopy formatted my sources. See also: maven Jalopy plugin Very helpful for the "other" reports was an interesting java world article... I also wanted JDepend to check my project, to I added Jdepend .

my first migration of a legacy project to maven 2

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. Sometimes the pom file reference and settings file reference were helpful... Important is the introduction to maven lifecycles . Interresting is the fact, that maven uses plexus container for IoC, reading the comparison, I figured I should try using plexus in another project... These are the steps that needed to be done to migrate the project: 1. Install 3rd party jars into the local repository - I checked in this repository 2. use the maven2 jar plugin to create a manifest wich points out the main class: Maven2 Jar plugin 3. use the jar plugin to sign the jar - use the maven keytool plugin to create the keystore automatically after reading this page . - add the jar plugin sign goal 4. use the assembly plugin to creat a a ...

Maven 2 3rd Party Jars

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: mvn deploy:deploy-file -DgroupId= -DartifactId= -Dversion= -Dpackaging= -Dfile= -DrepositoryId= -Durl= Taken from here. I truely love maven ;-)