Skip to content

Commit

Permalink
Testsuite speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobe91 committed Sep 1, 2020
1 parent c804a23 commit e71ce2c
Show file tree
Hide file tree
Showing 13 changed files with 441 additions and 104 deletions.
39 changes: 28 additions & 11 deletions core/testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<test.java.version>1.8</test.java.version>
<java.version>${test.java.version}</java.version>
<module.name>com.blazebit.persistence.core.testsuite</module.name>
<testBasePackage>com.blazebit.persistence.testsuite</testBasePackage>
</properties>

<dependencies>
Expand Down Expand Up @@ -81,7 +82,6 @@
<scope>test</scope>
</dependency>


<!-- Add mockito early to the local maven repo since the Hibernate,DB2 build froze on downloading this dependency -->
<dependency>
<groupId>org.mockito</groupId>
Expand Down Expand Up @@ -115,7 +115,6 @@
<artifactId>activation</artifactId>
<version>${version.activation}</version>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -167,12 +166,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoH2,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</jdbc.url>
<jdbc.user>admin</jdbc.user>
<jdbc.password>admin</jdbc.password>
<jdbc.driver>org.h2.Driver</jdbc.driver>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoH2,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down Expand Up @@ -220,12 +221,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoMySQL,com.blazebit.persistence.testsuite.base.jpa.category.NoMySQLOld,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=utf8</jdbc.url>
<jdbc.user>root</jdbc.user>
<jdbc.password />
<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoMySQL,com.blazebit.persistence.testsuite.base.jpa.category.NoMySQLOld,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down Expand Up @@ -273,12 +276,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoMySQL,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=utf8</jdbc.url>
<jdbc.user>root</jdbc.user>
<jdbc.password />
<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoMySQL,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down Expand Up @@ -326,13 +331,15 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoPostgreSQL,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:postgresql://localhost:5432/test</jdbc.url>
<jdbc.user>postgres</jdbc.user>
<jdbc.password>postgres</jdbc.password>
<jdbc.driver>org.postgresql.Driver</jdbc.driver>
<hibernate.default_schema>public</hibernate.default_schema>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoPostgreSQL,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down Expand Up @@ -380,12 +387,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoSQLite,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:sqlite:test.db</jdbc.url>
<jdbc.user />
<jdbc.password />
<jdbc.driver>org.sqlite.JDBC</jdbc.driver>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoSQLite,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down Expand Up @@ -438,12 +447,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoDB2,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:db2://localhost:50000/test</jdbc.url>
<jdbc.user>db2inst1</jdbc.user>
<jdbc.password>db2inst1-pwd</jdbc.password>
<jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoDB2,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down Expand Up @@ -498,12 +509,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoFirebird,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:firebirdsql:localhost:/tmp/test.fdb</jdbc.url>
<jdbc.user>SYSDBA</jdbc.user>
<jdbc.password>masterkey</jdbc.password>
<jdbc.driver>org.firebirdsql.jdbc.FBDriver</jdbc.driver>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoFirebird,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down Expand Up @@ -551,7 +564,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoOracle,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:oracle:thin:@localhost:1521:XE</jdbc.url>
<jdbc.user>SYSTEM</jdbc.user>
Expand All @@ -563,6 +576,8 @@
<!-- Dumb, dumber, Oracle -->
<!-- See https://stackoverflow.com/questions/33232260/temporaltemporaltype-date-with-oracle-12 -->
<oracle.jdbc.DateZeroTime>true</oracle.jdbc.DateZeroTime>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoOracle,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down Expand Up @@ -610,12 +625,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoMSSQL,${jpa.excludedGroups}</excludedGroups>
<test>CoreTestsuite</test>
<systemPropertyVariables>
<jdbc.url>jdbc:sqlserver://localhost:1433</jdbc.url>
<jdbc.user>sa</jdbc.user>
<jdbc.password>Blaze-Persistence</jdbc.password>
<jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoMSSQL,${jpa.excludedGroups}</excludedGroups>
<testBasePackage>${testBasePackage}</testBasePackage>
</systemPropertyVariables>
</configuration>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2014 - 2020 Blazebit.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.blazebit.persistence.testsuite;

import com.blazebit.persistence.testsuite.base.jpa.BlazePersistenceTestsuite;
import org.junit.runner.RunWith;
import org.junit.runners.AllTests;

/**
*
* @author Moritz Becker
* @since 1.5.0
*/
@RunWith(AllTests.class)
public class CoreTestsuite extends BlazePersistenceTestsuite {
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static Collection<?> producerConsumerTimezones() {
protected boolean recreateDataSource() {
// Some drivers have timezone information bound to the connection
// So we have to recreate the data source to get the newly configured time zones for connections
boolean recreate = previousProducerTimeZone != null && previousClientTimeZone != null && (!producerTimeZone.equals(previousProducerTimeZone) || !clientTimeZone.equals(previousClientTimeZone));
boolean recreate = !producerTimeZone.equals(previousProducerTimeZone) || !clientTimeZone.equals(previousClientTimeZone);
previousProducerTimeZone = producerTimeZone;
previousClientTimeZone = clientTimeZone;
return recreate;
Expand Down
Loading

0 comments on commit e71ce2c

Please sign in to comment.