Class PerformanceTest
java.lang.Object
org.fastnate.generator.test.AbstractEntitySqlGeneratorTest
org.fastnate.generator.test.performance.PerformanceTest
Tests the performance against the currently configured test database.
- Author:
- Tobias Liefke
-
Field Summary
FieldsFields inherited from class org.fastnate.generator.test.AbstractEntitySqlGeneratorTest
WRITER_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List<PerformanceTestEntity> createRootEntities(long seed, int maxElementsPerEntity, int countOfRootEntities) private voidfillEntity(PerformanceTestEntity entity, int maxElementsPerEntity, Random random) protected PropertiesProperties for configuring thegenerator.voidTests the performance of fastnate with thePostgreSqlBulkWriter.voidTests the performance of fastnate with theConnectedStatementsWriter.voidTests the performance of fastnate with predefined SQL.private <T> voidtestHugeAmount(Function<List<? super PerformanceTestEntity>, T> transformation, Consumer<T> writer) Tests to write manyPerformanceTestEntityto measure the time it takes with different implementations and databases.voidtestJpa()Tests the performance of the JPA library.Methods inherited from class org.fastnate.generator.test.AbstractEntitySqlGeneratorTest
createQuery, executeSql, findResults, findResults, findSingleResult, findSingleResult, getConnection, getEm, getGenerator, setup, setup, tearDown, write
-
Field Details
-
log
private static final org.slf4j.Logger log
-
-
Constructor Details
-
PerformanceTest
public PerformanceTest()
-
-
Method Details
-
createRootEntities
private List<PerformanceTestEntity> createRootEntities(long seed, int maxElementsPerEntity, int countOfRootEntities) -
fillEntity
-
getGeneratorProperties
Description copied from class:AbstractEntitySqlGeneratorTestProperties for configuring thegenerator.- Overrides:
getGeneratorPropertiesin classAbstractEntitySqlGeneratorTest- Returns:
- the test specific properties for the generator
-
testFastnateBulk
Tests the performance of fastnate with thePostgreSqlBulkWriter.- Throws:
SQLException- if there is a problem with the SQL
-
testFastnateConnected
Tests the performance of fastnate with theConnectedStatementsWriter.- Throws:
SQLException- if there is a problem with the SQL
-
testFastnatePrebuild
Tests the performance of fastnate with predefined SQL.- Throws:
SQLException- if there is a problem with the SQL
-
testHugeAmount
private <T> void testHugeAmount(Function<List<? super PerformanceTestEntity>, T> transformation, Consumer<T> writer) Tests to write manyPerformanceTestEntityto measure the time it takes with different implementations and databases.- Parameters:
transformation- used to transform the entity (e.g. into a list of SQL statements)writer- used to write the entity
-
testJpa
@Test public void testJpa()Tests the performance of the JPA library.
-