logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1582149 - /logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
Date Thu, 27 Mar 2014 02:01:31 GMT
Author: mattsicker
Date: Thu Mar 27 02:01:30 2014
New Revision: 1582149

URL: http://svn.apache.org/r1582149
Log:
Fix Java 1.6 compatibility issue.

  - No ThreadLocalRandom in 1.6, but we do have SecureRandom.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java?rev=1582149&r1=1582148&r2=1582149&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
Thu Mar 27 02:01:30 2014
@@ -21,11 +21,11 @@ import java.io.BufferedReader;
 import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.IOException;
+import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.concurrent.ThreadLocalRandom;
 
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
@@ -66,6 +66,8 @@ public class ConfigurationTest {
 
     private LoggerContext ctx;
 
+    private SecureRandom random = new SecureRandom();
+
     public ConfigurationTest(final String configFileName, final String logFileName) {
         this.configFileName = configFileName;
         this.logFileName = logFileName;
@@ -127,7 +129,7 @@ public class ConfigurationTest {
     @Test
     public void testLogToFile() throws Exception {
         final Logger logger = this.ctx.getLogger(FILE_LOGGER_NAME);
-        final long random = ThreadLocalRandom.current().nextLong();
+        final long random = this.random.nextLong();
         logger.debug("This is test message number {}", random);
         int count = 0;
         String line = "";



Mime
View raw message