2 Replies Latest reply on Aug 4, 2017 10:47 AM by Jeferson Souza

    Problems on using Arquillian to perform integration tests

    Jeferson Souza Newbie

      Hi All,

       

      I am trying to use Arquillian to perform integration tests on the software I am working on, and I have got stuck.

       

      Could someone with more experience help me out?

       

      I can provide some logs to make it easy to exchange knowledge.

        • 1. Re: Problems on using Arquillian to perform integration tests
          Bartosz Majsak Master

          Sure, that's what this forum is for and why we are all here.

           

          Please share some specifics, otherwise it might be really hard

          • 2. Re: Problems on using Arquillian to perform integration tests
            Jeferson Souza Newbie

            Hi,

             

            Let's share some knowledge. I am working with Arquillian to perform integration tests. I have followed the tutorial Getting Started · Arquillian Guides and the example works just fine. After that, I have started to apply it to the software I am working on and when I run the Arquillian the test get stuck with something related to the connection pool to the dabatase, as you can see in the following log message:

             

            2017-08-04 11:13:28 [TreasyPool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - TreasyPool - Pool stats (total=10, active=0, idle=10, waiting=0)

             

            The integration test use the following persistence.xml:

             

            <?xml version='1.0' encoding='utf-8'?>

            <!DOCTYPE hibernate-configuration PUBLIC

                    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"

                    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

             

             

            <hibernate-configuration>

                <session-factory name="easy">

             

             

                    <property name="hibernate.current_session_context_class">thread</property>

             

             

                    <!-- Alterado para compatibilidade do hibernate5 -->

                    <property name="hibernate.id.new_generator_mappings">false</property>

             

             

                    <property name="hibernate.hbm2ddl.auto">update</property>

                    <property name="hibernate.show_sql">true</property>

                    <property name="hibernate.use_sql_comments">true</property>

                    <property name="hibernate.format_sql">false</property>

             

                    <property name="org.hibernate.envers.store_data_at_delete">true</property>

                   

                    <!-- Connection Pool with HikariCP -->

                    <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property>

                    <property name="hibernate.hikari.dataSourceClassName">com.mysql.jdbc.jdbc2.optional.MysqlDataSource</property>

                    <property name="hibernate.connection.username">root</property>

                    <property name="hibernate.connection.password">virtual#_root$</property>

                    <property name="hibernate.hikari.dataSource.url">jdbc:mysql://192.168.56.101:2387/prod_test</property>

                    <property name="hibernate.hikari.maximumPoolSize">30</property>

                    <property name="hibernate.hikari.minimumIdle">10</property>       

                    <property name="hibernate.hikari.isolateInternalQueries">true</property>

                    <property name="hibernate.hikari.leakDetectionThreshold">290000</property>

                    <property name="hibernate.hikari.idleTimeout">10000</property>

                    <property name="hibernate.hikari.maxLifetime">300000</property>

                    <property name="hibernate.hikari.autoCommit">false</property>

                    <property name="hibernate.hikari.poolName">TreasyPool </property>

                   

                   

                    <!-- Second-Level Cache -->

                    <property name="hibernate.cache.provider_class">org.hibernate.cache.internal.NoCachingRegionFactory</property>

                    <property name="hibernate.cache.use_second_level_cache">false</property>

                    <property name="hibernate.cache.use_query_cache">false</property>

                    <property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</property>

                    <property name="net.sf.ehcache.configurationResourceName">/ehcache.xml</property>

                    <property name="hibernate.generate_statistics">false</property>

                   

                </session-factory>

             

            </hibernate-configuration>

             

             

            A thing that catch my eye is the idle status of the connections. Do you know if Arquillian perform some internal database access using configuration of persistence.xml? If not, I will have to check on the forum of HikariCP to see why connections are stuck in idle status.

             

            Thank you to your help.

             

            Kind regards.