Class AbstractJpaTestCase


  • public abstract class AbstractJpaTestCase
    extends java.lang.Object
    Abstract functionality for the JPA testing.
    Author:
    Daniel Sagenschneider
    • Constructor Detail

      • AbstractJpaTestCase

        public AbstractJpaTestCase()
    • Method Detail

      • getMockEntityClass

        protected abstract java.lang.Class<? extends IMockEntity> getMockEntityClass()
        Obtains the IMockEntity implementation Class.
        Returns:
        IMockEntity implementation Class.
      • cleanDatabase

        protected void cleanDatabase​(java.sql.Connection connection)
                              throws java.sql.SQLException
        Cleans the database.
        Parameters:
        connection - Connection.
        Throws:
        java.sql.SQLException - If fails to clean the database.
      • setUp

        @BeforeEach
        public void setUp()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • tearDown

        @AfterEach
        public void tearDown()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • specification

        @Test
        public void specification()
        Validate the specification
      • type_Connection

        @Test
        public void type_Connection()
        Validate the type.
      • type_DataSource

        @Test
        public void type_DataSource()
        Validate the type.
      • type_Managed

        @Test
        public void type_Managed()
        Validate the type.
      • type_Default

        @Test
        public void type_Default()
        Validate the type.
      • managedConnectivity

        @Test
        public void managedConnectivity()
                                 throws java.lang.Throwable
        Ensure if EntityManager is managing the DataSource that it is validated on start up.
        Throws:
        java.lang.Throwable - On test failure.
      • connectionReadWithCompiler

        @Test
        public void connectionReadWithCompiler()
                                        throws java.lang.Throwable
        Ensure able to read entry from database with compiled wrappers.
        Throws:
        java.lang.Throwable
      • connectionReadWithDynamicProxy

        @Test
        public void connectionReadWithDynamicProxy()
                                            throws java.lang.Throwable
        Ensure able to read entry from database with Proxy.
        Throws:
        java.lang.Throwable - On test failure.
      • dataSourceRead

        @Test
        public void dataSourceRead()
                            throws java.lang.Throwable
        Ensure able to read entry via DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • doReadTest

        public void doReadTest​(boolean isConnection)
                        throws java.lang.Throwable
        Ensure able to read entry from database.
        Parameters:
        isConnection - Indicates if Connection otherwise DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • insertWithCompiler

        @Test
        public void insertWithCompiler()
                                throws java.lang.Throwable
        Ensure able to insert entry into database with compiled wrappers.
        Throws:
        java.lang.Throwable - On test failure.
      • insertWithDynamicProxy

        @Test
        public void insertWithDynamicProxy()
                                    throws java.lang.Throwable
        Ensure able to insert entry into database with Proxy.
        Throws:
        java.lang.Throwable - On test failure.
      • insertDataSource

        @Test
        public void insertDataSource()
                              throws java.lang.Throwable
        Ensure able to insert entry via DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • doInsertTest

        public void doInsertTest​(boolean isConnection)
                          throws java.lang.Throwable
        Ensure able to insert entry into database.
        Parameters:
        isConnection - Indicates if Connection otherwise DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • updateWithCompiler

        @Test
        public void updateWithCompiler()
                                throws java.lang.Throwable
        Ensure able to update entry into database with compiled wrappers.
        Throws:
        java.lang.Throwable - On test failure.
      • updateWithDynamicProxy

        @Test
        public void updateWithDynamicProxy()
                                    throws java.lang.Throwable
        Ensure able to update entry into database with Proxy.
        Throws:
        java.lang.Throwable - On test failure.
      • updateDataSource

        @Test
        public void updateDataSource()
                              throws java.lang.Throwable
        Ensure able to update entry via DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • doUpdateTest

        public void doUpdateTest​(boolean isConnection)
                          throws java.lang.Throwable
        Ensure able to update entry into database.
        Parameters:
        isConnection - Indicates if Connection otherwise DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • deleteWithCompiler

        @Test
        public void deleteWithCompiler()
                                throws java.lang.Throwable
        Ensure able to delete entry from database with compiled wrappers.
        Throws:
        java.lang.Throwable - On test failure.
      • deleteWithDynamicProxy

        @Test
        public void deleteWithDynamicProxy()
                                    throws java.lang.Throwable
        Ensure able to delete entry from database with Proxy.
        Throws:
        java.lang.Throwable - On test failure.
      • deleteDataSource

        @Test
        public void deleteDataSource()
                              throws java.lang.Throwable
        Ensure able to delete entry via DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • doDeleteTest

        public void doDeleteTest​(boolean isConnection)
                          throws java.lang.Throwable
        Ensure able to delete entry from database.
        Parameters:
        isConnection - Indicates if Connection otherwise DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • forceCommitWithCompiler

        @Test
        public void forceCommitWithCompiler()
                                     throws java.lang.Throwable
        Undertake forcing commit with compiled wrappers.
        Throws:
        java.lang.Throwable - On test failure.
      • forceCommitWithDynamicProxy

        @Test
        public void forceCommitWithDynamicProxy()
                                         throws java.lang.Throwable
        Undertake forcing commit with Proxy.
        Throws:
        java.lang.Throwable - On test failure.
      • isTransactional

        protected boolean isTransactional()
        Indicates if JPA is transactional.
        Returns:
        true if JPA is transactional.
      • stressInsertWithCompiler

        public void stressInsertWithCompiler​(org.junit.jupiter.api.TestInfo testInfo)
                                      throws java.lang.Throwable
        Undertake stress insert test with compiled wrappers.
        Throws:
        java.lang.Throwable - On test failure.
      • stressInsertWithDynamicProxy

        public void stressInsertWithDynamicProxy​(org.junit.jupiter.api.TestInfo testInfo)
                                          throws java.lang.Throwable
        Undertake stress insert test with Proxy.
        Throws:
        java.lang.Throwable - On test failure.
      • testStressInsertDataSource

        public void testStressInsertDataSource​(org.junit.jupiter.api.TestInfo testInfo)
                                        throws java.lang.Throwable
        Undertake stress insert test with DataSource.
        Throws:
        java.lang.Throwable - On test failure.
      • stressSelectWithCompiler

        public void stressSelectWithCompiler​(org.junit.jupiter.api.TestInfo testInfo)
                                      throws java.lang.Throwable
        Ensure stress select with compiled wrappers.
        Throws:
        java.lang.Throwable - On test failure.
      • stressSelectWithDynamicProxy

        public void stressSelectWithDynamicProxy​(org.junit.jupiter.api.TestInfo testInfo)
                                          throws java.lang.Throwable
        Ensure stress select with Proxy.
        Throws:
        java.lang.Throwable - On test failure.
      • stressSelectDataSource

        public void stressSelectDataSource​(org.junit.jupiter.api.TestInfo testInfo)
                                    throws java.lang.Throwable
        Ensure stress select with DataSource.
        Throws:
        java.lang.Throwable - On test failure.