From aefd2e3a3062055e20880ed0ca0defbf4f3bc0ca Mon Sep 17 00:00:00 2001 From: Marvin Froeder Date: Wed, 9 Apr 2025 16:41:07 -0300 Subject: [PATCH] Reorganize project structure Signed-off-by: Marvin Froeder --- functions/pom.xml | 36 ++++++++++ .../system-functions-discovery}/pom.xml | 2 +- .../function/AutoRegisterSystemFunction.java | 0 pom.xml | 46 ++++++++++++- testing/coverage/pom.xml | 68 +++++++++++++++++++ testing/coverage/src/main/java/hoop/Code.java | 22 ++++++ .../test/java/packagereport/ReportTest.java | 28 ++++++++ {helpers => testing}/pom.xml | 3 +- .../system-functions-sample/pom.xml | 2 +- .../src/main/java/sample/Upper.java | 0 {helpers => testing}/udf-sample/pom.xml | 2 +- .../main/java/com/myudf/MyScalarFunction.java | 0 12 files changed, 203 insertions(+), 6 deletions(-) create mode 100644 functions/pom.xml rename {system-functions-discovery => functions/system-functions-discovery}/pom.xml (95%) rename {system-functions-discovery => functions/system-functions-discovery}/src/main/java/com/datasqrl/function/AutoRegisterSystemFunction.java (100%) create mode 100644 testing/coverage/pom.xml create mode 100644 testing/coverage/src/main/java/hoop/Code.java create mode 100644 testing/coverage/src/test/java/packagereport/ReportTest.java rename {helpers => testing}/pom.xml (94%) rename {helpers => testing}/system-functions-sample/pom.xml (97%) rename {helpers => testing}/system-functions-sample/src/main/java/sample/Upper.java (100%) rename {helpers => testing}/udf-sample/pom.xml (97%) rename {helpers => testing}/udf-sample/src/main/java/com/myudf/MyScalarFunction.java (100%) diff --git a/functions/pom.xml b/functions/pom.xml new file mode 100644 index 00000000..4be71a02 --- /dev/null +++ b/functions/pom.xml @@ -0,0 +1,36 @@ + + + + + 4.0.0 + + + com.datasqrl.flinkrunner + flink-sql-runner-parent + 1.0.0-SNAPSHOT + + + functions + pom + + + system-functions-discovery + + + diff --git a/system-functions-discovery/pom.xml b/functions/system-functions-discovery/pom.xml similarity index 95% rename from system-functions-discovery/pom.xml rename to functions/system-functions-discovery/pom.xml index 3ccb4c9b..1278c9d4 100644 --- a/system-functions-discovery/pom.xml +++ b/functions/system-functions-discovery/pom.xml @@ -21,7 +21,7 @@ com.datasqrl.flinkrunner - flink-sql-runner-parent + functions 1.0.0-SNAPSHOT diff --git a/system-functions-discovery/src/main/java/com/datasqrl/function/AutoRegisterSystemFunction.java b/functions/system-functions-discovery/src/main/java/com/datasqrl/function/AutoRegisterSystemFunction.java similarity index 100% rename from system-functions-discovery/src/main/java/com/datasqrl/function/AutoRegisterSystemFunction.java rename to functions/system-functions-discovery/src/main/java/com/datasqrl/function/AutoRegisterSystemFunction.java diff --git a/pom.xml b/pom.xml index 55d5c6c8..636494a3 100644 --- a/pom.xml +++ b/pom.xml @@ -50,8 +50,8 @@ - system-functions-discovery - helpers + functions + testing flink-sql-runner @@ -121,6 +121,31 @@ + + + + org.projectlombok + lombok + ${lombok.version} + provided + + + org.junit.platform + junit-platform-launcher + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + @@ -259,6 +284,22 @@ + + + org.jacoco + jacoco-maven-plugin + 0.8.11 + + + + prepare-agent + prepare-agent-integration + report + report-integration + + + + @@ -428,4 +469,5 @@ + diff --git a/testing/coverage/pom.xml b/testing/coverage/pom.xml new file mode 100644 index 00000000..e52f3dc1 --- /dev/null +++ b/testing/coverage/pom.xml @@ -0,0 +1,68 @@ + + + + 4.0.0 + + com.datasqrl.flinkrunner + testing + 1.0.0-SNAPSHOT + + + flink-sql-runner-coverage + + JaCoCo can’t actually aggregate test reposts, so we have to jump through a bunch of hoops. This is hoop numero uno. + + + + ${project.groupId} + flink-sql-runner + ${project.version} + + + ${project.groupId} + system-functions-discovery + ${project.version} + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.11 + + + report-aggregate + + report-aggregate + + verify + + + **/jacoco.exec + **/jacoco-it.exec + + + + + + + + diff --git a/testing/coverage/src/main/java/hoop/Code.java b/testing/coverage/src/main/java/hoop/Code.java new file mode 100644 index 00000000..827165fb --- /dev/null +++ b/testing/coverage/src/main/java/hoop/Code.java @@ -0,0 +1,22 @@ +/* + * Copyright © 2024 DataSQRL (contact@datasqrl.com) + * + * 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 hoop; + +/** + * JaCoCo can’t actually aggregate test reposts, so we have to jump through a bunch of hoops. This + * is hoop numero tres. + */ +public class Code {} diff --git a/testing/coverage/src/test/java/packagereport/ReportTest.java b/testing/coverage/src/test/java/packagereport/ReportTest.java new file mode 100644 index 00000000..e5951a99 --- /dev/null +++ b/testing/coverage/src/test/java/packagereport/ReportTest.java @@ -0,0 +1,28 @@ +/* + * Copyright © 2024 DataSQRL (contact@datasqrl.com) + * + * 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 packagereport; + +import org.junit.Test; + +/** + * JaCoCo can’t actually aggregate test reposts, so we have to jump through a bunch of hoops. This + * is hoop numero dos. + */ +public class ReportTest { + + @Test + public void test() {} +} diff --git a/helpers/pom.xml b/testing/pom.xml similarity index 94% rename from helpers/pom.xml rename to testing/pom.xml index 2dcc8b76..d2160b36 100644 --- a/helpers/pom.xml +++ b/testing/pom.xml @@ -26,12 +26,13 @@ 1.0.0-SNAPSHOT - helpers + testing pom system-functions-sample udf-sample + coverage diff --git a/helpers/system-functions-sample/pom.xml b/testing/system-functions-sample/pom.xml similarity index 97% rename from helpers/system-functions-sample/pom.xml rename to testing/system-functions-sample/pom.xml index d3d64a26..d0b74c13 100644 --- a/helpers/system-functions-sample/pom.xml +++ b/testing/system-functions-sample/pom.xml @@ -21,7 +21,7 @@ com.datasqrl.flinkrunner - helpers + testing 1.0.0-SNAPSHOT diff --git a/helpers/system-functions-sample/src/main/java/sample/Upper.java b/testing/system-functions-sample/src/main/java/sample/Upper.java similarity index 100% rename from helpers/system-functions-sample/src/main/java/sample/Upper.java rename to testing/system-functions-sample/src/main/java/sample/Upper.java diff --git a/helpers/udf-sample/pom.xml b/testing/udf-sample/pom.xml similarity index 97% rename from helpers/udf-sample/pom.xml rename to testing/udf-sample/pom.xml index 4caf5a7b..0f4b10df 100644 --- a/helpers/udf-sample/pom.xml +++ b/testing/udf-sample/pom.xml @@ -21,7 +21,7 @@ com.datasqrl.flinkrunner - helpers + testing 1.0.0-SNAPSHOT diff --git a/helpers/udf-sample/src/main/java/com/myudf/MyScalarFunction.java b/testing/udf-sample/src/main/java/com/myudf/MyScalarFunction.java similarity index 100% rename from helpers/udf-sample/src/main/java/com/myudf/MyScalarFunction.java rename to testing/udf-sample/src/main/java/com/myudf/MyScalarFunction.java