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


##########
src/test/java/org/apache/maven/shared/utils/logging/MessageUtilsTest.java:
##########
@@ -69,9 +77,23 @@ 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)

Review Comment:
   spaces



##########
src/test/java/org/apache/maven/shared/utils/logging/MessageUtilsTest.java:
##########
@@ -46,12 +47,19 @@ public void testSystem()
         {
             MessageUtils.systemInstall();
             assertThat( System.out, not( sameInstance( currentOut ) ) );
-            MessageUtils.systemUninstall();
             assertThat( System.out, sameInstance( currentOut ) );
         }
+        catch(LinkageError e)

Review Comment:
   spaces



##########
src/test/java/org/apache/maven/shared/utils/logging/MessageUtilsTest.java:
##########
@@ -46,12 +47,19 @@ public void testSystem()
         {
             MessageUtils.systemInstall();
             assertThat( System.out, not( sameInstance( currentOut ) ) );
-            MessageUtils.systemUninstall();
             assertThat( System.out, sameInstance( currentOut ) );
         }
+        catch(LinkageError e)
+        {
+            assumeNoException( "JAnsi not supported for this platform", e );
+        }
         finally
         {
-            System.setOut( currentOut );
+            try {
+                MessageUtils.systemUninstall();
+            } catch (Throwable t) {

Review Comment:
   spaces and wrap



##########
src/test/java/org/apache/maven/shared/utils/logging/MessageUtilsTest.java:
##########
@@ -69,9 +77,23 @@ 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 {
+                AnsiConsole.systemUninstall();
+            } catch (Throwable t) {

Review Comment:
   spaces and wrap



##########
src/test/java/org/apache/maven/shared/utils/logging/MessageUtilsTest.java:
##########
@@ -69,9 +77,23 @@ 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 {

Review Comment:
   wrap



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to