Class PerformanceTest

java.lang.Object
org.fastnate.generator.test.AbstractEntitySqlGeneratorTest
org.fastnate.generator.test.performance.PerformanceTest

public class PerformanceTest extends AbstractEntitySqlGeneratorTest
Tests the performance against the currently configured test database.
Author:
Tobias Liefke
  • 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

      private void fillEntity(PerformanceTestEntity entity, int maxElementsPerEntity, Random random)
    • getGeneratorProperties

      protected Properties getGeneratorProperties()
      Description copied from class: AbstractEntitySqlGeneratorTest
      Properties for configuring the generator.
      Overrides:
      getGeneratorProperties in class AbstractEntitySqlGeneratorTest
      Returns:
      the test specific properties for the generator
    • testFastnateBulk

      @Test public void testFastnateBulk() throws SQLException
      Tests the performance of fastnate with the PostgreSqlBulkWriter.
      Throws:
      SQLException - if there is a problem with the SQL
    • testFastnateConnected

      @Test public void testFastnateConnected() throws SQLException
      Tests the performance of fastnate with the ConnectedStatementsWriter.
      Throws:
      SQLException - if there is a problem with the SQL
    • testFastnatePrebuild

      @Test public void testFastnatePrebuild() throws SQLException
      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 many PerformanceTestEntity to 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.