How Data is persists in H2 database

125 views
Skip to first unread message

Murugan M

unread,
May 7, 2014, 9:40:21 AM5/7/14
to junit-be...@googlegroups.com
Hi,

My junit benchmark vm arguements are 

-Djub.consumers=H2,XML -Djub.db.file=.\charts\benchmarks -Djub.xml.file=.\charts\junitbenchmark.xml -Djub.charts.dir=.\charts

I have all the  reports and db file generated in the 

D:\Jpetstore\PetStore\charts folder

The following files are present in the charts folder .

junitbenchmark.xml 

benchmarks-lists.html
benchmarks-lists.jsnop

Now I want to check whether the datas are persisted in the H2 database.

I connected to H2 database using the following settings in the console

Setting name:Generic H2 (Embedded)
Driver:org.h2.Driver
URL:jdbc:h2:D:\Jpetstore\PetStore\charts\benchmark.mv
username:sa
password:**

But Im not able to see the tables associated with junit benchmark.

can anyone show where Im missing the context?

Thanks,
Murugan Mani



Dawid Weiss

unread,
May 7, 2014, 5:18:56 PM5/7/14
to junit-benchmarks
Murugan,

I'm not really sure; hard to say without actually seeing what you have
in that PetStore app... Post your example code on github, it's easier
to review code to which one has access.

Dawid
> --
> You received this message because you are subscribed to the Google Groups
> "JUnitBenchmarks: Performance Benchmarking for JUnit4" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to junit-benchmar...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Murugan M

unread,
May 8, 2014, 5:15:37 AM5/8/14
to junit-be...@googlegroups.com
Hi Dawid,

Issue got resolved.Thanks for your immediate response

I have added created the consumer which was missing earlier and added the same  to the Benchmark Rule like below .

private static File dbFile=new  File(System.getProperty("jub.db.file"));
@Rule
 public TestRule benchmarkRun = new BenchmarkRule(new H2Consumer(dbFile) );

This  resolved the issue.

It would be better the above step is shown in  Junit Benchmark Tutorial So that everyone can use it very easily without any issue. This is a  great api for Benchmarking.

Hats off to the team.

Thanks,
Murugan Mani
Reply all
Reply to author
Forward
0 new messages