From fa71be4e6d235a80200378d12ccca1feee992025 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 4 Sep 2025 18:44:44 +0200 Subject: [PATCH] HBX-3110: Add a functional test to guard the sanity of the Ant examples - Add a delimiter to 'ant/docs/examples/common/included.xml' to be able to filter the version - Adapt the 'ant/pom.xml' to copy the examples as test resources while filtering for the version - Create a new test class (doing nothing much at this time) Signed-off-by: Koen Aers --- ant/docs/examples/common/included.xml | 2 +- ant/pom.xml | 65 +++++++++++++++---- .../hibernate/tool/ant/ExamplesTestIT.java | 17 +++++ 3 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java diff --git a/ant/docs/examples/common/included.xml b/ant/docs/examples/common/included.xml index 585607f75f..aca326bd29 100644 --- a/ant/docs/examples/common/included.xml +++ b/ant/docs/examples/common/included.xml @@ -15,7 +15,7 @@ --> - + diff --git a/ant/pom.xml b/ant/pom.xml index 3fe40bcbef..1876630fbb 100644 --- a/ant/pom.xml +++ b/ant/pom.xml @@ -62,22 +62,63 @@ + + org.apache.maven.plugins + maven-resources-plugin + + + filter-test-resources + process-test-resources + + testResources + + + + + ${project.build.testOutputDirectory} + true + + common/included.xml + + + + + @*@ + + + + + org.codehaus.mojo build-helper-maven-plugin - - add-test-source - generate-test-sources - - add-test-source - - - - src/it/java - - - + + add-test-source + generate-test-sources + + add-test-source + + + + src/it/java + + + + + add-test-resource + generate-test-resources + + add-test-resource + + + + + docs/examples + + + + diff --git a/ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java b/ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java new file mode 100644 index 0000000000..2e304bc24e --- /dev/null +++ b/ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java @@ -0,0 +1,17 @@ +package org.hibernate.tool.ant; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +import java.net.URL; + +public class ExamplesTestIT { + + @Test + public void testSomethin() { + URL url = getClass().getClassLoader().getResource("5-minute-tutorial/build.xml"); + System.out.println(url); + } + +}