aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes SQL benchmarking with maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "SQL benchmarking with maven" Watch "SQL benchmarking with maven" New topic
Author

SQL benchmarking with maven

Pavel Kazlou
Ranch Hand

Joined: Sep 07, 2009
Posts: 33
Hi!

I'm using maven 2.2

With it I am able to run code-based tests and get both their success/failure result AND the time of execution in surefire reports. So I can perform a kind of benchmarking for my tests.

Now I'm using maven sql plugin http://mojo.codehaus.org/sql-maven-plugin/
With it I don't have to write any jdbc code and can perform sql queries right from *.sql files. I have a set of queries to create schema, populate tables with data and queries to perform some selects which I want to benchmark. Even though I put sql plugin goal "execute" into "test" phase I don't have any reports being generated, all sql-s are performed without any reports (like they are just used for preparation).

As you may understand there is no java code involved into this test, just plain sql queries. But I want to incorporate database testing into my project, controlled by maven.
So do you know any way to implement time measuring of my sql goals, so I can see that one select query took X seconds and the other Y seconds.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

I don't see anything in the properties at http://mojo.codehaus.org/sql-maven-plugin/execute-mojo.html that will give you that information. But it should not be that hard to create a new plugin that extents this plugin and provided the timing information that you want. Or you could modify the plugin directly and submit the changes back to the maven team. Hey, that is what open source is all about.


JBoss In Action
Pavel Kazlou
Ranch Hand

Joined: Sep 07, 2009
Posts: 33
Thank you, Peter.
I think sql plugin is not suited for testing, so I ended up writing test part of my case in classes using jdbc and measuring the time of their execution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL benchmarking with maven