5 Replies Latest reply on Jun 17, 2014 10:49 AM by bmajsak

    Arquillian-Persistence-Extension has performance issues with database related annotations @ShouldMatchDataSet("abc.yml") and @UsingDataSet("abc.sql")

    aslam.rajper

      Hello Bartosz,


      This example is a simple demonstration to analyse the performance of database related annotations like @ShouldMatchDataSet and @UsingDataSet .

      Yaml file contains only two records with four columns each, all the files are embedded here.



      ArqIntegrationTest.groovy

       

      @RunWith(ArquillianSputnik)
      class ArqIntegrationTest extends Specification {
      
      
        @Deployment
        def static JavaArchive "create Deployment"() {
                  JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test.jar")
                                      jar.addClass(DBScriptExecutor.class)
                                   jar.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        return jar
          }
      
          @ShouldMatchDataSet("users.yml")
           def 'should change user password'(int a, int b, int c){
      
                     expect:
                                    assert a < Math.max(a, b)
                     where:
                                      a|b|c
                                      2|7|3
           }
      
      }
      
      
      
      
      
      
      
      

       

       

       

      users.yml

       

      useraccount:
        - firstname: John
          lastname: Smith
          username: doovde
          password: password1
        - firstname: Clark
          lastname: Kent
          username: superman
          password: kryptonite
      
      

       

       

      user-script.sql

       

      create table useraccount
      (
        firstname varchar(255),
        lastname  varchar(255),
        username varchar(255),
        password   varchar(255)
      )
      
      GO
      insert into useraccount
      values
      ('aslam','rajper','maslam','maslam')
      
      
      GO
      insert into useraccount
      values
      ('zafar','luni','zluni','zluni')
      
      
      
      
      

       

       

      Test Eclipse Console:

      test failed.PNG

       

      Conclusion:

      As the picture shows that it took almost 50 seconds while comparing only two records with four columns, while I was having another test that is purely related to my project , unfortunately I cann't reveal it here , that yaml file contains 20 records with 2 columns, It took 45 to 50 seconds and this is really unacceptable when one has hundreds of tests with real data.

       

       

      Cheers,

      Aslam