• Home
  • Events
  • About
  • Testdata generation

    September 26th, 2011

    We’ve all being there, we’ve all had this on a project once or maybe even more times. The assignment is to build an application, but there is no data for you to work with. There could be any number of reasons this could be the case to name a few, the web-service that should be connected is not done in time, the database migration is postponed. Then someone has to create database scripts with test data, or implement a test web-services. This is all a waste of time.

    But lucky for you now there is a solution.

    I’ve created an little test data framework that is easy to setup and will create test data automatically. So how does it work? Simple, its entry point is a method interceptor that you can wrap around anything you want, it doesn’t even have to be an implementation. So that DAO you want to use, but the database is still empty, just let the framework step into place and all the methods return the data that you want.

    It can also be handy to create test data for you unit test. You need to test if you bean serialization works, or want to put an entity into a in memory database with dbunit. Just call the framework with you bean class and the framework will return an instance filled with test data. It will read the existing annotations that you have on your entity bean an will only generate data that is valid for you bean.

    Here is an example of how it works:

    To create a service that returns test data on it’s service methods:

    Create a dbunit xml file:

    If employee has relations with other classes, like employees have managers these objects will also be in the generated xml file.

    To give it a spin add the following into you pom.xml

    or if you use ivy, gradle or something else you properly know how to use this information as well.

    So nothing holding you back to make your data driven test easier to setup, or to stub out you migration points. I’m hosting this code on github so if you have issues, comments or even better contribute please do so.

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • email
    • Print
    • Twitter
    • LinkedIn
    • XING
    • Facebook
    • Google Bookmarks

    Learning Android in Switzerland? Upcoming Workshops in the next Month

    September 14th, 2011

    Canoo is helping organize three different Android workshops in the next month, so now is a great time to get started if you’ve been wanting to take a shot at Android development.

    The first event is starting today (14 September) at ch/open in Zürich. If you hurry you can still get down there in time. It is a German language session called Umgang mit Fragmentierung auf der Android Plattform” presented by Andreas Hölzl and Andrei Socaciu. It’s a full day session, so feel free to drop in. Better late than never.

    The second event is Wednesday 28 September in Basel. Hackergarten, the monthly user group, is hosting Andreas who will lead us in an Android development night. We plan to develop and publish a full Android app during the evening. This is a free event and Canoo provides food and drinks. You can read the mailing list thread for more information. The group is in English and German, and it’s generally a lot of fun.

    The third event is in Geneva/Genf. The SoftShake conference is the 3rd and 4th of October. Andreas and Andrei are presenting Tackling fragmentation on the Android platform”, another full day workshop but this time in English. (By the way, I’ll be presenting there on Code Generation and Java Boilerplate Busting).

    Do none of these fit your schedule? Would you rather have them presented on-site? Canooies are always available to come to your worksplace and present on topics, whether it is Java, Groovy, Andriod, iOS, or whatever. It’s actually more fun to speak at a customer-site than at a conference. Just email info@canoo.com for more info or to set something up.

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • email
    • Print
    • Twitter
    • LinkedIn
    • XING
    • Facebook
    • Google Bookmarks

    css.php