kwin commented on code in PR #106:
URL: https://github.com/apache/maven-shared-utils/pull/106#discussion_r928942481


##########
src/test/java/org/apache/maven/shared/utils/logging/MessageUtilsTest.java:
##########
@@ -69,9 +82,28 @@ public int getTerminalWidth()
         AnsiOutputStream aos = new AnsiOutputStream( new 
ByteArrayOutputStream(), width, AnsiMode.Default,
                 null, AnsiType.Emulation, AnsiColors.Colors256, 
StandardCharsets.UTF_8,
                 null, null, false );
-        AnsiConsole.systemInstall();
-        AnsiConsole.out = new AnsiPrintStream( aos, true );
-        assertEquals( 33, MessageUtils.getTerminalWidth() );
-        AnsiConsole.systemUninstall();
+        try
+        {
+            AnsiConsole.systemInstall();
+            AnsiConsole.out = new AnsiPrintStream( aos, true );
+            assertEquals( 33, MessageUtils.getTerminalWidth() );
+        }
+        catch( LinkageError e )
+        {
+            assumeNoException( "JAnsi not supported for this platform", e );
+        }
+        finally
+        {
+            try
+            {
+                // uninstall is always necessary due to 
https://github.com/fusesource/jansi/issues/242 
+                // but might throw exceptions
+                MessageUtils.systemUninstall();

Review Comment:
   @michael-o Our commits clashed, please replace by 
AnsiConsole.systemUninstall() for consistency reasons.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to