-
Notifications
You must be signed in to change notification settings - Fork 4
@AnalyzeSql
Jean Bisutti edited this page Sep 29, 2021
·
1 revision
The AnalyzeSql annotation builds an analysis report of the SQL executed during the test method execution.
Displayed information is:
- Number of total JDBC executions,
- Longest execution time of all JDBC executions,
- Number of queries for each type (CRUD). Please note that PLSQL like statements will not be counted.
- Alerts and or hints regarding queries syntax (usage of wildcards in select statements, N + 1 one issue etc ... See the global annotations.
- Sql queries.
This annotation accepts a Writer class (must implement WriterFactory interface) to allow writing to the desired output. See example below for file export.
// Helper class used to return a Writer class
public static class FileWriterBuilder implements WriterFactory {
@Override
public Writer buildWriter() throws IOException {
return new FileWriter(desired-path-to-exported-file);
}
}
// annotated test method
@AnalyzeSql(writerFactory = FileWriterBuilder.class)
public void select() {
...
};
}
π Β Core
π Β JVM
π Β SQL
π Β Scopes
π Β Create an annotation
π Β JUnit 4
π Β JUnit 5
π Β TestNG
π Β Spring
π Β Detect and fix N+1 SELECT
π Β Maven performance
π Β Spring Boot - JUnit 4
π Β Spring Boot - JUnit 5
π Β Micronaut Data - JUnit 5
π Β Micronaut - Spring - JUnit 5
π Β Quarkus - JUnit 5
π Β FAQ
π Β QuickPerf code