directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [directory-ldap-api] branch master updated: Seems like this test class's methods cannot be run in parallel. gathered the two tests into one.
Date Tue, 07 May 2019 04:24:14 GMT
This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git


The following commit(s) were added to refs/heads/master by this push:
     new 359f080  Seems like this test class's methods cannot be run in parallel. gathered
the two tests into one.
359f080 is described below

commit 359f0800ef755490edb8f1d81fa2a78a36c3ba5d
Author: emmanuel lecharny <elecharny@apache.org>
AuthorDate: Tue May 7 06:24:10 2019 +0200

    Seems like this test class's methods cannot be run in parallel. gathered
    the two tests into one.
---
 .../util/exception/RuntimeMultiExceptionTest.java  | 32 ++++++++--------------
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/util/src/test/java/org/apache/directory/api/util/exception/RuntimeMultiExceptionTest.java
b/util/src/test/java/org/apache/directory/api/util/exception/RuntimeMultiExceptionTest.java
index ffdae6d..a935beb 100644
--- a/util/src/test/java/org/apache/directory/api/util/exception/RuntimeMultiExceptionTest.java
+++ b/util/src/test/java/org/apache/directory/api/util/exception/RuntimeMultiExceptionTest.java
@@ -32,14 +32,11 @@ import java.io.StringWriter;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.parallel.Execution;
-import org.junit.jupiter.api.parallel.ExecutionMode;
 
 /**
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@Execution(ExecutionMode.SAME_THREAD)
 public class RuntimeMultiExceptionTest
 {
     private PrintStream originalOut;
@@ -81,27 +78,22 @@ public class RuntimeMultiExceptionTest
         assertThat( customOut.toString(), containsString( "nested1" ) );
         assertThat( customOut.toString(), containsString( "nested2" ) );
         assertThat( systemOut.size(), equalTo( 0 ) );
-    }
-
 
-    @Test
-    public void testPrintStacktraceToPrintStreamDoesNotWriteToSystemOutErr()
-    {
-        ByteArrayOutputStream systemOut = new ByteArrayOutputStream();
-        PrintStream systemPrintStream = new PrintStream( systemOut );
-        System.setOut( systemPrintStream );
-        System.setErr( systemPrintStream );
+        ByteArrayOutputStream systemOut2 = new ByteArrayOutputStream();
+        PrintStream systemPrintStream2 = new PrintStream( systemOut2 );
+        System.setOut( systemPrintStream2 );
+        System.setErr( systemPrintStream2 );
 
-        ByteArrayOutputStream customOut = new ByteArrayOutputStream();
-        PrintStream customPrintWriter = new PrintStream( customOut );
-        RuntimeMultiException runtimeMultiException = new RuntimeMultiException( "multi"
);
+        ByteArrayOutputStream customOut2 = new ByteArrayOutputStream();
+        PrintStream customPrintWriter2 = new PrintStream( customOut2 );
+        runtimeMultiException = new RuntimeMultiException( "multi" );
         runtimeMultiException.addThrowable( new Exception( "nested1" ) );
         runtimeMultiException.addThrowable( new Exception( "nested2" ) );
-        runtimeMultiException.printStackTrace( customPrintWriter );
+        runtimeMultiException.printStackTrace( customPrintWriter2 );
 
-        assertThat( customOut.toString(), containsString( "multi" ) );
-        assertThat( customOut.toString(), containsString( "nested1" ) );
-        assertThat( customOut.toString(), containsString( "nested2" ) );
-        assertThat( systemOut.size(), equalTo( 0 ) );
+        assertThat( customOut2.toString(), containsString( "multi" ) );
+        assertThat( customOut2.toString(), containsString( "nested1" ) );
+        assertThat( customOut2.toString(), containsString( "nested2" ) );
+        assertThat( systemOut2.size(), equalTo( 0 ) );
     }
 }
\ No newline at end of file


Mime
View raw message