Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-1363

Test fails with commons-io version 2.15.1

    XMLWordPrintableJSON

Details

    Description

      To reproduce:
      Clone https://github.com/apache/maven-shared-utils/.
      In the main pom.xml change the version of dependency commons-io:commons-io to 2.15.1.
      Run mvn install
      Test will fail with:

      [INFO] 
      [INFO] -------------------------------------------------------
      [INFO]  T E S T S
      [INFO] -------------------------------------------------------
      [INFO] Running org.apache.maven.shared.utils.PropertyUtilsTest
      [INFO] Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.283 s -- in org.apache.maven.shared.utils.PropertyUtilsTest
      [INFO] Running org.apache.maven.shared.utils.cli.shell.BourneShellTest
      [INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.033 s -- in org.apache.maven.shared.utils.cli.shell.BourneShellTest
      [INFO] Running org.apache.maven.shared.utils.cli.CommandLineUtilsTest
      [INFO] Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.088 s -- in org.apache.maven.shared.utils.cli.CommandLineUtilsTest
      [INFO] Running org.apache.maven.shared.utils.cli.StreamPollFeederTest
      [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.948 s -- in org.apache.maven.shared.utils.cli.StreamPollFeederTest
      [INFO] Running org.apache.maven.shared.utils.xml.PrettyPrintXmlWriterTest
      [INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.067 s -- in org.apache.maven.shared.utils.xml.PrettyPrintXmlWriterTest
      [INFO] Running org.apache.maven.shared.utils.xml.XmlWriterUtilTest
      [INFO] Tests run: 23, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.046 s -- in org.apache.maven.shared.utils.xml.XmlWriterUtilTest
      [INFO] Running org.apache.maven.shared.utils.xml.pull.Xpp3DomTest
      [INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.096 s -- in org.apache.maven.shared.utils.xml.pull.Xpp3DomTest
      [INFO] Running org.apache.maven.shared.utils.xml.Xpp3DomBuilderTest
      [Fatal Error] :11:1: XML document structures must start and end within the same entity.
      [INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.083 s -- in org.apache.maven.shared.utils.xml.Xpp3DomBuilderTest
      [INFO] Running org.apache.maven.shared.utils.logging.AnsiMessageBuilderTest
      [INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.054 s -- in org.apache.maven.shared.utils.logging.AnsiMessageBuilderTest
      [INFO] Running org.apache.maven.shared.utils.logging.MessageUtilsTest
      [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 s -- in org.apache.maven.shared.utils.logging.MessageUtilsTest
      [INFO] Running org.apache.maven.shared.utils.CaseTest
      [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.154 s -- in org.apache.maven.shared.utils.CaseTest
      [INFO] Running org.apache.maven.shared.utils.introspection.ReflectionValueExtractorTest
      [INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.053 s -- in org.apache.maven.shared.utils.introspection.ReflectionValueExtractorTest
      [INFO] Running org.apache.maven.shared.utils.io.DirectoryScannerTest
      [WARNING] Tests run: 10, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.112 s -- in org.apache.maven.shared.utils.io.DirectoryScannerTest
      [INFO] Running org.apache.maven.shared.utils.io.SelectorUtilsTest
      [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.054 s -- in org.apache.maven.shared.utils.io.SelectorUtilsTest
      [INFO] Running org.apache.maven.shared.utils.io.FileUtilsTest
      [WARNING] Tests run: 101, Failures: 0, Errors: 0, Skipped: 17, Time elapsed: 0.282 s -- in org.apache.maven.shared.utils.io.FileUtilsTest
      [INFO] Running org.apache.maven.shared.utils.io.MatchPatternTest
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.050 s -- in org.apache.maven.shared.utils.io.MatchPatternTest
      [INFO] Running org.apache.maven.shared.utils.io.MatchPatternsTest
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.046 s -- in org.apache.maven.shared.utils.io.MatchPatternsTest
      [INFO] Running org.apache.maven.shared.utils.io.IOUtilTest
      [INFO] Tests run: 353, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.226 s -- in org.apache.maven.shared.utils.io.IOUtilTest
      [INFO] Running org.apache.maven.shared.utils.OsTest
      [INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.066 s -- in org.apache.maven.shared.utils.OsTest
      [INFO] Running org.apache.maven.shared.utils.StringUtilsTest
      [INFO] Tests run: 162, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.102 s -- in org.apache.maven.shared.utils.StringUtilsTest
      [INFO] Running org.apache.maven.shared.utils.XmlStreamReaderTest
      [ERROR] Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.069 s <<< FAILURE! -- in org.apache.maven.shared.utils.XmlStreamReaderTest
      [ERROR] org.apache.maven.shared.utils.XmlStreamReaderTest.testEncodingAttribute -- Time elapsed: 0.006 s <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<U[S-ASCII]> but was:<U[TF-8]>
              at junit.framework.Assert.assertEquals(Assert.java:100)
              at junit.framework.Assert.assertEquals(Assert.java:107)
              at junit.framework.TestCase.assertEquals(TestCase.java:260)
              at org.apache.maven.shared.utils.XmlStreamReaderTest.checkXmlContent(XmlStreamReaderTest.java:74)
              at org.apache.maven.shared.utils.XmlStreamReaderTest.checkXmlContent(XmlStreamReaderTest.java:62)
              at org.apache.maven.shared.utils.XmlStreamReaderTest.testEncodingAttribute(XmlStreamReaderTest.java:168)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
              at java.base/java.lang.reflect.Method.invoke(Method.java:580)
              at junit.framework.TestCase.runTest(TestCase.java:177)
              at junit.framework.TestCase.runBare(TestCase.java:142)
              at junit.framework.TestResult$1.protect(TestResult.java:122)
              at junit.framework.TestResult.runProtected(TestResult.java:142)
              at junit.framework.TestResult.run(TestResult.java:125)
              at junit.framework.TestCase.run(TestCase.java:130)
              at junit.framework.TestSuite.runTest(TestSuite.java:241)
              at junit.framework.TestSuite.run(TestSuite.java:236)
              at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
              at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316)
              at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240)
              at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214)
              at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155)
              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
              at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
              at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
              at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
      
      [INFO] Running org.apache.maven.shared.utils.PathToolTest
      [WARNING] Tests run: 4, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.092 s -- in org.apache.maven.shared.utils.PathToolTest
      [INFO] 
      [INFO] Results:
      [INFO] 
      [ERROR] Failures: 
      [ERROR]   XmlStreamReaderTest.testEncodingAttribute:168->checkXmlContent:62->checkXmlContent:74 expected:<U[S-ASCII]> but was:<U[TF-8]>
      [INFO] 
      [ERROR] Tests run: 774, Failures: 1, Errors: 0, Skipped: 19
      [INFO] 
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  24.738 s
      [INFO] Finished at: 2024-03-11T13:35:54+01:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.2:test (default-test) on project maven-shared-utils: There are test failures.
      [ERROR] 
      [ERROR] Please refer to /home/mkoncek/Upstream/maven-shared-utils/target/surefire-reports for the individual test results.
      [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
      [ERROR] -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
      

      I suspect there is a bug in commons-io.

      Attachments

        Issue Links

          Activity

            People

              slachiewicz Sylwester Lachiewicz
              mkoncek Marián Konček
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: