Friday, August 24, 2007

 

Utah Teapot Elements Finished

Somewhere in hot sweaty North Carolina I managed to finish of the implementation of all Utah Teapot RIB elements, Pfew, all JUnit tests are running :-) YAY!

Thursday, August 23, 2007

 

Comparing XML

Got a bit of a refactoring job done. I wrote my own xml doc compare routine for my JUnit tests. In this unit test I create a XML fragment with JAXB and compare this against another XML fragment created out of a string. I was not completely happy with this routine and googled for a java diff library. I quickly stumbled upon XMLUnit, a xml compare extension for JUnit. Unfortunately it doesn't support JUnit 4.0 :-( Hmmm, junit testing without annotations is just so....90s ;-P. Posted a message on their forums asking for JUnit 4.0 support, but I don't expect to much in the near future since they only did a release a month ago. One good thing though, they have a lot of routines for comparing XML, Specifically the Diff class, which I'm using now and cleans up my code a lot :-)

Monday, August 20, 2007

 

GIT

I have a 10 hour plane journey to look forward to and currently working with subversion. Meaning I have to save up all my changes and do my commits after I landed and hook up with a wifi hotspot. Hmmm, not very convenient, I'm one of these people who likes to commit a lot. So I was in need of a distributed version control thingy.

I watched Linus Google tech talk on GIT
and the mercurial google tech talk by Bryan O'Sullivan.

Installed them both, dumped my subversion tree into them. And to be honest with you, I could have done a proper technical review, browsed lots of forums but..Linus is just more fun in his presentation and on top of this here is one of his quotes: "I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'git'."

Hahaha

So my gitweb is up and running now.

Happy cloning!!

Friday, August 10, 2007

 

Utah Teapot JUnit test finished!

Finally finished the unit test for the Utah Teapot example. Now I can move on with the implementation :-)

Sunday, March 11, 2007

 

On top of the wave with Junit 4, SureFire 2.3 and DOM lvl 3

Getting into Junit testing now. The first test is written for the Display element. Since there will be a lot of changes to the source tree I branched in Subversion. I'm using Junit 4.0 which is now supported in the Surefire maven plugin (Only since March 1) together with DOM lvl 3 (Since Java 5.0).

The test goes as follows:

1. Create a DOM document from a string fragment defined in the test. (The fragment is what I expect)
2. Validate this against the Renderman XML Schema
3. Create the Display element with standard Renderman RIB syntax
4. Add this to a JAXB Renderman list
5. Marshall this JAXB list to a second DOM document
6. Use the DOM lvl 3 functionality ( isEqualNode() )to compare the Nodes of the two different documents
7. Run tests with maven

So that's three fairly to brand new technologies to do test driven development.

Makes me happy :-)


Olivier

Thursday, February 01, 2007

 

2448 to zero

Added a few reports to maven, one of 'm is checkstyle. This reports checks the style of your source code and sees if it is conform specific standards. My source code didn't :-) Horrified I saw my code generated 2448 style errors. Most of them were missing javadoc comments and tabs instead of spaces. Also more serious ones like catching unspecified exceptions and having a to high Cyclomatic Complexity (8).
So I sat down behind laptop this weekend and forced myself through 2448 errors and solved every single one of them in two days time :-) Lesson learned: Write clean code ;-)

Tuesday, January 23, 2007

 

First Succesfull Automated Build!!

First successful build with continuum today :-) Needed a bit of tweaking. Proxy configuration for apache to point to Continuum server. Installing Java 6.0 on my server (Dragon3D only compiles with 6 cause of JAXB dependecies). Now I only have to fill the Maven configuration file with lots of cool features to get some nice reports, web pages, unit test and whatever ;-)

And here is a good article by Martin Fowler about continuous integration and why I should do it :-)

Olivier

 

Moved to Maven

The good thing about starting a new job is you often encounter lots of useful new things. And of course you keep wondering 'why didn't I use this before??'. So I switched from Ant to Maven. It did make my (developer) life a lot easier. For example I used to write my own ant files to get all the dependencies. Very cumbersome if you have to handle download sites, versions, etc. In Maven it's a breeze. Just add a dependency, and viola, ready to go :-)

Another advantage is the use of Continuum, an automated build system. It reads the Maven configuration file (pom.xml) and will automatically build the whole project for you. This combined with Junit tests this can be very handy for analysis and status reports of your project.

This means I'll have to get my testing act together, and write my Junit tests, again 'why didn't I do this before' :-( Grrrr. Junit test driven development has so much advantages.

Olivier

This page is powered by Blogger. Isn't yours?