maven-surefire/0004-Port-to-current-maven-shared-utils.patch

110 lines
5.1 KiB
Diff
Raw Normal View History

--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java 2022-04-26 11:44:38.061316377 +0200
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java 2022-04-26 11:50:27.427430853 +0200
@@ -130,14 +130,24 @@
String jvmArgLine = newJvmArgLine( forkNumber );
if ( !jvmArgLine.isEmpty() )
{
- cli.createArg()
- .setLine( jvmArgLine );
+ try
+ {
+ cli.createArg().setLine( jvmArgLine );
+ }
+ catch (Exception e)
+ {
+ }
}
if ( getDebugLine() != null && !getDebugLine().isEmpty() )
{
- cli.createArg()
- .setLine( getDebugLine() );
+ try
+ {
+ cli.createArg().setLine( getDebugLine() );
+ }
+ catch (Exception e)
+ {
+ }
}
resolveClasspath( cli, findStartClass( config ), config );
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
@@ -237,6 +237,10 @@ public class StatelessXmlReporter
}
ppw.endElement(); // TestSuite
}
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
finally
{
closeQuietly( fw );
@@ -323,7 +327,7 @@ public class StatelessXmlReporter
}
private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix,
- String timeAsString )
+ String timeAsString ) throws IOException
{
ppw.startElement( "testcase" );
ppw.addAttribute( "name", report.getReportName() );
@@ -346,7 +350,7 @@ public class StatelessXmlReporter
}
private void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats,
- String timeAsString )
+ String timeAsString ) throws IOException
{
ppw.startElement( "testsuite" );
@@ -373,7 +377,7 @@ public class StatelessXmlReporter
private static void getTestProblems( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
WrappedReportEntry report, boolean trimStackTrace, OutputStream fw,
- String testErrorType, boolean createOutErrElementsInside )
+ String testErrorType, boolean createOutErrElementsInside ) throws IOException
{
ppw.startElement( testErrorType );
@@ -418,7 +422,7 @@ public class StatelessXmlReporter
// Create system-out and system-err elements
private static void createOutErrElements( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
- WrappedReportEntry report, OutputStream fw )
+ WrappedReportEntry report, OutputStream fw ) throws IOException
{
EncodingOutputStream eos = new EncodingOutputStream( fw );
addOutputStreamElement( outputStreamWriter, eos, ppw, report.getStdout(), "system-out" );
@@ -428,7 +432,7 @@ public class StatelessXmlReporter
private static void addOutputStreamElement( OutputStreamWriter outputStreamWriter,
EncodingOutputStream eos, XMLWriter xmlWriter,
Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream,
- String name )
+ String name ) throws IOException
{
if ( utf8RecodingDeferredFileOutputStream != null && utf8RecodingDeferredFileOutputStream.getByteCount() > 0 )
{
@@ -458,7 +462,7 @@ public class StatelessXmlReporter
*
* @param xmlWriter The test suite to report to
*/
- private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties )
+ private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties ) throws IOException
{
xmlWriter.startElement( "properties" );
for ( final Entry<String, String> entry : systemProperties.entrySet() )
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
<mavenPluginPluginVersion>3.5</mavenPluginPluginVersion>
<commonsLang3Version>3.5</commonsLang3Version>
<commonsIoVersion>2.5</commonsIoVersion>
- <mavenSharedUtilsVersion>0.9</mavenSharedUtilsVersion>
+ <mavenSharedUtilsVersion>3.3.3</mavenSharedUtilsVersion>
<powermockVersion>2.0.0-beta.5</powermockVersion>
<maven.surefire.scm.devConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
<maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>