From 2efcf841fe72aabf6bf788246349287d5d7b7322 Mon Sep 17 00:00:00 2001 From: melloware Date: Fri, 11 Oct 2024 11:00:20 -0400 Subject: [PATCH] JSON DataSource Test --- deployment/pom.xml | 1 + .../deployment/JasperReportsProcessor.java | 14 +- .../jasperreports/JsonCustomersReport.jrxml | 65 + .../main/jasperreports/JsonOrdersReport.jrxml | 67 + .../it/JasperReportsCsvResource.java | 2 +- .../it/JasperReportsJsonResource.java | 83 + .../it/JasperReportsXmlResource.java | 4 +- .../src/main/resources/application.properties | 2 +- .../resources/{ => data}/CsvDataSource.csv | 0 .../src/main/resources/data/northwind.json | 13839 ++++++++++++++++ .../main/resources/{ => data}/northwind.xml | 0 .../it/JasperReportsJsonResourceIT.java | 8 + .../it/JasperReportsJsonResourceTest.java | 22 + 13 files changed, 14097 insertions(+), 10 deletions(-) create mode 100644 integration-tests/src/main/jasperreports/JsonCustomersReport.jrxml create mode 100644 integration-tests/src/main/jasperreports/JsonOrdersReport.jrxml create mode 100644 integration-tests/src/main/java/io/quarkiverse/jasperreports/it/JasperReportsJsonResource.java rename integration-tests/src/main/resources/{ => data}/CsvDataSource.csv (100%) create mode 100644 integration-tests/src/main/resources/data/northwind.json rename integration-tests/src/main/resources/{ => data}/northwind.xml (100%) create mode 100644 integration-tests/src/test/java/io/quarkiverse/jasperreports/it/JasperReportsJsonResourceIT.java create mode 100644 integration-tests/src/test/java/io/quarkiverse/jasperreports/it/JasperReportsJsonResourceTest.java diff --git a/deployment/pom.xml b/deployment/pom.xml index 5be0aab..7372d1d 100644 --- a/deployment/pom.xml +++ b/deployment/pom.xml @@ -32,6 +32,7 @@ io.quarkiverse.jasperreports quarkus-jasperreports + ${project.version} io.quarkus diff --git a/deployment/src/main/java/io/quarkiverse/jasperreports/deployment/JasperReportsProcessor.java b/deployment/src/main/java/io/quarkiverse/jasperreports/deployment/JasperReportsProcessor.java index 24b3bd0..fa13bb4 100644 --- a/deployment/src/main/java/io/quarkiverse/jasperreports/deployment/JasperReportsProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/jasperreports/deployment/JasperReportsProcessor.java @@ -111,18 +111,20 @@ void registerForReflection(BuildProducer reflectiveCla //@formatter:off final List classNames = new ArrayList<>(); // By Implementors: jasper interfaces/abstract classes that are created with Class.forName - classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.design.JRCompiler.class.getName())); - classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.extensions.ExtensionsRegistry.class.getName())); - classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.extensions.ExtensionsRegistryFactory.class.getName())); classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.JRDataSource.class.getName())); classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.JRDataSourceProvider.class.getName())); - classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.JRVisitor.class.getName())); - classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.xml.ReportLoader.class.getName())); classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.JRTemplate.class.getName())); - classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.query.QueryExecuterFactory.class.getName())); + classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.JRVisitor.class.getName())); + classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.design.JRCompiler.class.getName())); classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.query.JRQueryExecuter.class.getName())); + classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.query.QueryExecuterFactory.class.getName())); classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.util.xml.JRXPathExecuterFactory.class.getName())); + classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.engine.xml.ReportLoader.class.getName())); + classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.extensions.ExtensionsRegistry.class.getName())); + classNames.addAll(collectImplementors(combinedIndex, net.sf.jasperreports.extensions.ExtensionsRegistryFactory.class.getName())); classNames.addAll(collectSubclasses(combinedIndex, net.sf.jasperreports.engine.JRAbstractExporter.class.getName())); + classNames.addAll(collectSubclasses(combinedIndex, net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.class.getName())); + classNames.addAll(collectSubclasses(combinedIndex, net.sf.jasperreports.engine.query.AbstractQueryExecuterFactory.class.getName())); // By Package (utilities etc) classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.compilers.ReportExpressionEvaluationData.class.getPackageName())); diff --git a/integration-tests/src/main/jasperreports/JsonCustomersReport.jrxml b/integration-tests/src/main/jasperreports/JsonCustomersReport.jrxml new file mode 100644 index 0000000..18bc18b --- /dev/null +++ b/integration-tests/src/main/jasperreports/JsonCustomersReport.jrxml @@ -0,0 +1,65 @@ + + +