From 3a32ce8695f891d8051cccd5273758d3cd9ce54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Wed, 4 Oct 2023 08:32:33 +0200 Subject: [PATCH 7/7] Test that we don't bomb on --- test/data/install_pom/empty_relpath.pom | 182 ++++++++++++++++++ .../install_pom/test_empty_relpath-want.xml | 39 ++++ test/install_pom_test.py | 7 + 3 files changed, 228 insertions(+) create mode 100644 test/data/install_pom/empty_relpath.pom create mode 100644 test/data/install_pom/test_empty_relpath-want.xml diff --git a/test/data/install_pom/empty_relpath.pom b/test/data/install_pom/empty_relpath.pom new file mode 100644 index 00000000..785b9710 --- /dev/null +++ b/test/data/install_pom/empty_relpath.pom @@ -0,0 +1,182 @@ + + + + 4.0.0 + + + org.apache.maven.shared + maven-shared-components + 39 + + + + maven-filtering + 3.3.1 + + Apache Maven Filtering + A component to assist in filtering of resource files with properties from a Maven project. + + + + Graham Leggett + + + + + scm:git:https://gitbox.apache.org/repos/asf/maven-filtering.git + scm:git:https://gitbox.apache.org/repos/asf/maven-filtering.git + maven-filtering-3.3.1 + https://github.com/apache/maven-filtering/tree/${project.scm.tag} + + + JIRA + https://issues.apache.org/jira/issues/?jql=project%20%3D%20MSHARED%20AND%20component%20%3D%20maven-filtering + + + Jenkins + https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-filtering/ + + + + apache.website + scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path} + + + + + 8 + 3.2.5 + 1.7.36 + 0.0.7 + 2023-03-21T10:53:39Z + + + + + javax.inject + javax.inject + 1 + + + org.slf4j + slf4j-api + ${slf4jVersion} + + + org.sonatype.plexus + plexus-build-api + ${plexusBuildApiVersion} + + + org.apache.maven + maven-core + ${mavenVersion} + provided + + + org.apache.maven + maven-model + ${mavenVersion} + provided + + + org.apache.maven + maven-settings + ${mavenVersion} + provided + + + org.codehaus.plexus + plexus-utils + 3.5.1 + + + org.codehaus.plexus + plexus-interpolation + 1.26 + + + commons-io + commons-io + 2.11.0 + + + + org.mockito + mockito-core + 4.7.0 + test + + + junit + junit + 4.13.2 + test + + + org.hamcrest + hamcrest-core + 2.2 + test + + + org.slf4j + slf4j-simple + ${slf4jVersion} + test + + + org.sonatype.plexus + plexus-build-api + ${plexusBuildApiVersion} + tests + test + + + org.eclipse.sisu + org.eclipse.sisu.plexus + test + + + org.eclipse.sisu + org.eclipse.sisu.inject + test + + + + + + + + org.apache.rat + apache-rat-plugin + + + src/test/units-files/** + + + + + org.eclipse.sisu + sisu-maven-plugin + + + + diff --git a/test/data/install_pom/test_empty_relpath-want.xml b/test/data/install_pom/test_empty_relpath-want.xml new file mode 100644 index 00000000..03bd1115 --- /dev/null +++ b/test/data/install_pom/test_empty_relpath-want.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + org.apache.maven.shared + maven-filtering + 3.3.1 + + + javax.inject + javax.inject + 1 + + + org.slf4j + slf4j-api + 1.7.36 + + + org.sonatype.plexus + plexus-build-api + 0.0.7 + + + org.codehaus.plexus + plexus-utils + 3.5.1 + + + org.codehaus.plexus + plexus-interpolation + 1.26 + + + commons-io + commons-io + 2.11.0 + + + \ No newline at end of file diff --git a/test/install_pom_test.py b/test/install_pom_test.py index db79c001..a39f3aa4 100644 --- a/test/install_pom_test.py +++ b/test/install_pom_test.py @@ -103,6 +103,13 @@ class TestInstallPom(unittest.TestCase): result) self.assertEqual(report, '', report) + @install_pom('empty_relpath.pom') + def test_empty_relpath(self, stdout, stderr, return_value, result): + self.assertEqual(return_value, 0, stderr) + report = self.check_result(inspect.currentframe().f_code.co_name, + result) + self.assertEqual(report, '', report) + @install_pom(os.path.join('xmvn', 'xmvn-tools', 'xmvn-install', 'pom.xml')) def test_parent_chain(self, stdout, stderr, return_value, result): self.assertEqual(return_value, 0, stderr) -- 2.42.0