0 Replies Latest reply on Nov 9, 2012 11:48 AM by Stefan Miklosovic

    Can I combine performance extesion with persistence one?

    Stefan Miklosovic Novice



      after reading the Arquillian reference guide today, I am just wondering if it would be possible to test the persistence by persistence extension in connection with performance extension. By this way, it would be pretty nice benchmarking tool to benchmark database performance ...


      I imagine something like this:



      public class UserPersistenceTest {
          public static Archive<?> createDeploymentPackage() {
              return ShrinkWrap.create(JavaArchive.class, "test.jar")
                      .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
                      .addAsManifestResource("test-persistence.xml", "persistence.xml");
          EntityManager em;
          public void persistBenchmarkTest() throws Exception {
          private void saveAccounts(int count) {
              for (int i = 0; i < count; i++) {
                  UserAccount user = new UserAccount();
                  user.setName("something random");


      So by this way I can test that not even the data are stored but the actual saving time was not bigger then 2 seconds for example.


      What are pros and cons of this approach? Are there some implementation drawbacks of how the two extensions work internally? Is it even possible to combine them?


      Thank you for the answer.