• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[Code generation] Request for suggestion

 
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm writing testcases and would like to generate code
to create test data. I will not be using DbUnit as
we have our own style of doing this.
Basically I have value objects like "User", "Groups", "Category", etc..
In my Junit test suite; I can do something like this to persist objects to the database.

What I want to do is to generate this code via a script. I was thinking along the lines of:

Each line will be evaluated and code generated in serial fashion. Thus I can use that to implement dependencies.
The data for each value object will be from a properties file. e.g.

Firstly, I am having problems describing relationships in the properties file ? Any other alternatives ?
Secondly the invocation of the setters on the "javabean" value objects should be done via reflection of something cleaner. Any APIs out there in the internet that will do this grunt work ?
Thirdly, is this a good idea in the first place ?
Thanks
Pho
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic