This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-archetypes.git
commit 43e4a7ecb167b9050360bbb5f43a7bee61e56e27 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Sat Oct 31 11:17:49 2026 +0000 Assert that the quickstart ITs run their tests --- .../src/test/resources/projects/it-basic/verify.groovy | 13 +++++++++++++ .../resources/projects/it-java-11-junit-5.x/verify.groovy | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/maven-archetype-quickstart/src/test/resources/projects/it-basic/verify.groovy b/maven-archetype-quickstart/src/test/resources/projects/it-basic/verify.groovy new file mode 100644 index 0000000..cd1c4df --- /dev/null +++ b/maven-archetype-quickstart/src/test/resources/projects/it-basic/verify.groovy @@ -0,0 +1,13 @@ +import groovy.xml.XmlSlurper + +// a project that compiles but silently skips its tests would still pass "verify", so read the surefire report +File project = new File(basedir, 'project/basic-quickstart') +File report = new File(project, 'target/surefire-reports/TEST-it.pkg.AppTest.xml') +assert report.isFile() : 'surefire did not run it.pkg.AppTest' +def suite = new XmlSlurper().parse(report) +assert [email protected]() == '1' : 'expected one test in it.pkg.AppTest' +assert [email protected]() == '0' +assert [email protected]() == '0' + +assert new File(project, 'target/basic-quickstart-0.1-SNAPSHOT.jar').isFile() +assert new File(project, 'target/site/index.html').isFile() diff --git a/maven-archetype-quickstart/src/test/resources/projects/it-java-11-junit-5.x/verify.groovy b/maven-archetype-quickstart/src/test/resources/projects/it-java-11-junit-5.x/verify.groovy new file mode 100644 index 0000000..a812717 --- /dev/null +++ b/maven-archetype-quickstart/src/test/resources/projects/it-java-11-junit-5.x/verify.groovy @@ -0,0 +1,9 @@ +import groovy.xml.XmlSlurper + +// the JUnit BOM must bring a working Jupiter engine: surefire has to report the test as run +File report = new File(basedir, 'project/java-11-junit-5x-quickstart/target/surefire-reports/TEST-it.pkg.AppTest.xml') +assert report.isFile() : 'surefire did not run it.pkg.AppTest' +def suite = new XmlSlurper().parse(report) +assert [email protected]() == '1' : 'expected one test in it.pkg.AppTest' +assert [email protected]() == '0' +assert [email protected]() == '0'
