For a while it has slightly or mildly annoyed me how clunky creating random data can be.
You see all manner of approaches from Importing CSV files and XML to loading up JSON objects and the like.
What I have wanted was a library that allows random or specific generation into your Java POJO domain model which you then simply persist using your preferred storage layer (Hibernate, JPA, Neo4j) etc.
DBUnit is fantastic and I have often used http://www.generatedata.com to generate XML files to upload through DBUnit.
Well know I sctarched that itch over the last day to create the aptly named
random-data-generator - http://code.google.com/p/random-data-generator
In short, see the project page as it explains most of how it works. It is a library for use in your code for "seeding" objects with random data.
Enjoy.
Ramon Buckland is a Java Solutions Architect and Finance IT Consultant based in Bristol, UK. His experience is vast across all areas of IT. Focus is online development and architecting with the Java platform(s).
Friday, 16 September 2011
Thursday, 15 September 2011
Love *Nix
I Still love *nix after all these years. It only took me 1 minute to convert lines like
to what I wanted.
1880,"Mary",0.072381,"girl"
to what I wanted.
$ grep \"girl\" baby-names.csv | head | cut -d, -f2 | sed 's/"//g;s/$/,F/g'
Mary,F
Anna,F
Emma,F
Elizabeth,F
Minnie,F
Margaret,F
Ida,F
Alice,F
Bertha,F
Sarah,F
Subscribe to:
Posts (Atom)